We are trying to use some of the cooperative groups features in CUDA to write a small application. We are using Tesla V100 card with CUDA 11.0.
But on using is_valid() method in thread_block the below error is observed:
error: class "cooperative_groups::__v1::thread_block" has no member "is_valid"
In the CUDA provided sample simpleCooperativeGroups.cu, in the kernel cgkernel() when the is_valid method is used, this error can be seen. The code snippet from the modified sample looks as below.
__global__ void cgkernel(){
// threadBlockGroup includes all threads in the block
thread_block threadBlockGroup = this_thread_block();
int threadBlockGroupSize=threadBlockGroup.size();
// workspace array in shared memory required for reduction
extern __shared__ int workspace[];
int input, output, expectedOutput;
// input to reduction, for each thread, is its' rank in the group
input=threadBlockGroup.thread_rank();
// expected output from analytical formula (n-1)(n)/2
// (noting that indexing starts at 0 rather than 1)
expectedOutput=(threadBlockGroupSize-1)*threadBlockGroupSize/2;
// perform reduction
output=sumReduction(threadBlockGroup, workspace, input);
bool valid = threadBlockGroup.is_valid();
.
.
.
}
Any suggestions to resolve this would be of great help.
question from:
https://stackoverflow.com/questions/65939029/error-class-cooperative-groups-v1thread-block-has-no-member-is-valid 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…