PSCF v1.4.0
ThreadMesh.h
1#ifndef PSCF_THREADMESH_H
2#define PSCF_THREADMESH_H
3
4/*
5* PSCF - Polymer Self-Consistent Field
6*
7* Copyright 2015 - 2025, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <util/global.h>
12#include <pscf/math/IntVec.h>
13#include <vector_types.h> // from the CUDA library, defines dim3 type
14
15namespace Pscf {
16
28namespace ThreadMesh {
29
36
108 template <int D>
109 void setConfig(IntVec<D> const & meshDims, bool invert,
110 int blockSize = -1);
111
120 void checkConfig();
121
129 void setThreadsPerBlock(int blockSize);
130
131 // Accessors
132
138 dim3 gridDims();
139
145 dim3 blockDims();
146
152 dim3 meshDims();
153
159 int warpSize();
160
166 bool hasUnusedThreads();
167
168} // namespace ThreadMesh
169} // namespace Pscf
170#endif
File containing preprocessor macros for error handling.
int warpSize()
Get the warp size.
void setConfig(IntVec< D > const &meshDims, bool invert, int blockSize)
Given a multidimensional grid of threads, set execution configuration.
Definition ThreadMesh.cu:88
void checkConfig()
Check the execution configuration (grid and block dimensions).
bool hasUnusedThreads()
Will there be unused threads?
dim3 gridDims()
Get the multidimensional grid of blocks determined by setConfig.
dim3 meshDims()
Return last requested multidimensional grid of threads.
dim3 blockDims()
Get the dimensions of a single block determined by setConfig.
void setThreadsPerBlock(int blockSize)
Manually set the block size that should be used by default.
Management of multidimensional GPU thread execution configurations.
Definition ThreadMesh.cu:12
PSCF package top-level namespace.