This repository was archived by the owner on Apr 28, 2023. It is now read-only.
Commit 5d21837
committed
CudaRTCFunction: do not unload the module that was never loaded
In CudaRTCFunction::Launch, we first add (empty) module to the per-GPU
list of modules, and only then try to load it from PTX. The load part
may fail and throw, the module in the list remaining empty. When the
CudaRTCFunction is destroyed, its destructor tries to unload the module
available in the list. Since the module is empty, unloading fails and
throws. The exception does not seem to be handled, and can even happen
during unwinding of another exception leading to immediate termination.
Load CUmodule and extract CUfunction using local variables, and insert
the values into respective per-GPU lists only when the respective
operation has completed successfully, i.e. without throwing. If it
throws, nothing is inserted and thus the destructor will not attempt to
clean non-existent objects.1 parent 8ffd5cd commit 5d21837
1 file changed
+8
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
0 commit comments