ldc/tests/codegen/inputs/kernel.d
Rob Rau 9782862579
Fix wrong dcompute address space loads and stores (#3428)
If the special dcompute pointer types get instantiated in host code
for any reason, ldc holds on to the llvm type created during the host
codegen phase during the device codegen phase and won't mark the
proper address space.
2020-07-03 20:10:25 +02:00

16 lines
323 B
D

@compute(CompileFor.deviceOnly)
module inputs.kernel;
import ldc.dcompute;
@kernel void k_foo(GlobalPointer!float x_in)
{
SharedPointer!float shared_x;
PrivatePointer!float private_x;
ConstantPointer!float const_x;
*shared_x = *x_in;
*private_x = *x_in;
*x_in = *const_x;
*x_in = *shared_x;
*x_in = *private_x;
}