Skip to content

Commit ffef78f

Browse files
committed
Fix temporary buffer deletion
1 parent 339a5ba commit ffef78f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CLW/CLWProgram.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,5 +363,5 @@ void CLWProgram::GetBinaries(int device, std::vector<std::uint8_t>& data) const
363363
}
364364
}
365365

366-
delete temp;
367-
}
366+
delete [] temp;
367+
}

CLW/kernelcache/clwkernels_cl.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,10 @@ static const char g_CLW_opencl[]= \
958958
" barrier(CLK_LOCAL_MEM_FENCE); \n"\
959959
" \n"\
960960
" // Reload values back to registers for the second bit pass \n"\
961-
" localkeys = ((__local int4*)keys)[localid]; \n"\
961+
" localkeys.x = keys[localid << 2]; \n"\
962+
" localkeys.y = keys[(localid << 2) + 1]; \n"\
963+
" localkeys.z = keys[(localid << 2) + 2]; \n"\
964+
" localkeys.w = keys[(localid << 2) + 3]; \n"\
962965
" \n"\
963966
" // Make sure everything is up to date \n"\
964967
" barrier(CLK_LOCAL_MEM_FENCE); \n"\
@@ -972,7 +975,10 @@ static const char g_CLW_opencl[]= \
972975
" barrier(CLK_LOCAL_MEM_FENCE); \n"\
973976
" \n"\
974977
" // Reload values back to registers for the second bit pass \n"\
975-
" localvals = ((__local int4*)keys)[localid]; \n"\
978+
" localvals.x = keys[localid << 2]; \n"\
979+
" localvals.y = keys[(localid << 2) + 1]; \n"\
980+
" localvals.z = keys[(localid << 2) + 2]; \n"\
981+
" localvals.w = keys[(localid << 2) + 3]; \n"\
976982
" \n"\
977983
" // Make sure everything is up to date \n"\
978984
" barrier(CLK_LOCAL_MEM_FENCE); \n"\

0 commit comments

Comments
 (0)