- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
this simple test code is this(testclass.cpp):
#include <iostream>
class TEST{
public:
double *A;
public:
TEST(double * _A){A = _A;}
void run(){
A[1] = 0;
// double *B = A;
std::cout<<A[1]<<std::endl;
#pragma offload target (mic) inout(A:length(2*3))
{
A[1] = 1;
}
std::cout<<A[1]<<std::endl;
}
};
int main()
{
double *A = (double*)_mm_malloc(sizeof(double)*2*3,64);
TEST test(A);
test.run();
}
.............................................................................................
after complile and run ,this give me this error:
[root@localhost yb]# icpc testclass.cpp
[root@localhost yb]# ./a.out
0
Segmentation fault (core dumped)
......................................................................
thanks.
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
It relates to the underlying "this" pointer. I need to check with someone more knowledgeable about the requirements for offload within the CLASS, but for now add the additional nocopy clause as shown below to create an instance of the underlying "this" pointer.
#pragma offload target (mic) nocopy(this : alloc_if(1) free_if(0)) inout(A:length(2*3))
