|
|
@ -34,7 +34,8 @@ typedef struct CUmod_st *CUmodule; /**< CUDA module */
|
|
|
|
typedef struct CUstream_st *CUstream; /**< CUDA stream */
|
|
|
|
typedef struct CUstream_st *CUstream; /**< CUDA stream */
|
|
|
|
typedef struct CUlinkState_st *CUlinkState;
|
|
|
|
typedef struct CUlinkState_st *CUlinkState;
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum cudaError_enum {
|
|
|
|
typedef enum cudaError_enum
|
|
|
|
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* The API call returned with no errors. In the case of query calls, this
|
|
|
|
* The API call returned with no errors. In the case of query calls, this
|
|
|
|
* also means that the operation being queried is complete (see
|
|
|
|
* also means that the operation being queried is complete (see
|
|
|
@ -530,6 +531,7 @@ typedef enum cudaError_enum {
|
|
|
|
* This indicates that an unknown internal error has occurred.
|
|
|
|
* This indicates that an unknown internal error has occurred.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
CUDA_ERROR_UNKNOWN = 999
|
|
|
|
CUDA_ERROR_UNKNOWN = 999
|
|
|
|
|
|
|
|
|
|
|
|
} CUresult;
|
|
|
|
} CUresult;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -710,7 +712,8 @@ typedef enum CUjit_option_enum
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Device properties
|
|
|
|
* Device properties
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
typedef enum CUdevice_attribute_enum {
|
|
|
|
typedef enum CUdevice_attribute_enum
|
|
|
|
|
|
|
|
{
|
|
|
|
CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1, /**< Maximum number of threads per block */
|
|
|
|
CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1, /**< Maximum number of threads per block */
|
|
|
|
CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = 2, /**< Maximum block dimension X */
|
|
|
|
CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = 2, /**< Maximum block dimension X */
|
|
|
|
CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = 3, /**< Maximum block dimension Y */
|
|
|
|
CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = 3, /**< Maximum block dimension Y */
|
|
|
@ -818,31 +821,37 @@ typedef enum CUdevice_attribute_enum {
|
|
|
|
CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES = 100, /**< Device accesses pageable memory via the host's page tables. */
|
|
|
|
CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES = 100, /**< Device accesses pageable memory via the host's page tables. */
|
|
|
|
CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST = 101, /**< The host can directly access managed memory on the device without migration. */
|
|
|
|
CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST = 101, /**< The host can directly access managed memory on the device without migration. */
|
|
|
|
CU_DEVICE_ATTRIBUTE_MAX
|
|
|
|
CU_DEVICE_ATTRIBUTE_MAX
|
|
|
|
|
|
|
|
|
|
|
|
} CUdevice_attribute;
|
|
|
|
} CUdevice_attribute;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Function cache configurations
|
|
|
|
* Function cache configurations
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
typedef enum CUfunc_cache_enum {
|
|
|
|
typedef enum CUfunc_cache_enum
|
|
|
|
|
|
|
|
{
|
|
|
|
CU_FUNC_CACHE_PREFER_NONE = 0x00, /**< no preference for shared memory or L1 (default) */
|
|
|
|
CU_FUNC_CACHE_PREFER_NONE = 0x00, /**< no preference for shared memory or L1 (default) */
|
|
|
|
CU_FUNC_CACHE_PREFER_SHARED = 0x01, /**< prefer larger shared memory and smaller L1 cache */
|
|
|
|
CU_FUNC_CACHE_PREFER_SHARED = 0x01, /**< prefer larger shared memory and smaller L1 cache */
|
|
|
|
CU_FUNC_CACHE_PREFER_L1 = 0x02, /**< prefer larger L1 cache and smaller shared memory */
|
|
|
|
CU_FUNC_CACHE_PREFER_L1 = 0x02, /**< prefer larger L1 cache and smaller shared memory */
|
|
|
|
CU_FUNC_CACHE_PREFER_EQUAL = 0x03 /**< prefer equal sized L1 cache and shared memory */
|
|
|
|
CU_FUNC_CACHE_PREFER_EQUAL = 0x03 /**< prefer equal sized L1 cache and shared memory */
|
|
|
|
|
|
|
|
|
|
|
|
} CUfunc_cache;
|
|
|
|
} CUfunc_cache;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Shared memory configurations
|
|
|
|
* Shared memory configurations
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
typedef enum CUsharedconfig_enum {
|
|
|
|
typedef enum CUsharedconfig_enum
|
|
|
|
|
|
|
|
{
|
|
|
|
CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE = 0x00, /**< set default shared memory bank size */
|
|
|
|
CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE = 0x00, /**< set default shared memory bank size */
|
|
|
|
CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE = 0x01, /**< set shared memory bank width to four bytes */
|
|
|
|
CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE = 0x01, /**< set shared memory bank width to four bytes */
|
|
|
|
CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE = 0x02 /**< set shared memory bank width to eight bytes */
|
|
|
|
CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE = 0x02 /**< set shared memory bank width to eight bytes */
|
|
|
|
|
|
|
|
|
|
|
|
} CUsharedconfig;
|
|
|
|
} CUsharedconfig;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Function properties
|
|
|
|
* Function properties
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
typedef enum CUfunction_attribute_enum {
|
|
|
|
typedef enum CUfunction_attribute_enum
|
|
|
|
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* The maximum number of threads per block, beyond which a launch of the
|
|
|
|
* The maximum number of threads per block, beyond which a launch of the
|
|
|
|
* function would fail. This number depends on both the function and the
|
|
|
|
* function would fail. This number depends on both the function and the
|
|
|
@ -915,12 +924,14 @@ typedef enum CUfunction_attribute_enum {
|
|
|
|
CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 9,
|
|
|
|
CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 9,
|
|
|
|
|
|
|
|
|
|
|
|
CU_FUNC_ATTRIBUTE_MAX
|
|
|
|
CU_FUNC_ATTRIBUTE_MAX
|
|
|
|
|
|
|
|
|
|
|
|
} CUfunction_attribute;
|
|
|
|
} CUfunction_attribute;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Context creation flags
|
|
|
|
* Context creation flags
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
typedef enum CUctx_flags_enum {
|
|
|
|
typedef enum CUctx_flags_enum
|
|
|
|
|
|
|
|
{
|
|
|
|
CU_CTX_SCHED_AUTO = 0x00, /**< Automatic scheduling */
|
|
|
|
CU_CTX_SCHED_AUTO = 0x00, /**< Automatic scheduling */
|
|
|
|
CU_CTX_SCHED_SPIN = 0x01, /**< Set spin as default scheduling */
|
|
|
|
CU_CTX_SCHED_SPIN = 0x01, /**< Set spin as default scheduling */
|
|
|
|
CU_CTX_SCHED_YIELD = 0x02, /**< Set yield as default scheduling */
|
|
|
|
CU_CTX_SCHED_YIELD = 0x02, /**< Set yield as default scheduling */
|
|
|
@ -932,24 +943,29 @@ typedef enum CUctx_flags_enum {
|
|
|
|
CU_CTX_MAP_HOST = 0x08, /**< Support mapped pinned allocations */
|
|
|
|
CU_CTX_MAP_HOST = 0x08, /**< Support mapped pinned allocations */
|
|
|
|
CU_CTX_LMEM_RESIZE_TO_MAX = 0x10, /**< Keep local memory allocation after launch */
|
|
|
|
CU_CTX_LMEM_RESIZE_TO_MAX = 0x10, /**< Keep local memory allocation after launch */
|
|
|
|
CU_CTX_FLAGS_MASK = 0x1f
|
|
|
|
CU_CTX_FLAGS_MASK = 0x1f
|
|
|
|
|
|
|
|
|
|
|
|
} CUctx_flags;
|
|
|
|
} CUctx_flags;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Stream creation flags
|
|
|
|
* Stream creation flags
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
typedef enum CUstream_flags_enum {
|
|
|
|
typedef enum CUstream_flags_enum
|
|
|
|
|
|
|
|
{
|
|
|
|
CU_STREAM_DEFAULT = 0x0, /**< Default stream flag */
|
|
|
|
CU_STREAM_DEFAULT = 0x0, /**< Default stream flag */
|
|
|
|
CU_STREAM_NON_BLOCKING = 0x1 /**< Stream does not synchronize with stream 0 (the NULL stream) */
|
|
|
|
CU_STREAM_NON_BLOCKING = 0x1 /**< Stream does not synchronize with stream 0 (the NULL stream) */
|
|
|
|
|
|
|
|
|
|
|
|
} CUstream_flags;
|
|
|
|
} CUstream_flags;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Event creation flags
|
|
|
|
* Event creation flags
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
typedef enum CUevent_flags_enum {
|
|
|
|
typedef enum CUevent_flags_enum
|
|
|
|
|
|
|
|
{
|
|
|
|
CU_EVENT_DEFAULT = 0x0, /**< Default event flag */
|
|
|
|
CU_EVENT_DEFAULT = 0x0, /**< Default event flag */
|
|
|
|
CU_EVENT_BLOCKING_SYNC = 0x1, /**< Event uses blocking synchronization */
|
|
|
|
CU_EVENT_BLOCKING_SYNC = 0x1, /**< Event uses blocking synchronization */
|
|
|
|
CU_EVENT_DISABLE_TIMING = 0x2, /**< Event will not record timing data */
|
|
|
|
CU_EVENT_DISABLE_TIMING = 0x2, /**< Event will not record timing data */
|
|
|
|
CU_EVENT_INTERPROCESS = 0x4 /**< Event is suitable for interprocess use. CU_EVENT_DISABLE_TIMING must be set */
|
|
|
|
CU_EVENT_INTERPROCESS = 0x4 /**< Event is suitable for interprocess use. CU_EVENT_DISABLE_TIMING must be set */
|
|
|
|
|
|
|
|
|
|
|
|
} CUevent_flags;
|
|
|
|
} CUevent_flags;
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum CUjitInputType_enum
|
|
|
|
typedef enum CUjitInputType_enum
|
|
|
@ -985,6 +1001,7 @@ typedef enum CUjitInputType_enum
|
|
|
|
CU_JIT_INPUT_LIBRARY,
|
|
|
|
CU_JIT_INPUT_LIBRARY,
|
|
|
|
|
|
|
|
|
|
|
|
CU_JIT_NUM_INPUT_TYPES
|
|
|
|
CU_JIT_NUM_INPUT_TYPES
|
|
|
|
|
|
|
|
|
|
|
|
} CUjitInputType;
|
|
|
|
} CUjitInputType;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
#ifdef _WIN32
|
|
|
@ -1119,4 +1136,50 @@ typedef struct hc_cuda_lib
|
|
|
|
|
|
|
|
|
|
|
|
typedef hc_cuda_lib_t CUDA_PTR;
|
|
|
|
typedef hc_cuda_lib_t CUDA_PTR;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int cuda_init (void *hashcat_ctx);
|
|
|
|
|
|
|
|
void cuda_close (void *hashcat_ctx);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int hc_cuCtxCreate (void *hashcat_ctx, CUcontext *pctx, unsigned int flags, CUdevice dev);
|
|
|
|
|
|
|
|
int hc_cuCtxDestroy (void *hashcat_ctx, CUcontext ctx);
|
|
|
|
|
|
|
|
int hc_cuCtxSetCurrent (void *hashcat_ctx, CUcontext ctx);
|
|
|
|
|
|
|
|
int hc_cuCtxSetCacheConfig (void *hashcat_ctx, CUfunc_cache config);
|
|
|
|
|
|
|
|
int hc_cuCtxSynchronize (void *hashcat_ctx);
|
|
|
|
|
|
|
|
int hc_cuDeviceGetAttribute (void *hashcat_ctx, int *pi, CUdevice_attribute attrib, CUdevice dev);
|
|
|
|
|
|
|
|
int hc_cuDeviceGetCount (void *hashcat_ctx, int *count);
|
|
|
|
|
|
|
|
int hc_cuDeviceGet (void *hashcat_ctx, CUdevice *device, int ordinal);
|
|
|
|
|
|
|
|
int hc_cuDeviceGetName (void *hashcat_ctx, char *name, int len, CUdevice dev);
|
|
|
|
|
|
|
|
int hc_cuDeviceTotalMem (void *hashcat_ctx, size_t *bytes, CUdevice dev);
|
|
|
|
|
|
|
|
int hc_cuDriverGetVersion (void *hashcat_ctx, int *driverVersion);
|
|
|
|
|
|
|
|
int hc_cuEventCreate (void *hashcat_ctx, CUevent *phEvent, unsigned int Flags);
|
|
|
|
|
|
|
|
int hc_cuEventDestroy (void *hashcat_ctx, CUevent hEvent);
|
|
|
|
|
|
|
|
int hc_cuEventElapsedTime (void *hashcat_ctx, float *pMilliseconds, CUevent hStart, CUevent hEnd);
|
|
|
|
|
|
|
|
int hc_cuEventQuery (void *hashcat_ctx, CUevent hEvent);
|
|
|
|
|
|
|
|
int hc_cuEventRecord (void *hashcat_ctx, CUevent hEvent, CUstream hStream);
|
|
|
|
|
|
|
|
int hc_cuEventSynchronize (void *hashcat_ctx, CUevent hEvent);
|
|
|
|
|
|
|
|
int hc_cuFuncGetAttribute (void *hashcat_ctx, int *pi, CUfunction_attribute attrib, CUfunction hfunc);
|
|
|
|
|
|
|
|
int hc_cuFuncSetAttribute (void *hashcat_ctx, CUfunction hfunc, CUfunction_attribute attrib, int value);
|
|
|
|
|
|
|
|
int hc_cuInit (void *hashcat_ctx, unsigned int Flags);
|
|
|
|
|
|
|
|
int hc_cuLaunchKernel (void *hashcat_ctx, CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void **kernelParams, void **extra);
|
|
|
|
|
|
|
|
int hc_cuMemAlloc (void *hashcat_ctx, CUdeviceptr *dptr, size_t bytesize);
|
|
|
|
|
|
|
|
int hc_cuMemcpyDtoDAsync (void *hashcat_ctx, CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream);
|
|
|
|
|
|
|
|
int hc_cuMemcpyDtoHAsync (void *hashcat_ctx, void *dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream);
|
|
|
|
|
|
|
|
int hc_cuMemcpyHtoDAsync (void *hashcat_ctx, CUdeviceptr dstDevice, const void *srcHost, size_t ByteCount, CUstream hStream);
|
|
|
|
|
|
|
|
int hc_cuMemFree (void *hashcat_ctx, CUdeviceptr dptr);
|
|
|
|
|
|
|
|
int hc_cuMemGetInfo (void *hashcat_ctx, size_t *free, size_t *total);
|
|
|
|
|
|
|
|
int hc_cuMemsetD32Async (void *hashcat_ctx, CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream);
|
|
|
|
|
|
|
|
int hc_cuMemsetD8Async (void *hashcat_ctx, CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream);
|
|
|
|
|
|
|
|
int hc_cuModuleGetFunction (void *hashcat_ctx, CUfunction *hfunc, CUmodule hmod, const char *name);
|
|
|
|
|
|
|
|
int hc_cuModuleGetGlobal (void *hashcat_ctx, CUdeviceptr *dptr, size_t *bytes, CUmodule hmod, const char *name);
|
|
|
|
|
|
|
|
int hc_cuModuleLoadDataEx (void *hashcat_ctx, CUmodule *module, const void *image, unsigned int numOptions, CUjit_option *options, void **optionValues);
|
|
|
|
|
|
|
|
int hc_cuModuleUnload (void *hashcat_ctx, CUmodule hmod);
|
|
|
|
|
|
|
|
int hc_cuStreamCreate (void *hashcat_ctx, CUstream *phStream, unsigned int Flags);
|
|
|
|
|
|
|
|
int hc_cuStreamDestroy (void *hashcat_ctx, CUstream hStream);
|
|
|
|
|
|
|
|
int hc_cuStreamSynchronize (void *hashcat_ctx, CUstream hStream);
|
|
|
|
|
|
|
|
int hc_cuCtxPushCurrent (void *hashcat_ctx, CUcontext ctx);
|
|
|
|
|
|
|
|
int hc_cuCtxPopCurrent (void *hashcat_ctx, CUcontext *pctx);
|
|
|
|
|
|
|
|
int hc_cuLinkCreate (void *hashcat_ctx, unsigned int numOptions, CUjit_option *options, void **optionValues, CUlinkState *stateOut);
|
|
|
|
|
|
|
|
int hc_cuLinkAddData (void *hashcat_ctx, CUlinkState state, CUjitInputType type, void *data, size_t size, const char *name, unsigned int numOptions, CUjit_option *options, void **optionValues);
|
|
|
|
|
|
|
|
int hc_cuLinkDestroy (void *hashcat_ctx, CUlinkState state);
|
|
|
|
|
|
|
|
int hc_cuLinkComplete (void *hashcat_ctx, CUlinkState state, void **cubinOut, size_t *sizeOut);
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _EXT_CUDA_H
|
|
|
|
#endif // _EXT_CUDA_H
|
|
|
|