Considérons le code affiché par sgarizvi àerreur de compilation cublasSgetriBatched avec CUDA 7.0 Release Candidate
CUBLAS: Incorrect inversion for matrix with zero pivot
J'utilise ce code comme reproducer impromptu de mon problème. Si je compile avec CUDA 6.0, tout fonctionne bien. En face de cela, si je compile avec CUDA 6.5 ou CUDA 7.0 Release Candidate Je reçois:
Error 13 error C2664: 'cublasSgetriBatched' : cannot convert parameter 3 from 'float **' to 'const float *[]' C:\Users\user\Documents\Project\StackOverflow15\StackOverflow15\kernel.cu 70 1 StackOverflow15
Est-ce un bug ou je fais quelque chose de mal?
Ma configuration: Windows 7, Microsoft Visual Studio 2010, Mode édition, x64, compute_20, sm_21.
EDIT
Après la réponse de Robert Crovella et le commentaire de Park Young-Bae, l'exemple pointu peut être fixé à travailler avec CUDA 6.5 ou 7.0 en changeant la ligne
cublascall(cublasSgetriBatched(handle,n,A_d,lda,P,C_d,lda,INFO,batchSize));
à
cublascall(cublasSgetriBatched(handle,n,(const float **)A_d,lda,P,C_d,lda,INFO,batchSize));
Ceci n'est pas lié à CUDA, il s'agit des règles d'aliasing C++. La conversion de 'float **' à 'float const **' n'est pas valide. [Voir la FAQ ISO C++] (http://isocpp.org/wiki/faq/const-correctness#constptrptr-conversion). –