MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / xGemm_Function

Method xGemm_Function

src/client/clfunc_xgemm.hpp:1017–1059  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1015
1016template<>
1017void
1018xGemm<cl_float>::
1019xGemm_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
1061template<>
1062void

Callers

nothing calls this directly

Calls 4

clblasSgemmFunction · 0.85
clblasDgemmFunction · 0.85
clblasCgemmFunction · 0.85
clblasZgemmFunction · 0.85

Tested by

no test coverage detected