define NOMINMAX in the CMakefile to fix std::min and std::max on MSVC (#1308)

This commit is contained in:
Ben Ashbaugh
2021-08-28 02:21:34 -07:00
committed by GitHub
parent 070f8c0c0e
commit 39fdb462be
6 changed files with 7 additions and 13 deletions

View File

@@ -203,13 +203,13 @@ int test_copy2D(cl_device_id deviceID, cl_context context,
/ (numElementsPerLine + srcStride);
size_t maxTotalLinesOut = (max_alloc_size / elementSize + dstStride)
/ (numElementsPerLine + dstStride);
size_t maxTotalLines = (std::min)(maxTotalLinesIn, maxTotalLinesOut);
size_t maxTotalLines = std::min(maxTotalLinesIn, maxTotalLinesOut);
size_t maxLocalWorkgroups =
maxTotalLines / (localWorkgroupSize * lineCopiesPerWorkItem);
size_t localBufferSize = localWorkgroupSize * localStorageSpacePerWorkitem
- (localIsDst ? dstStride : srcStride);
size_t numberOfLocalWorkgroups = (std::min)(1111, (int)maxLocalWorkgroups);
size_t numberOfLocalWorkgroups = std::min(1111, (int)maxLocalWorkgroups);
size_t totalLines =
numberOfLocalWorkgroups * localWorkgroupSize * lineCopiesPerWorkItem;
size_t inBufferSize = elementSize