Skip to content

Commit 03ae187

Browse files
committed
fixed zgemm offset bug; removed profiling from client
1 parent bd13b7b commit 03ae187

File tree

4 files changed

+10
-21
lines changed

4 files changed

+10
-21
lines changed

src/client/clfunc_common.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ class clblasFunc
246246
props_[2] = 0;
247247
ctx_ = clCreateContext(props_, 1, &device_, NULL, NULL, &err);
248248
OPENCL_V_THROW(err, "creating context");
249-
queue_ = clCreateCommandQueue(ctx_, device_, CL_QUEUE_PROFILING_ENABLE, &err);
249+
queue_ = clCreateCommandQueue(ctx_, device_, 0, &err);
250250

251251

252252
timer_id = timer.getUniqueID( "clfunc", 0 );

src/client/clfunc_xgemm.hpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,19 +1065,6 @@ xGemm_Function(bool flush, cl_uint apiCallCount )
10651065
buffer_.buf_b_, buffer_.offB_, buffer_.ldb_,
10661066
buffer_.beta_, buffer_.buf_c_, buffer_.offC_,
10671067
buffer_.ldc_, 1, &queue_, 0, NULL, &event_);
1068-
#if 0
1069-
// print kernel time
1070-
clFinish(queue_);
1071-
cl_ulong start, stop;
1072-
double time;
1073-
cl_int err;
1074-
err = clGetEventProfilingInfo( event_, CL_PROFILING_COMMAND_START, sizeof(start), &start, NULL );
1075-
if (err) printf("err = %i\n", err);
1076-
err = clGetEventProfilingInfo( event_, CL_PROFILING_COMMAND_END, sizeof(stop), &stop, NULL );
1077-
if (err) printf("err = %i\n", err);
1078-
time = (stop - start) / 1000000.0; // milliseconds
1079-
printf("kernel %lu -> %lu = %.f ms\n", start, stop, time );
1080-
#endif
10811068
}
10821069
//flush==true if only the kernel time (library call) is timed
10831070
//flush==false if memory time is also timed

src/library/blas/functor/hawaii.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,13 @@ clblasSgemmFunctor * FunctorSelectorHawaii::select_sgemm_specific(clblasSgemmFun
168168
clblasZgemmFunctor * FunctorSelectorHawaii::select_zgemm_specific(clblasZgemmFunctor::Args & args)
169169
{
170170

171-
//TODO: the logic below is complicated; Needs cleanup;
172-
clblasZgemmFunctor * functor;
173-
174171
if ( args.M%32==0
175172
&& args.N%64==0
176173
&& args.K%8==0
177174
&& args.transA==clblasNoTrans
178175
&& args.transB==clblasTrans
179176
&& args.order==clblasColumnMajor) {
180-
functor = clblasZgemmFunctorGCN::provide(args, "Hawaii");
177+
return clblasZgemmFunctorGCN::provide(args, "Hawaii");
181178
} else {
182179
return this->clblasFunctorSelector::select_zgemm_specific(args);
183180
}

src/library/blas/gens/clTemplates/zgemm_gcn.cl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,15 @@ __kernel void KERNEL_NAME(DATA_TYPE_CHAR,TRANSPOSE_A,TRANSPOSE_B,MACRO_TILE_NUM_
200200
uint const lda,
201201
uint const ldb,
202202
uint const ldc,
203-
uint const offA,
204-
uint const offB,
205-
uint const offC )
203+
uint const offsetA,
204+
uint const offsetB,
205+
uint const offsetC )
206206
{
207+
// apply offsets
208+
A += offsetA;
209+
B += offsetB;
210+
C += offsetC;
211+
207212
// registers
208213
DATA_TYPE_STR rC[MICRO_TILE_NUM_ROWS][MICRO_TILE_NUM_COLS] = {0};
209214
DATA_TYPE_STR rA[MICRO_TILE_NUM_ROWS];

0 commit comments

Comments
 (0)