| 49 | // This class is a singleton |
| 50 | |
| 51 | class BlasBase { |
| 52 | private: |
| 53 | cl_platform_id platform_; |
| 54 | // used in all cases |
| 55 | cl_device_id primaryDevice_; |
| 56 | /* |
| 57 | * used only in cases with MultipleQueues to cover problem distribution |
| 58 | * among different devices, not only different queues belonging to the same |
| 59 | * device |
| 60 | */ |
| 61 | cl_device_id additionalDevice_; |
| 62 | cl_context context_; |
| 63 | cl_command_queue commandQueues_[MAX_COMMAND_QUEUES]; |
| 64 | size_t devOrd_; |
| 65 | size_t platOrd_; |
| 66 | |
| 67 | bool useNumCommandQueues_; |
| 68 | cl_uint numCommandQueues_; |
| 69 | |
| 70 | bool useAlpha_; |
| 71 | bool useBeta_; |
| 72 | ComplexLong alpha_; |
| 73 | ComplexLong beta_; |
| 74 | |
| 75 | bool useSeed_; |
| 76 | unsigned int seed_; |
| 77 | |
| 78 | bool useM_, useN_, useK_; |
| 79 | size_t M_, N_, K_; |
| 80 | |
| 81 | bool useIncX_, useIncY_; |
| 82 | int incX_, incY_; |
| 83 | |
| 84 | bool useImages_; |
| 85 | cl_device_type devType_; |
| 86 | const char* devName_; |
| 87 | cl_ulong imageA_; |
| 88 | cl_ulong imageB_; |
| 89 | |
| 90 | BlasBase( ); |
| 91 | ~BlasBase(); |
| 92 | BlasBase(const BlasBase &); // intentionally undefined |
| 93 | BlasBase & operator=(const BlasBase &); // intentionally undefined |
| 94 | |
| 95 | void SetUp(); |
| 96 | void TearDown(); |
| 97 | bool initialized(); |
| 98 | |
| 99 | cl_int getPlatforms(cl_platform_id** platforms, cl_int *error); |
| 100 | cl_device_id getDevice(cl_device_type type, const char* name, |
| 101 | cl_int *error); |
| 102 | void printDevInfoStr(cl_device_info param, const char *paramName, |
| 103 | int primAdd); |
| 104 | |
| 105 | public: |
| 106 | static BlasBase* getInstance( ); |
| 107 | |
| 108 | cl_context context() |
nothing calls this directly
no outgoing calls
no test coverage detected