Commit af9434b4 authored by Cianciosa, Mark's avatar Cianciosa, Mark
Browse files

Keep the kernel program in memory until the module is built.

parent d37c2bad
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -191,12 +191,12 @@ namespace gpu {
            check_nvrtc_error(nvrtcGetPTXSize(kernel_program, &ptx_size),
                              "nvrtcGetPTXSize");

            check_nvrtc_error(nvrtcDestroyProgram(&kernel_program),
                              "nvrtcDestroyProgram");

            char *ptx = static_cast<char *> (malloc(ptx_size));
            check_nvrtc_error(nvrtcGetPTX(kernel_program, ptx), "nvrtcGetPTX");

            check_nvrtc_error(nvrtcDestroyProgram(&kernel_program),
                              "nvrtcDestroyProgram");

            check_error(cuModuleLoadDataEx(&module, ptx, 0, NULL, NULL), "cuModuleLoadDataEx");

            free(ptx);