Skip to content

Commit bd8a818

Browse files
committed
[Offload] Add cuLaunchHostFunc to dynamic cuda
Summary: This was missing, causing non-directly linked builds to fail.
1 parent 134401d commit bd8a818

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

offload/plugins-nextgen/cuda/dynamic_cuda/cuda.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ DLWRAP(cuDriverGetVersion, 1)
3939

4040
DLWRAP(cuGetErrorString, 2)
4141
DLWRAP(cuLaunchKernel, 11)
42+
DLWRAP(cuLaunchHostFunc, 3)
4243

4344
DLWRAP(cuMemAlloc, 2)
4445
DLWRAP(cuMemAllocHost, 2)

offload/plugins-nextgen/cuda/dynamic_cuda/cuda.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ typedef uintptr_t CUdeviceptr;
3030
typedef struct CUmod_st *CUmodule;
3131
typedef struct CUctx_st *CUcontext;
3232
typedef struct CUfunc_st *CUfunction;
33+
typedef void (*CUhostFn)(void *userData);
3334
typedef struct CUstream_st *CUstream;
3435
typedef struct CUevent_st *CUevent;
3536

36-
#define CU_DEVICE_INVALID ((CUdevice)-2)
37+
#define CU_DEVICE_INVALID ((CUdevice)(-2))
3738

3839
typedef unsigned long long CUmemGenericAllocationHandle_v1;
3940
typedef CUmemGenericAllocationHandle_v1 CUmemGenericAllocationHandle;
4041

41-
#define CU_DEVICE_INVALID ((CUdevice)-2)
42+
#define CU_DEVICE_INVALID ((CUdevice)(-2))
4243

4344
typedef enum CUmemAllocationGranularity_flags_enum {
4445
CU_MEM_ALLOC_GRANULARITY_MINIMUM = 0x0,
@@ -304,6 +305,7 @@ CUresult cuInit(unsigned);
304305
CUresult cuLaunchKernel(CUfunction, unsigned, unsigned, unsigned, unsigned,
305306
unsigned, unsigned, unsigned, CUstream, void **,
306307
void **);
308+
CUresult cuLaunchHostFunc(CUstream, CUhostFn, void *);
307309

308310
CUresult cuMemAlloc(CUdeviceptr *, size_t);
309311
CUresult cuMemAllocHost(void **, size_t);

0 commit comments

Comments
 (0)