Quantcast
Channel: Intel® Software - OpenCL*
Viewing all articles
Browse latest Browse all 1182

Unable to compile openCL kernel for Xeon Phi: LLVM ERROR

$
0
0

Hello

When trying to compile a very simple OpenCL kernel.cl on a MIC device, I get the following error: LLVM ERROR: Non implemented constant type

Apparently, the source of the problem is the static array:

__constant _Complex double lookupTable_ipow_pos[4] = { 1, I, -1,-I };

The compilation of the same kernel and the execution on a CPU Xeon device works perfectly.
If I use double or int instead of _Complex double, it also compiles and runs fine, so this LLVM error is triggered exclusively by the _Complex double and the MIC device.

This is the kernel.cl:

#include <complex.h>
#include "ipown.h"
void kernel simple_add(global const _Complex double * A, global const _Complex double* B, global _Complex double* C){
      C[get_global_id(0)]=A[get_global_id(0)]+B[get_global_id(0)] + ipown(get_global_id(0));
}                                                                           

And this is ipown.h:

__constant _Complex double lookupTable_ipow_pos[4] = { 1, I, -1,-I };

inline _Complex double ipown( int n )
{
    return lookupTable_ipow_pos[ n % 4 ];
}

Anyone is familiar with this issue?
Thanks in advance.


Viewing all articles
Browse latest Browse all 1182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>