Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Chameleon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
Chameleon
Commits
ebd114f0
Commit
ebd114f0
authored
1 year ago
by
Mathieu Faverge
Browse files
Options
Downloads
Patches
Plain Diff
gpus/cublas: add the gemmex kernel
parent
ae7bbb63
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!395
Introduce half-precision conversion and gemm kernels for GPUs
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gpucublas/compute/CMakeLists.txt
+1
-0
1 addition, 0 deletions
gpucublas/compute/CMakeLists.txt
gpucublas/compute/cuda_gemmex.c
+43
-0
43 additions, 0 deletions
gpucublas/compute/cuda_gemmex.c
gpucublas/include/gpucublas.h
+39
-0
39 additions, 0 deletions
gpucublas/include/gpucublas.h
with
83 additions
and
0 deletions
gpucublas/compute/CMakeLists.txt
+
1
−
0
View file @
ebd114f0
...
...
@@ -292,6 +292,7 @@ precisions_rules_py(
set
(
GPUCUBLAS_SRCS
${
GPUCUBLAS_SRCS_GENERATED
}
cuda_hgemm.c
cuda_gemmex.c
cudaglobal.c
)
...
...
This diff is collapsed.
Click to expand it.
gpucublas/compute/cuda_gemmex.c
0 → 100644
+
43
−
0
View file @
ebd114f0
/**
*
* @file cuda_gemmex.c
*
* @copyright 2023-2023 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
***
*
* @brief Chameleon cuda_gemmex GPU kernel
*
* @version 1.3.0
* @author Mathieu Faverge
* @date 2023-07-04
*
*/
#include
"gpucublas.h"
int
CUDA_gemmex
(
cham_trans_t
transa
,
cham_trans_t
transb
,
int
m
,
int
n
,
int
k
,
const
void
*
alpha
,
const
void
*
A
,
int
lda
,
cham_flttype_t
Atype
,
const
void
*
B
,
int
ldb
,
cham_flttype_t
Btype
,
const
void
*
beta
,
void
*
C
,
int
ldc
,
cham_flttype_t
Ctype
,
cublasHandle_t
handle
)
{
cublasStatus_t
rc
;
rc
=
cublasGemmEx
(
handle
,
chameleon_cublas_const
(
transa
),
chameleon_cublas_const
(
transb
),
m
,
n
,
k
,
CUBLAS_VALUE
(
alpha
),
A
,
lda
,
chameleon_cublas_dtype
(
Atype
),
B
,
ldb
,
chameleon_cublas_dtype
(
Btype
),
CUBLAS_VALUE
(
beta
),
C
,
ldc
,
chameleon_cublas_dtype
(
Ctype
),
chameleon_cublas_ctype
(
Ctype
),
CUBLAS_GEMM_DEFAULT
);
assert
(
rc
==
CUBLAS_STATUS_SUCCESS
);
(
void
)
rc
;
return
CHAMELEON_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
gpucublas/include/gpucublas.h
+
39
−
0
View file @
ebd114f0
...
...
@@ -70,6 +70,45 @@ int CUDA_hgemm( cham_trans_t transa, cham_trans_t transb,
CHAMELEON_Real16_t
*
C
,
int
ldc
,
cublasHandle_t
handle
);
int
CUDA_gemmex
(
cham_trans_t
transa
,
cham_trans_t
transb
,
int
m
,
int
n
,
int
k
,
const
void
*
alpha
,
const
void
*
A
,
int
lda
,
cham_flttype_t
Atype
,
const
void
*
B
,
int
ldb
,
cham_flttype_t
Btype
,
const
void
*
beta
,
void
*
C
,
int
ldc
,
cham_flttype_t
Ctype
,
cublasHandle_t
handle
);
static
inline
cublasComputeType_t
chameleon_cublas_ctype
(
cham_flttype_t
flttype
)
{
switch
(
flttype
)
{
case
ChamRealHalf
:
return
CUBLAS_COMPUTE_16F
;
case
ChamRealFloat
:
return
CUBLAS_COMPUTE_32F
;
case
ChamRealDouble
:
return
CUBLAS_COMPUTE_64F
;
case
ChamComplexFloat
:
return
CUBLAS_COMPUTE_32F
;
case
ChamComplexDouble
:
return
CUBLAS_COMPUTE_64F
;
default:
fprintf
(
stderr
,
"chameleon_cublas_ctype(): Incorrect flttype
\n
"
);
exit
(
1
);
}
}
static
inline
cudaDataType_t
chameleon_cublas_dtype
(
cham_flttype_t
flttype
)
{
switch
(
flttype
)
{
case
ChamRealHalf
:
return
CUDA_R_16F
;
case
ChamRealFloat
:
return
CUDA_R_32F
;
case
ChamRealDouble
:
return
CUDA_R_64F
;
case
ChamComplexFloat
:
return
CUDA_C_32F
;
case
ChamComplexDouble
:
return
CUDA_C_64F
;
default:
fprintf
(
stderr
,
"chameleon_cublas_dtype(): Incorrect flttype
\n
"
);
exit
(
1
);
}
}
END_C_DECLS
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment