Ejemplo n.º 1
0
def test_GpuVerify_data_race():
    code = """\
__kernel void A(__global float* a) {
  a[0] +=  1.0f;
}"""
    with pytest.raises(deeplearning.clgen.errors.GPUVerifyException):
        opencl.GpuVerify(code, ["--local_size=64", "--num_groups=128"])
Ejemplo n.º 2
0
def test_GpuVerify():
  code = """\
__kernel void A(__global float* a) {
  int b = get_global_id(0);
  a[b] *= 2.0f;
}"""
  assert opencl.GpuVerify(code, ["--local_size=64", "--num_groups=128"]) == code