Kernels for performing math operations.
More...
|
| kernel void | mult (global float4 *a, global float4 *b, global float4 *out) |
| | Multiplies two input arrays together, element-wise. More...
|
| |
| kernel void | pown_ (global float4 *in, global float4 *out, int n) |
| | Raises an array to an integer power, element-wise. More...
|
| |
Kernels for performing math operations.
- Author
- Nick Lamprianidis
- Version
- 1.0
- Date
- 2015
- Copyright
- The MIT License (MIT)
- Copyright (c) 2015 Nick Lamprianidis
- 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:
- 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.
| kernel void mult |
( |
global float4 * |
a, |
|
|
global float4 * |
b, |
|
|
global float4 * |
out |
|
) |
| |
Multiplies two input arrays together, element-wise.
- Note
- The global workspace should be one-dimensional. The x dimension of the global workspace, \( gXdim \), should be equal to the number of elements in the array,
M x N, divided by 4. That is, \( \ gXdim = M*N/4 \). The local workspace is irrelevant.
- Parameters
-
| [in] | a | first operand. Input array of float elements. |
| [in] | b | second operand. Input array of float elements. |
| [out] | out | product. Output array of float elements. |
| kernel void pown_ |
( |
global float4 * |
in, |
|
|
global float4 * |
out, |
|
|
int |
n |
|
) |
| |
Raises an array to an integer power, element-wise.
- Note
- The global workspace should be one-dimensional. The x dimension of the global workspace, \( gXdim \), should be equal to the number of elements in the array,
M x N, divided by 4. That is, \( \ gXdim = M*N/4 \). The local workspace is irrelevant.
- Parameters
-
| [in] | in | input array of float elements. |
| [out] | out | output array of float elements. |
| [in] | n | power to which to raise the array. |