PSCF v1.1
ThreadGrid.h
1#ifndef PSPG_THREADGRID_H
2#define PSPG_THREADGRID_H
3
4#include "GpuTypes.h"
5#include <util/global.h>
6
7namespace Pscf {
8namespace Pspg {
9
13namespace ThreadGrid {
14
27 void init();
28
34 void setThreadsPerBlock();
35
41 void setThreadsPerBlock(int nThreadsPerBlock);
42
52
63
76
84
85 // Accessors
86
90 int nBlocks();
91
95 int nThreads();
96
100 int nThreadsLogical();
101
109 bool hasUnusedThreads();
110
113} // namespace ThreadGrid
114} // namespace Pspg
115} // namespace Pscf
116#endif
File containing preprocessor macros for error handling.
bool hasUnusedThreads()
Indicates whether there will be unused threads.
Definition: ThreadGrid.cu:179
int nThreadsLogical()
Return previously requested total number of threads.
Definition: ThreadGrid.cu:176
int nThreads()
Get the number of threads per block for execution.
Definition: ThreadGrid.cu:173
int nBlocks()
Get the current number of blocks for execution.
Definition: ThreadGrid.cu:170
void setThreadsPerBlock()
Set the number of threads per block to a default value.
Definition: ThreadGrid.cu:48
void checkExecutionConfig()
Check the execution configuration (threads and block counts).
Definition: ThreadGrid.cu:124
void setThreadsLogical(int nThreadsLogical)
Set the total number of threads required for execution.
Definition: ThreadGrid.cu:80
void init()
Initialize static variables in Pspg::ThreadGrid namespace.
Definition: ThreadGrid.cu:35
C++ namespace for polymer self-consistent field theory (PSCF).