Child Kernel Problem

Aloha,

My Kernel looks as


kernel void launcher() 
{ 
    ndrange_t ndrange = ndrange_1D(1);
    enqueue_kernel(get_default_queue(), CLK_ENQUEUE_FLAGS_WAIT_KERNEL, ndrange,
    ^{
    size_t id = get_global_id(0);
    }
    );
}

There is an uncatched exception thrown when building the program. This shouldn’t happen, because all cl::Error’s are caught.

I’m sure that the enqueue_kernel Block is the cause for the error, because there is no error, when it is removed.

Exact Error is


Unhandled exception at 0x00007FF9A1914651 (amdocl64.dll) in ArrayTest.exe: 0xC0000005: Access violation reading location 0x000000000000000C.

Anyone have a idea how to fix this?

I would have edited my previous post but I can’t…

The kernel in the previous post is of course wrong.


void
binarySearch_device_enqueue_multiKeys_child(void);
 
__kernel void
binarySearch_device_enqueue_multiKeys(int globalDamns)
{
    unsigned int tid = get_global_id(0);
     

    queue_t defQ = get_default_queue();
    ndrange_t ndrange1 = ndrange_1D(1);

    /**** Kernel Block *****/
    void (^binarySearch_device_enqueue_wrapper_blk)(void) = ^{binarySearch_device_enqueue_multiKeys_child();};
    int err_ret = enqueue_kernel(defQ,CLK_ENQUEUE_FLAGS_WAIT_KERNEL,ndrange1,binarySearch_device_enqueue_wrapper_blk);
}

void
binarySearch_device_enqueue_multiKeys_child()
{
printf("foo!");
}

New Minimal example:


__kernel void testvoid()
{
    unsigned int tid = get_global_id(0);
    queue_t defQ = get_default_queue();
    ndrange_t ndrange1 = ndrange_1D(1);
    void (^enqueue_blk)(void) = ^{printf(\"foo\");};
}

Throws an uncaught exception which defo shouldn’t happen.