'Can I dereference and assign a value to a pointer in Metal Shader
I would like to dereference a pointer and assign it a value in a Metal Shader (Kernel), like so (simple example);
kernel void test_kernel()
{
device uint64_t* ptr;
*ptr = 1;
}
When I run this I get the following error;
Execution of the command buffer was aborted due to an error during execution.
Caused GPU Hang Error (00000003:kIOGPUCommandBufferCallbackErrorHang)
This is caused by the line, *ptr = 1.
Am I missing something here? Can you dereference a device pointer in Metal Shader?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
