ext/cumo/cuda/driver.c in cumo-0.1.1 vs ext/cumo/cuda/driver.c in cumo-0.1.2
- old
+ new
@@ -385,10 +385,13 @@
}
void
Init_cumo_cuda_driver()
{
+ CUdevice cuDevice;
+ CUcontext context;
+
VALUE mCumo = rb_define_module("Cumo");
VALUE mCUDA = rb_define_module_under(mCumo, "CUDA");
mDriver = rb_define_module_under(mCUDA, "Driver");
eDriverError = rb_define_class_under(mCUDA, "DriverError", rb_eStandardError);
@@ -411,11 +414,9 @@
rb_define_const(mDriver, "CU_JIT_INPUT_FATBINARY", INT2NUM(CU_JIT_INPUT_FATBINARY));
rb_define_const(mDriver, "CU_JIT_INPUT_LIBRARY", INT2NUM(CU_JIT_INPUT_LIBRARY));
rb_define_const(mDriver, "CU_JIT_INPUT_OBJECT", INT2NUM(CU_JIT_INPUT_OBJECT));
rb_define_const(mDriver, "CU_JIT_INPUT_PTX", INT2NUM(CU_JIT_INPUT_PTX));
- CUdevice cuDevice;
- CUcontext context;
cuInit(0);
cuDeviceGet(&cuDevice, 0);
cuCtxCreate(&context, 0, cuDevice);
}