openacc - Launching a kernel within a kernel -
isn't nested parallelism , doesn't pgi 17. support this? please let me know if code correct?
#include <openacc.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int n = 20; int* array = (int*) malloc(n * n * sizeof(int)); #pragma acc kernels loop for(int = 0; < n; i++ ) { #pragma acc kernels loop for(int j = 0; j< n; j++) { array[i*n + j] = 1; } } (int = 0; < n; ++i) { (int j = 0; j < n; ++j) { printf("%d ", array[i*n + j]); } puts(""); } printf("res: %d\n", res); return 0; }
this how compiled it:
pgcc -acc -ta=tesla -minfo=accel test.c -o test
these errors:
pgc-s-0155-nested #pragma acc kernels loop ignored (test.c: 14) pgc-s-0155-illegal context #pragma acc kernels loop (test.c: 14) pgc-s-0039-use of undeclared variable res (test.c: 27) pgc/x86-64 osx 16.10-0: compilation completed severe errors
Comments
Post a Comment