5 #include <cuda_runtime_api.h> 11 #define MAX_LENGTH 256 24 MAX_THREADS_PER_MP = 6,
27 SHARED_MEMORY_PER_MP = 9,
28 SHARED_MEMORY_PER_BLOCK = 10,
29 MAX_THREADS_PER_BLOCK = 11,
30 MAX_THREADS_DIMENSION = 12,
38 static std::mutex mtx;
40 cudaDeviceProp devProps[
MAX_GPU];
51 if (instance ==
nullptr) {
52 std::lock_guard<std::mutex> lock(mtx);
53 if (instance ==
nullptr) {
55 atexit(releaseInstance);
62 if (instance !=
nullptr) {
72 void printMemoryInfo(
int idx);
76 void setWorkload(
int size);
81 if (gpus <=
MAX_GPU && gpus <= num_gpu) {
93 int getSMPerCore(
int major,
int minor);
100 #endif // cudaWrapperWRAPPER_H
cudaDeviceProp * getDeviceProps(int idx)
static cudaWrapper * getInstance()
int getMaxThreads(int idx)
static void releaseInstance()
bool setActiveGPUs(int gpus)
void setCurThreads(int thread)