Closed haraldservat closed 3 years ago
The MIN and MAX definitions in include/common.h should be fixed. With current approach, when used in compute_sp.cpp, for instance, the code
uint64_t t = MIN((globalWIs * sizeof(cl_float)), devInfo.maxAllocSize) / sizeof(cl_float);
leads to the following pre-processed code
uint64_t t = ((globalWIs * sizeof(cl_float)) < devInfo.maxAllocSize)? (globalWIs * sizeof(cl_float)): devInfo.maxAllocSize / sizeof(cl_float);
in which the division only affects to devInfo.maxAllocSize.
Possible workarounds are:
std::max
std::min
The MIN and MAX definitions in include/common.h should be fixed. With current approach, when used in compute_sp.cpp, for instance, the code
uint64_t t = MIN((globalWIs * sizeof(cl_float)), devInfo.maxAllocSize) / sizeof(cl_float);
leads to the following pre-processed code
uint64_t t = ((globalWIs * sizeof(cl_float)) < devInfo.maxAllocSize)? (globalWIs * sizeof(cl_float)): devInfo.maxAllocSize / sizeof(cl_float);
in which the division only affects to devInfo.maxAllocSize.
Possible workarounds are:
std::max
andstd::min