my code is this:
__________________________________________
#include <iostream>
class TEST{
public:
double *A;
public:
TEST(double * _A){
A = _A;
#pragma offload_transfer target(mic:0) nocopy(this : alloc_if(1) free_if(0)) in(A:length(2*3) alloc_if(1) free_if(0))
}
void run(){
A[1] = 0;
// double *B = A;
std::cout<<A[1]<<std::endl;
#pragma offload target (mic) nocopy(this : alloc_if(1) free_if(0)) out(A:length(2*3) alloc_if(0) free_if(1))
{
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();
}
______________________________________________________
I want to copy the matrix A in TEST constructor first,and then in run() using it.but it give me some error when I compile the code
------------------------------------------------------------
$ icpc testclass.cpp
testclass.cpp(9): internal error: bad pointer
#pragma offload_transfer target(mic:0) nocopy(this : alloc_if(1) free_if(0)) in(A:length(2*3) alloc_if(1) free_if(0))
^
compilation aborted for testclass.cpp (code 4)
--------------------------------------------------------------
could someone help me figure out what wrong with this ,thanks.