Failed to build program when using assembly code in OpenCL kernel with oneapi-construction-kit

Failed to build program when using assembly code in OpenCL kernel with oneapi-construction-kit

The OpenCL kernel code is as follows:

kernel void clasm_add_test(global int *a, global int *b, global int *z) {
size_t id = get_global_id(0);
asm volatile("add %[zid], %[aid], %[bid]\n\t"
: [zid] "=r"(z[id])
: [aid] "r"(a[id]), [bid] "r"(b[id])
:);
}

It should calculate the element-wise sum of array a and b and store the result in array z .

Failed to build the program and build log is empty.

Minimal test case
a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
b[10] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};

How to solve this problem please?

This is a duplicate of #744 in our github issues, we will reply there. Please close here.

1 Like
1 Like