Added NVCC support and name changes
- Added NVCC support for module APIs - Changed hipFunction and hipModule data types to hipFunction_t and hipModule_t - Created new intenal ihipModuleGetFunction as it is used twice - Changed test to match with the new data types Change-Id: I300a1c7fd40ed7065b1b8b9de97e3a06b96ed729
This commit is contained in:
@@ -52,9 +52,9 @@ typedef struct ihipDevice_t *hipDevice_t;
|
||||
|
||||
typedef struct ihipStream_t *hipStream_t;
|
||||
|
||||
typedef struct ihipModule_t *hipModule;
|
||||
typedef struct ihipModule_t *hipModule_t;
|
||||
|
||||
typedef struct ihipFunction_t *hipFunction;
|
||||
typedef struct ihipFunction_t *hipFunction_t;
|
||||
|
||||
typedef void* hipDeviceptr;
|
||||
|
||||
@@ -1134,17 +1134,17 @@ hipError_t hipDeviceGetFromId(hipDevice_t *device, int deviceId);
|
||||
hipError_t hipDriverGetVersion(int *driverVersion) ;
|
||||
|
||||
|
||||
hipError_t hipModuleLoad(hipModule *module, const char *fname);
|
||||
hipError_t hipModuleLoad(hipModule_t *module, const char *fname);
|
||||
|
||||
hipError_t hipModuleUnload(hipModule module);
|
||||
hipError_t hipModuleUnload(hipModule_t module);
|
||||
|
||||
hipError_t hipModuleGetFunction(hipFunction *function, hipModule module, const char *kname);
|
||||
hipError_t hipModuleGetFunction(hipFunction_t *function, hipModule_t module, const char *kname);
|
||||
|
||||
hipError_t hipModuleGetGlobal(hipDeviceptr *dptr, size_t *bytes, hipModule hmod, const char *name);
|
||||
hipError_t hipModuleGetGlobal(hipDeviceptr *dptr, size_t *bytes, hipModule_t hmod, const char *name);
|
||||
|
||||
hipError_t hipModuleLoadData(hipModule *module, const void *image);
|
||||
hipError_t hipModuleLoadData(hipModule_t *module, const void *image);
|
||||
|
||||
hipError_t hipLaunchModuleKernel(hipFunction f,
|
||||
hipError_t hipLaunchModuleKernel(hipFunction_t f,
|
||||
unsigned int gridDimX,
|
||||
unsigned int gridDimY,
|
||||
unsigned int gridDimZ,
|
||||
|
||||
@@ -64,6 +64,10 @@ typedef CUcontext hipCtx_t;
|
||||
typedef CUsharedconfig hipSharedMemConfig;
|
||||
typedef CUfunc_cache hipFuncCache;
|
||||
typedef CUdevice hipDevice_t;
|
||||
typedef CUModule hipModule_t;
|
||||
typedef CUFunction hipFunction_t;
|
||||
typedef CUdeviceptr hipDeviceptr;
|
||||
|
||||
//typedef cudaChannelFormatDesc hipChannelFormatDesc;
|
||||
#define hipChannelFormatDesc cudaChannelFormatDesc
|
||||
|
||||
@@ -581,6 +585,33 @@ inline static hipError_t hipCtxGetFlags ( unsigned int* flags )
|
||||
return hipCUResultTohipError(cuCtxGetFlags ( flags ));
|
||||
}
|
||||
|
||||
inline static hipError_t hipModuleGetFunction(hipFunction_t *function,
|
||||
hipModule_t module, const char *kname)
|
||||
{
|
||||
return hipCUResultTohipError(cuModuleGetFunction(function, module, kname));
|
||||
}
|
||||
|
||||
inline static hipError_t hipModuleGetGlobal(hipDeviceptr *dptr, size_t *bytes,
|
||||
hipModule_t hmod, const char* name)
|
||||
{
|
||||
return hipCUResultTohipError(cuModuleGetGlobal(dptr, bytes, hmod, name));
|
||||
}
|
||||
|
||||
inline static hipError_t hipModuleLoad(hipModule_t *module, const char* fname)
|
||||
{
|
||||
return hipCUResultTohipError(cuModuleLoad(module, fname));
|
||||
}
|
||||
|
||||
inline static hipError_t hipModuleLoadData(hipModule_t *module, const void *image)
|
||||
{
|
||||
return hipCUResultTohipError(cuModuleLoadData(module, image));
|
||||
}
|
||||
|
||||
inline static hipError_t hipModuleUnload(hipModule_t hmod)
|
||||
{
|
||||
return hipCUResultTohipError(cuModuleUnload(hmod));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user