Software Archive
Read-only legacy content
17061 Discussions

MKL_Complex16 not bitwise copyable

Paul_S_
Beginner
535 Views

Hello,

I need to offload a ZGEMM call to the xeon phi. Unfortunately, the compiler is complaining that "variable 'A' used in this offload region is not bitwise copyable". However, A is just a MKL_Complex16 pointer. So far the MKL_Complex16 type never gave me any problems.

Since MKL_Complex16 is just a plain struct with two doubles, the following explanation does not really apply:  https://software.intel.com/en-us/articles/effective-use-of-the-intel-compilers-offload-features

void foo(MKL_Complex16 *A, MKL_Complex16 *B, MKL_Complex16 *C, ... some more arguments...)
{  
  //... some initialization ...

  alpha = MKL_Complex16 (sigma_1 / e, 0.0);
  beta = MKL_Complex16 (0.0, 0.0);

  const int matrix_elements = n*n;

   #pragma offload target(mic:0) \
	in(A: length(matrix_elements) free_if(1)) \
	in(B: length(matrix_elements) free_if(1)) \
	in(C:length(matrix_elements)) \
	out(C:length(matrix_elements) free_if(1))
  zgemm("N", "N", &n, &n, &n, &alpha, (const MKL_Complex16*)(A), &n,
        (const MKL_Complex16*)B, &n, &beta, C, &n);
  
  //... something else ...
}

What could be the problem here?

Thanks,

Paul

0 Kudos
4 Replies
Kevin_D_Intel
Employee
535 Views

The example I coded up does not produce any such warning/error so I'm not sure what I'm doing (or not) to match your snippet and am checking w/Development. Stay tuned....

0 Kudos
Kevin_D_Intel
Employee
535 Views

Development is also unable to reproduce this and I also tried compilers back to 13.1 without success in producing any compilation warning/error.

Can you please provide us with a reproducer that we can investigate further?

Also, please let us know the version of your compiler (icc -V -or- icpc -V)?

Thank you

0 Kudos
Paul_S_
Beginner
535 Views

Hi Kevin, thanks for your help.

sorry for the mess up. As it turns out someone defined MKL_Complex16 to be complex<double>.

-- problem solved --

0 Kudos
Kevin_D_Intel
Employee
535 Views

Ok, thank you. Glad it was resolved.

0 Kudos
Reply