|
30 | 30 | #ifdef _WIN32
|
31 | 31 | #define MLIR_CUDA_WRAPPERS_EXPORT __declspec(dllexport)
|
32 | 32 | #else
|
33 |
| -#define MLIR_CUDA_WRAPPERS_EXPORT |
| 33 | +#define MLIR_CUDA_WRAPPERS_EXPORT __attribute__((visibility("default"))) |
34 | 34 | #endif // _WIN32
|
35 | 35 |
|
36 | 36 | #define CUDA_REPORT_IF_ERROR(expr) \
|
@@ -226,43 +226,44 @@ extern "C" MLIR_CUDA_WRAPPERS_EXPORT void mgpuEventDestroy(CUevent event) {
|
226 | 226 | CUDA_REPORT_IF_ERROR(cuEventDestroy(event));
|
227 | 227 | }
|
228 | 228 |
|
229 |
| -extern MLIR_CUDA_WRAPPERS_EXPORT "C" void mgpuEventSynchronize(CUevent event) { |
| 229 | +extern "C" MLIR_CUDA_WRAPPERS_EXPORT void mgpuEventSynchronize(CUevent event) { |
230 | 230 | CUDA_REPORT_IF_ERROR(cuEventSynchronize(event));
|
231 | 231 | }
|
232 | 232 |
|
233 |
| -extern MLIR_CUDA_WRAPPERS_EXPORT "C" void mgpuEventRecord(CUevent event, |
| 233 | +extern "C" MLIR_CUDA_WRAPPERS_EXPORT void mgpuEventRecord(CUevent event, |
234 | 234 | CUstream stream) {
|
235 | 235 | CUDA_REPORT_IF_ERROR(cuEventRecord(event, stream));
|
236 | 236 | }
|
237 | 237 |
|
238 |
| -extern "C" void *mgpuMemAlloc(uint64_t sizeBytes, CUstream /*stream*/, |
239 |
| - bool /*isHostShared*/) { |
| 238 | +extern "C" MLIR_CUDA_WRAPPERS_EXPORT void * |
| 239 | +mgpuMemAlloc(uint64_t sizeBytes, CUstream /*stream*/, bool /*isHostShared*/) { |
240 | 240 | ScopedContext scopedContext;
|
241 | 241 | CUdeviceptr ptr = 0;
|
242 | 242 | if (sizeBytes != 0)
|
243 | 243 | CUDA_REPORT_IF_ERROR(cuMemAlloc(&ptr, sizeBytes));
|
244 | 244 | return reinterpret_cast<void *>(ptr);
|
245 | 245 | }
|
246 | 246 |
|
247 |
| -extern "C" void mgpuMemFree(void *ptr, CUstream /*stream*/) { |
| 247 | +extern "C" MLIR_CUDA_WRAPPERS_EXPORT void mgpuMemFree(void *ptr, |
| 248 | + CUstream /*stream*/) { |
248 | 249 | CUDA_REPORT_IF_ERROR(cuMemFree(reinterpret_cast<CUdeviceptr>(ptr)));
|
249 | 250 | }
|
250 | 251 |
|
251 |
| -extern "C" void mgpuMemcpy(void *dst, void *src, size_t sizeBytes, |
252 |
| - CUstream stream) { |
| 252 | +extern "C" MLIR_CUDA_WRAPPERS_EXPORT void |
| 253 | +mgpuMemcpy(void *dst, void *src, size_t sizeBytes, CUstream stream) { |
253 | 254 | CUDA_REPORT_IF_ERROR(cuMemcpyAsync(reinterpret_cast<CUdeviceptr>(dst),
|
254 | 255 | reinterpret_cast<CUdeviceptr>(src),
|
255 | 256 | sizeBytes, stream));
|
256 | 257 | }
|
257 | 258 |
|
258 |
| -extern "C" void mgpuMemset32(void *dst, unsigned int value, size_t count, |
259 |
| - CUstream stream) { |
| 259 | +extern "C" MLIR_CUDA_WRAPPERS_EXPORT void |
| 260 | +mgpuMemset32(void *dst, unsigned int value, size_t count, CUstream stream) { |
260 | 261 | CUDA_REPORT_IF_ERROR(cuMemsetD32Async(reinterpret_cast<CUdeviceptr>(dst),
|
261 | 262 | value, count, stream));
|
262 | 263 | }
|
263 | 264 |
|
264 |
| -extern "C" void mgpuMemset16(void *dst, unsigned short value, size_t count, |
265 |
| - CUstream stream) { |
| 265 | +extern "C" MLIR_CUDA_WRAPPERS_EXPORT void |
| 266 | +mgpuMemset16(void *dst, unsigned short value, size_t count, CUstream stream) { |
266 | 267 | CUDA_REPORT_IF_ERROR(cuMemsetD16Async(reinterpret_cast<CUdeviceptr>(dst),
|
267 | 268 | value, count, stream));
|
268 | 269 | }
|
|
0 commit comments