Organize dispatching of thread data for better reuse of code

Change-Id: I8c156f8b5a50f6fa4dfb5218cdadb2840ff556eb
This commit is contained in:
Zdanowicz, Zbigniew
2018-09-28 16:16:18 +02:00
committed by sys_ocldev
parent 95cfb156cf
commit 2632b21fd1
12 changed files with 174 additions and 155 deletions

View File

@@ -1,23 +1,8 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (C) 2017-2018 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* SPDX-License-Identifier: MIT
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
@@ -164,5 +149,15 @@ inline size_t computeTotalElementsCount(const Vec3<size_t> &inputVector) {
return xDim * yDim * zDim;
}
template <typename T>
bool isPow2(T val) {
if (val != 0) {
if ((val & (val - 1)) == 0) {
return true;
}
}
return false;
}
} // namespace Math
} // namespace OCLRT