| 1015 | |
| 1016 | template<> |
| 1017 | void |
| 1018 | xGemm<cl_float>:: |
| 1019 | xGemm_Function(bool flush, cl_uint apiCallCount ) |
| 1020 | { |
| 1021 | for (unsigned int i = 0; i < numQueues; i++) { |
| 1022 | events_[i] = NULL; |
| 1023 | } |
| 1024 | for (unsigned int i = 0; i < apiCallCount; i++) |
| 1025 | { |
| 1026 | clblasSgemm(order_, buffer_.trans_a_, buffer_.trans_b_, |
| 1027 | buffer_.m_, buffer_.n_, buffer_.k_, buffer_.alpha_, |
| 1028 | buffer_.buf_a_, buffer_.offA_, buffer_.lda_, |
| 1029 | buffer_.buf_b_, buffer_.offB_, buffer_.ldb_, |
| 1030 | buffer_.beta_, buffer_.buf_c_, buffer_.offC_, |
| 1031 | buffer_.ldc_, numQueuesToUse, queues_, 0, NULL, events_); |
| 1032 | } |
| 1033 | //flush==true if only the kernel time (library call) is timed |
| 1034 | //flush==false if memory time is also timed |
| 1035 | if (flush==true) |
| 1036 | { |
| 1037 | // check if any valid events returned |
| 1038 | cl_uint numValidEvents = 0; |
| 1039 | for (unsigned int i = 0; i < numQueuesToUse; i++) { |
| 1040 | if (events_[i]) { |
| 1041 | cl_uint clReferenceCount; |
| 1042 | cl_int err = clGetEventInfo(events_[i], CL_EVENT_REFERENCE_COUNT, sizeof(clReferenceCount), &clReferenceCount, NULL); |
| 1043 | if ( err == CL_SUCCESS) { |
| 1044 | //printf("events[%u/%u] has %u references\n", i, numQueuesToUse, clReferenceCount ); |
| 1045 | numValidEvents++; |
| 1046 | } else { |
| 1047 | //printf("events[%u/%u] invalid; err = %i\n", i, numQueuesToUse, err ); |
| 1048 | } |
| 1049 | } else { |
| 1050 | //printf("events[%u/%u] is NULL\n", i, numQueuesToUse ); |
| 1051 | } |
| 1052 | } |
| 1053 | |
| 1054 | for (unsigned int i = 0; i < numQueuesToUse; i++) { |
| 1055 | clFlush(queues_[i]); |
| 1056 | } |
| 1057 | clWaitForEvents(numValidEvents, events_); |
| 1058 | } |
| 1059 | } |
| 1060 | |
| 1061 | template<> |
| 1062 | void |
nothing calls this directly
no test coverage detected