OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1663 Discussions

Midlevel compiler failed on simply kernel

Pavel_Semjanov
Beginner
188 Views

Hello,

On this kernel OpenCL compiler gives the error.

[cpp]

#define bswap32(x) ( ((x) << 24) | (((x) << 8) & 0x00ff0000) | (((x) >> 8) & 0x0000ff00) | ((x) >> 24) )

__kernel void buggy(const uint input, __global uint * output)

{

output[0] = swap(input);

}

[/cpp]

Error is:

fcl build 1 succeeded.

error: Cannot select: 0x2d4e258: i32 = bswap 0x2d4e0c0 [ORD=1] [ID=6]

0x2d4e0c0: i32,ch = CopyFromReg 0x2d61944, 0x2d4e038 [ORD=1] [ID=4]

0x2d4e038: i32 = Register %vreg0 [ORD=1] [ID=1]

error: midlevel compiler failed build.

Build failed!

If I change swap definition to anything else, like,

[cpp]

#define bswap32(a) (as_uint(as_uchar4(a).wzyx))
[/cpp]

everything is ok.

It's interesting that NVIDIA had the same bug:

https://devtalk.nvidia.com/default/topic/480873/code-selection-failed-to-select-i32-bswap-0xxxxxxxxx...

0 Kudos
2 Replies
Raghupathi_M_Intel
188 Views

I am able to reproduce the issue. Thanks for posting the kernel. Will get back to you with more findings.

Raghu

Pavel_Semjanov
Beginner
188 Views

It seems to be fixed in 9.18.10.3257 driver. Thanks.

Reply