Hello,
I hope someone can help me. I am new with cuda, not as new with OpenMP. I am trying to compile this file kernel.cu:
void cuda_matricesSubstract(int pIntCols, int pIntRows, float* pMatrixA, float* pMatrixB, float* pMatrixC)
{
#pragma omp parallel
{
int i, j;
#pragma omp target teams distribute parallel for map(to: i, j, pIntRows, pIntCols, pMatrixA, pMatrixB) map(tofrom: pMatrixC)
for (i = 0; i < pIntRows; i++)
for (j = 0; j < pIntCols; j++)
{
int lIntPos = i * pIntCols + j;
pMatrixC[lIntPos] = pMatrixA[lIntPos] - pMatrixB[lIntPos];
}
}
}
With CMD command:
nvcc -c kernel.cu -o kernel.o -Xcompiler " -openmp"
I obtain this error (I have translated it a little bit from spanish):
kernel.cu(26): error C3001: ‘target’: expected a name of an OpenMP directive
I have been trying different approaches but none worked.
I have:
- Cuda v11.7
- Windows 10
- GPU NVIDIA GeForce GTX 1060.
I look forward to your help so that I can get deeper into cuda and NVIDIA.
Thanks in advance and best regards.