- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
Hello,
I have a big(ish) fluids simulation code written in fortran which is compiled with ifort to run on 2 Xeon v4s. I am also trying gpu acceleration using C interface routines (with iso C bindings) and of late I am trying to use a couple nvidia teslas for acceleration.
When compiling the C part of the code with gcc, ifort will link with the object files and nvidia libraries (cufft, cublas). But having to write my own kernels it is necessary to be able compiling with nvcc. When doing so, ifort cannot find any of the C routines.
A search for similar queries produced no recent posts on the subject and the older suggestions seem not to work. It seems odd that this issue may be unresolved given the dominance intel processors. A similar question on the nvidia site produced a wave of apathy.
Any suggestions?
Thanks.
--
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
Link copiato
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
Without seeing an example of your code (perhaps a small reproducer?), it is difficult to say what might be going wrong. We have CFD code that uses Fortran and CUDA (and hence nvcc) that builds fine on Windows and Linux, but we don't use ISO C binding (because the code predated Fortran 2003 support).
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
CUDA code behaves like C++ by default, so you need to declare your functions with extern "C", i.e.
#include <stdio.h>
#include <cuda.h>
#include <cuda_runtime_api.h>
extern "C" void anything_( double A[], int *Nin )
{
int i;
for( i=1; i<*Nin; i++ ) {
printf("\n i, A(i) = %d %f ", i, A[i] );
}
}
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
Thanks again. Flagged my post as solution instead of yours. Dimnation.
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
This did the trick. Thank you v much.
==

- Iscriversi a feed RSS
- Contrassegnare la discussione come nuova
- Contrassegnare la discussione come letta
- Sposta questo Discussione per l'utente corrente
- Preferito
- Iscriversi
- Pagina in versione di stampa