Hi, I upgraded to 12.5 today and found that 3/4 of the codes I’ve been working with written with PGI ACC directives would no longer compile. I’m not sure where in the chain this happened, I think the previous version in use was 12.3, either way, the error was this.
make -C kmeans/
make[1]: Entering directory `/home/njustn/omp-co-repo/kmeans'
pgcc -mp=allcores -O3 -fast -Minfo=accel,mp -DPGI -I/opt/pgi/linux86-64/2012/cuda/4.1/include -I/opt/pgi/linux86-64/2012/include_acc -ta=nvidia,keepgpu,keepptx,nofma -c99 -I. -I../common -c omp_main.c -o omp_main.o
main:
68, Parallel region activated
78, Parallel region terminated
pgcc -mp=allcores -O3 -fast -Minfo=accel,mp -DPGI -I/opt/pgi/linux86-64/2012/cuda/4.1/include -I/opt/pgi/linux86-64/2012/include_acc -ta=nvidia,keepgpu,keepptx,nofma -c99 -I. -I../common -c omp_kmeans.c
omp_kmeans.001.gpu(43): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(43): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(43): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(59): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(59): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(59): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(75): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(75): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(75): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(76): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(76): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(91): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(91): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(91): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(91): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(91): error: expression must have arithmetic or enum type
omp_kmeans.001.gpu(105): error: expression must have integral or enum type
17 errors detected in the compilation of "/tmp/pgnvd_wob6Wbeavuz.nv0".
PGC-W-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (omp_kmeans.c: 210)
omp_kmeans:
148, Parallel region activated
Parallel loop activated with static block schedule
153, Barrier
Parallel region terminated
164, Generating copyin(fo[0:1])
185, Parallel region activated
210, Generating copyin(fc[0:numClusters*numCoords])
Generating copyin(gte)
Generating copyin(gts)
Generating copyin(numClusters)
Generating copyin(numObjs)
Generating copyin(numCoords)
225, Loop is parallelizable
Accelerator kernel generated
225, #pragma acc for parallel, vector(256) /* blockIdx.x threadIdx.x */
238, Loop is parallelizable
244, Loop carried scalar dependence for 'min_dist' at line 255
Scalar last value needed after loop for 'index' at line 260
249, Loop is parallelizable
271, Parallel region terminated
After some confusion, I realized that the compiler had decided that all of my basic int variables were actually char * arrays for some reason. These are the relevant chunks of code.
float** omp_kmeans(int is_perform_atomic, /* in: */
float **objects, /* in: [numObjs][numCoords] */
int numCoords, /* no. coordinates */
int numObjs, /* no. objects */
int numClusters, /* no. clusters */
float threshold, /* % objects change membership */
int *membership) /* out: [numObjs] */
...
#pragma acc region for \
deviceptr(data)\
deviceptr(cfo)\
private(index,i,j,k,dist,min_dist)\
copyin(numCoords,numObjs,numClusters,gts,gte)\
copyin(fc[0:numClusters*numCoords])
The important point is the numCoords, numObjs, etc. int variables. When the copyin clause is removed, the code compiles successfully in 12.5, where both compile successfully with 11.10 (the other one I have immediate access to). Is this intentional behavior?