![]() |
OpenPFC
0.1.4
Phase Field Crystal simulation framework
|
Simple GPU kernel operations for element-wise computations. More...
#include <openpfc/gpu/gpu_vector.hpp>
Go to the source code of this file.
Functions | |
| void | pfc::gpu::add_scalar (GPUVector< double > &vec, double value) |
| Add a scalar value to each element of a GPU vector. | |
| void | pfc::gpu::multiply_scalar (GPUVector< double > &vec, double value) |
| Multiply each element of a GPU vector by a scalar. | |
Simple GPU kernel operations for element-wise computations.
This header provides simple GPU kernel operations that work with GPUVector. These are basic building blocks for more complex GPU computations.
All functions are only available when CUDA is enabled at compile time. On systems without CUDA, these functions will not be compiled.
Add a scalar value to each element of a GPU vector.
Performs element-wise addition: vec[i] = vec[i] + value for all i.
| vec | GPU vector to modify (in-place) |
| value | Scalar value to add to each element |
| std::runtime_error | if CUDA kernel launch fails |


Multiply each element of a GPU vector by a scalar.
Performs element-wise multiplication: vec[i] = vec[i] * value for all i.
| vec | GPU vector to modify (in-place) |
| value | Scalar value to multiply each element by |
| std::runtime_error | if CUDA kernel launch fails |

