culadevice.h | culadevice.h | |||
---|---|---|---|---|
skipping to change at line 48 | skipping to change at line 48 | |||
*/ | */ | |||
#include "culastatus.h" | #include "culastatus.h" | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
/** | /** | |||
* @brief Reports the number of GPU devices | * @brief Reports the number of GPU devices | |||
* Can be called before culaInitialize | ||||
* | * | |||
* @param num Pointer to receive the number of devices | * @param num Pointer to receive the number of devices | |||
* | * | |||
* @return culaNoError on sucess, culaArgumentError on invalid pointer | * @return culaNoError on sucess, culaArgumentError on invalid pointer | |||
*/ | */ | |||
culaStatus culaGetDeviceCount(int* dev); | culaStatus culaGetDeviceCount(int* dev); | |||
/** | /** | |||
* @brief Selects a device with which CULA will operate | ||||
* To bind without error, this function must be called before culaInitializ | ||||
e | ||||
* | ||||
* @param dev Specifies the device id of the GPU device | ||||
* | ||||
* @return culaNoError on sucess, culaArgumentError on an invalid device id | ||||
, | ||||
* culaRuntimeError if the running thread has already been bound to a GPU d | ||||
evice | ||||
*/ | ||||
culaStatus culaSelectDevice(int dev); | ||||
/** | ||||
* @brief Reports the id of the GPU device executing CULA | * @brief Reports the id of the GPU device executing CULA | |||
* | * | |||
* @param dev Pointer to receive the GPU device number | * @param dev Pointer to receive the GPU device number | |||
* | * | |||
* @return culaNoError on sucess, culaArgumentError on invalid pointer | * @return culaNoError on sucess, culaArgumentError on invalid pointer | |||
*/ | */ | |||
culaStatus culaGetExecutingDevice(int* dev); | culaStatus culaGetExecutingDevice(int* dev); | |||
/** | /** | |||
* @brief Prints information to a buffer about a specified device | * @brief Prints information to a buffer about a specified device | |||
* | * | |||
* @param dev CUDA device id to print information about | * @param dev CUDA device id to print information about | |||
* @param buf Pointer to a buffer into which information will be printed | * @param buf Pointer to a buffer into which information will be printed | |||
* @param bufsize The size of buf, printed information will not exceed bufs ize | * @param bufsize The size of buf, printed information will not exceed bufs ize | |||
* | * | |||
* @return culaNoError on sucess, culaArgumentError on invalid pointer | * @return culaNoError on sucess, culaArgumentError on invalid buf pointer, | |||
* invalid device id, or invalid bufsize | ||||
*/ | */ | |||
culaStatus culaGetDeviceInfo(int dev, char* buf, int bufsize); | culaStatus culaGetDeviceInfo(int dev, char* buf, int bufsize); | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} // extern "C" | } // extern "C" | |||
#endif | #endif | |||
#endif // __EMP_CULADEVICE_H__ | #endif // __EMP_CULADEVICE_H__ | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 17 lines changed or added | |||
culastatus.h | culastatus.h | |||
---|---|---|---|---|
skipping to change at line 54 | skipping to change at line 54 | |||
#endif | #endif | |||
/** | /** | |||
* @brief Enumerates error conditions | * @brief Enumerates error conditions | |||
*/ | */ | |||
typedef enum | typedef enum | |||
{ | { | |||
culaNoError, // No error | culaNoError, // No error | |||
culaNotInitialized, // CULA has not been initialized | culaNotInitialized, // CULA has not been initialized | |||
culaNoHardware, // No hardware is available to run | culaNoHardware, // No hardware is available to run | |||
culaFeatureNotImplemented, // The requested feature has not bee n implemented | culaInsufficientRuntime, // CUDA runtime or driver is not sup ported | |||
culaInsufficientComputeCapability, // Available GPUs do not support the requested operation | culaInsufficientComputeCapability, // Available GPUs do not support the requested operation | |||
culaInsufficientMemory, // There is insufficient memory to c ontinue | culaInsufficientMemory, // There is insufficient memory to c ontinue | |||
culaFeatureNotImplemented, // The requested feature has not bee n implemented | ||||
culaArgumentError, // An invalid argument was passed to a function | culaArgumentError, // An invalid argument was passed to a function | |||
culaDataError, // An operation could not complete b ecause of singular data | culaDataError, // An operation could not complete b ecause of singular data | |||
culaBlasError, // A blas error was encountered | culaBlasError, // A blas error was encountered | |||
culaRuntimeError // A runtime error has occurred | culaRuntimeError // A runtime error has occurred | |||
}culaStatus; | }culaStatus; | |||
/** | /** | |||
* @brief Initializes CULA | * @brief Initializes CULA | |||
* Must be called before using any other function. | * Must be called before using any other function. Some functions have an | |||
* exception to this rule: culaGetDeviceCount, culaSelectDevice | ||||
* | * | |||
* @return culaNoError on a successful initialization or the culaStatus enu m | * @return culaNoError on a successful initialization or the culaStatus enu m | |||
* that specifies an error | * that specifies an error | |||
*/ | */ | |||
culaStatus culaInitialize(); | culaStatus culaInitialize(); | |||
/** | /** | |||
* @brief Shuts down CULA | * @brief Shuts down CULA | |||
* Must be called to deallocate CULA internal data | * Must be called to deallocate CULA internal data | |||
*/ | */ | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 4 lines changed or added | |||
culatypes.h | culatypes.h | |||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
#ifdef CULA_USE_CUDA_COMPLEX | #ifdef CULA_USE_CUDA_COMPLEX | |||
#include "cuComplex.h" | #include "cuComplex.h" | |||
#endif | #endif | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
#define CULA_VERSION_MAJOR 1 | #define CULA_VERSION_MAJOR 1 | |||
#define CULA_VERSION_MINOR 0 | #define CULA_VERSION_MINOR 1 | |||
/** | /** | |||
* @brief Provides extended error information for CULA functions. | * @brief Provides extended error information for CULA functions. | |||
* When negative, this value specifies an argument position with an invalid | * When negative, this value specifies an argument position with an invalid | |||
* value. | * value. | |||
*/ | */ | |||
typedef int info_t; | typedef int info_t; | |||
// host types | // host types | |||
typedef float culaFloat; | typedef float culaFloat; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||