If there is a function in CUDA, but have not been implemented in CUDA.jl, is it possible to call that function using ccall?
I am trying it with a call to dgemm ( gemm is available through CUDA.jl, but I want to try a function that’s been implemented to validate the result), using the following script, the return value is CUBLAS_STATUS_SUCCESS
, however, I don’t have a way to get the result, and the output indicates that the function didn’t actually succeed.
using LLVM
n = 10000
x = rand(n,n)
y = zeros(n,n)
alpha = rand()
handle = CUBLAS.cublasCreate_v2()
# CUBLAS.handle()
LLVM.@runtime_ccall((:cublasDgemm, CUDA.libcublas()), CUBLAS.cublasStatus_t, (CUBLAS.cublasHandle_t, Char, Char,
Cint, Cint, Cint,
Cdouble, Ptr{Cdouble}, Ptr{Cdouble}, Cdouble, Ptr{Cdouble}, Cint),
handle, 'N','N', n,n,n, alpha, x,x, alpha, y, n)
Here is the output:
# ** On entry to DGEMM parameter number 1 had an illegal value
# CUBLAS_STATUS_SUCCESS::cublasStatus_t = 0x00000000
The code probably is not correct. Any help are appreciated.
Thanks.