CUBLAS handle

General discussion for CULA. Use this forum for questions, examples, feedback, and feature requests.

CUBLAS handle

Postby VictorGre1 » Sat May 18, 2013 8:19 am

Where can I get CUBLAS handle in CULA with CUDA 5.0? Previously, i use cublasGetCurrentCtx function, but now it is not available.
VictorGre1
CULA Premium
 
Posts: 10
Joined: Sat Nov 28, 2009 10:37 am

Re: CUBLAS handle

Postby john » Mon May 20, 2013 6:15 am

I don't believe there's a way to get to the CUBLAS handle. CULA doesn't offer an API function for it, and we likely won't, owing to needing to document the precise lifetime of the handle.

If you just need a CUBLAS handle, it would be safe to create your own. My guess, though, is that you're looking for the handle to call the cublasGetStream function on it - and I would strongly advise against doing so, because any stream returned from here will likely have been destroyed by CULA by the time you retrieve it.
john
Administrator
 
Posts: 587
Joined: Thu Jul 23, 2009 2:31 pm

Re: CUBLAS handle

Postby VictorGre1 » Tue May 21, 2013 2:33 am

Thank you.
The CUBLAS handle is needed to perform the CUBLAS functions, for example,
cublasIdamax(cublasHandle_t handle, int n, const float *x, int incx, int *result)

cublasIdamin(cublasHandle_t handle, int n, const double *x, int incx, int *result)

cublasDaxpy(cublasHandle_t handle, int n, const double *alpha, const double *x, int incx, double *y, int incy)

and other.
Is it possible after initialization CULA call cublasCreate_v2(cublasHandle_t *handle) and before shutdown CULA call cublasDestroy_v2 (cublasHandle_t handle)?
VictorGre1
CULA Premium
 
Posts: 10
Joined: Sat Nov 28, 2009 10:37 am

Re: CUBLAS handle

Postby john » Tue May 21, 2013 5:32 am

You can safely create your own CUBLAS handles with cublasCreate_v2. These are completely independent of CULA, so you can make/destroy/use your CUBLAS handles even outside of the culaInit regions of your code.
john
Administrator
 
Posts: 587
Joined: Thu Jul 23, 2009 2:31 pm


Return to General CULA Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron