Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 47383a75 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

cuda: Remove the CHAMELEON_USE_CUBLAS_V2 define to always enforce the use of the new API

parent 4ed75fb8
No related branches found
No related tags found
1 merge request!289Check return value of then CUDA call in debug mode
......@@ -520,12 +520,6 @@ int main(void) {
HAVE_FALLTHROUGH
)
# Add option to exploit cublas API v2
# -----------------------------------
cmake_dependent_option(CHAMELEON_USE_CUBLAS_V2
"Enable cublas API v2" ON
"CHAMELEON_USE_CUDA;CHAMELEON_SCHED_STARPU" OFF)
# Fix a problem on Mac OS X when building shared libraries
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup")
......
......@@ -48,12 +48,8 @@
#include <cuda.h>
#include <cuda_runtime.h>
#include <cuda_runtime_api.h>
#if defined(CHAMELEON_USE_CUBLAS_V2)
#include <cublas.h>
#include <cublas_v2.h>
#else
#include <cublas.h>
#endif
#endif
#if defined(CHAMELEON_USE_OPENCL) && !defined(CHAMELEON_SIMULATION)
......
......@@ -29,6 +29,7 @@
# ------------------------------------------------------
set(CUDABLAS_SRCS_GENERATED "")
set(ZSRC
cuda_zgeadd.c
cuda_zgemerge.c
cuda_zgemm.c
cuda_zhemm.c
......@@ -52,13 +53,6 @@ set(ZSRC
cuda_zunmqrt.c
)
if( CHAMELEON_USE_CUBLAS_V2 )
set(ZSRC
${ZSRC}
cuda_zgeadd.c
)
endif( CHAMELEON_USE_CUBLAS_V2 )
# Former MAGMA files that are no longer supported
# if( CHAMELEON_USE_MAGMA )
# set(ZSRC
......@@ -83,15 +77,9 @@ precisions_rules_py(
set(CUDABLAS_SRCS
${CUDABLAS_SRCS_GENERATED}
cudaglobal.c
)
if (CHAMELEON_USE_CUBLAS_V2)
set(CUDABLAS_SRCS
${CUDABLAS_SRCS}
cudaglobal.c
)
endif (CHAMELEON_USE_CUBLAS_V2)
# Force generation of sources
# ---------------------------
add_custom_target(cudablas_sources ALL SOURCES ${CUDABLAS_SRCS})
......
......@@ -19,10 +19,6 @@
*/
#include "cudablas.h"
#if !defined(CHAMELEON_USE_CUBLAS_V2)
#error "This file requires cublas api v2 support"
#endif
/**
******************************************************************************
*
......
......@@ -30,8 +30,6 @@ int CUDA_ztrmm(
CUBLAS_STREAM_PARAM)
{
#if defined(CHAMELEON_USE_CUBLAS_V2)
cublasZtrmm(
CUBLAS_HANDLE
chameleon_cublas_const(side), chameleon_cublas_const(uplo),
......@@ -41,17 +39,6 @@ int CUDA_ztrmm(
B, ldb,
B, ldb);
#else
cublasZtrmm(
CUBLAS_HANDLE
chameleon_cublas_const(side), chameleon_cublas_const(uplo),
chameleon_cublas_const(transa), chameleon_cublas_const(diag),
m, n,
CUBLAS_VALUE(alpha), A, lda,
B, ldb);
#endif
assert( CUBLAS_STATUS_SUCCESS == cublasGetError() );
return CHAMELEON_SUCCESS;
......
......@@ -36,8 +36,6 @@
#include <cuda.h>
#include <cuComplex.h>
#if defined(CHAMELEON_USE_CUBLAS_V2)
#include <cublas.h>
#include <cublas_v2.h>
......@@ -50,18 +48,6 @@
cudaStream_t stream; \
cublasGetStream( handle, &stream )
#else
#include <cublas.h>
#define CUBLAS_STREAM_PARAM cudaStream_t stream
#define CUBLAS_STREAM_VALUE stream
#define CUBLAS_HANDLE
#define CUBLAS_SADDR(_a_) (_a_)
#define CUBLAS_VALUE(_a_) (*(_a_))
#define CUBLAS_GET_STREAM
#endif /* defined(CHAMELEON_USE_CUBLAS_V2) */
/**
* CHAMELEON types and constants
*/
......@@ -95,12 +81,7 @@ extern char *chameleon_lapack_constants[];
#define chameleon_lapack_const(chameleon_const) chameleon_lapack_constants[chameleon_const][0]
extern int chameleon_cublas_constants[];
#if defined(CHAMELEON_USE_CUBLAS_V2)
#define chameleon_cublas_const(chameleon_const) chameleon_cublas_constants[chameleon_const]
#else
#define chameleon_cublas_const(chameleon_const) chameleon_lapack_constants[chameleon_const][0]
#endif
END_C_DECLS
......
......@@ -51,7 +51,6 @@
/* GPU Support */
#cmakedefine CHAMELEON_USE_CUDA
#cmakedefine CHAMELEON_USE_CUBLAS
#cmakedefine CHAMELEON_USE_CUBLAS_V2
/* Hmat-oss */
#cmakedefine CHAMELEON_USE_HMAT
......
......@@ -44,7 +44,7 @@ static void cl_zgeadd_cpu_func(void *descr[], void *cl_arg)
return;
}
#ifdef CHAMELEON_USE_CUBLAS_V2
#ifdef CHAMELEON_USE_CUBLAS
static void cl_zgeadd_cuda_func(void *descr[], void *cl_arg)
{
cham_trans_t trans;
......@@ -74,13 +74,13 @@ static void cl_zgeadd_cuda_func(void *descr[], void *cl_arg)
return;
}
#endif /* defined(CHAMELEON_USE_CUBLAS_V2) */
#endif /* defined(CHAMELEON_USE_CUBLAS) */
#endif /* !defined(CHAMELEON_SIMULATION) */
/*
* Codelet definition
*/
#if defined(CHAMELEON_USE_CUBLAS_V2)
#if defined(CHAMELEON_USE_CUBLAS)
CODELETS(zgeadd, cl_zgeadd_cpu_func, cl_zgeadd_cuda_func, STARPU_CUDA_ASYNC)
#else
CODELETS_CPU(zgeadd, cl_zgeadd_cpu_func)
......
......@@ -63,11 +63,9 @@
#include <cublas.h>
#include <starpu_cublas.h>
#if defined(CHAMELEON_USE_CUBLAS_V2)
#include <cublas_v2.h>
#include <starpu_cublas_v2.h>
#endif
#endif
#if defined(CHAMELEON_SIMULATION)
# if !defined(STARPU_SIMGRID)
......@@ -128,16 +126,11 @@ typedef struct starpu_option_request_s {
#endif
/*
* cuBlasAPI v2 - StarPU enable the support for cublas handle
* cuBLAS API - StarPU enable the support for cublas handle
*/
#if defined(CHAMELEON_USE_CUDA) && defined(CHAMELEON_USE_CUBLAS_V2)
#if defined(CHAMELEON_USE_CUDA)
#define RUNTIME_getStream(_stream_) \
cublasHandle_t _stream_ = starpu_cublas_get_local_handle();
#else
#define RUNTIME_getStream(_stream_) \
cudaStream_t _stream_ = starpu_cuda_get_local_stream(); \
cublasSetKernelStream( stream );
#endif
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment