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
f08ed1d4
Commit
f08ed1d4
authored
9 months ago
by
Mathieu Faverge
Browse files
Options
Downloads
Patches
Plain Diff
cmake/gpucublas: Move the cuda toolkit detection to better select the inclusion of extra kernels
parent
806a2160
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!470
Issue #127: Fix the protection of half precision kernels with cuda
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gpucublas/CMakeLists.txt
+42
-0
42 additions, 0 deletions
gpucublas/CMakeLists.txt
gpucublas/compute/CMakeLists.txt
+21
-19
21 additions, 19 deletions
gpucublas/compute/CMakeLists.txt
with
63 additions
and
19 deletions
gpucublas/CMakeLists.txt
+
42
−
0
View file @
f08ed1d4
...
...
@@ -26,6 +26,48 @@
#
###
# Add CUDA kernel if compiler and toolkit are available
# -----------------------------------------------------
include
(
CheckLanguage
)
check_language
(
CUDA
)
if
(
CMAKE_CUDA_COMPILER
)
enable_language
(
CUDA
)
find_package
(
CUDAToolkit
)
else
()
message
(
STATUS
"CUDA language is not supported"
)
endif
()
if
(
CUDAToolkit_FOUND
)
set
(
GPUCUBLAS_HAVE_CUDA_TOOLKIT ON CACHE INTERNAL
"Indicate if cuda kernels are enabled or not"
FORCE
)
include
(
SetCMakeCudaArchitectures
)
if
(
CUDAToolkit_VERSION VERSION_GREATER_EQUAL
"7.5"
)
set
(
GPUCUBLAS_HAVE_CUDA_HALF ON CACHE INTERNAL
"Indicate if half precision support is enabled or not"
FORCE
)
else
()
set
(
GPUCUBLAS_HAVE_CUDA_HALF OFF CACHE INTERNAL
"Indicate if half precision support is enabled or not"
FORCE
)
endif
()
else
()
set
(
GPUCUBLAS_HAVE_CUDA_TOOLKIT OFF CACHE INTERNAL
"Indicate if cuda kernels are enabled or not"
FORCE
)
set
(
GPUCUBLAS_HAVE_CUDA_HALF OFF CACHE INTERNAL
"Indicate if half precision support is enabled or not"
FORCE
)
endif
()
if
(
GPUCUBLAS_HAVE_CUDA_HALF
)
##morse_cmake_required_set( CUBLAS )
set
(
CMAKE_REQUIRED_LIBRARIES CUDA::CUBLAS
)
check_function_exists
(
cublasHgemm GPUCUBLAS_HAVE_CUBLASHGEMM
)
if
(
GPUCUBLAS_HAVE_CUBLASHGEMM
)
message
(
"--
${
Blue
}
Add definition HAVE_CUBLASHGEMM
${
ColourReset
}
"
)
endif
()
check_function_exists
(
cublasGemmEx GPUCUBLAS_HAVE_CUBLASGEMMEX
)
if
(
GPUCUBLAS_HAVE_CUBLASGEMMEX
)
message
(
"--
${
Blue
}
Add definition HAVE_CUBLASGEMMEX
${
ColourReset
}
"
)
endif
()
morse_cmake_required_unset
()
endif
()
add_subdirectory
(
include
)
add_subdirectory
(
compute
)
add_subdirectory
(
eztrace_module
)
...
...
This diff is collapsed.
Click to expand it.
gpucublas/compute/CMakeLists.txt
+
21
−
19
View file @
f08ed1d4
...
...
@@ -56,24 +56,15 @@ set(ZSRC
cuda_zunmqrt.c
)
# Add CUDA kernel if compiler and toolkit are available
# -----------------------------------------------------
include
(
CheckLanguage
)
check_language
(
CUDA
)
if
(
CMAKE_CUDA_COMPILER
)
enable_language
(
CUDA
)
find_package
(
CUDAToolkit
)
else
()
message
(
STATUS
"CUDA language is not supported"
)
endif
()
if
(
CUDAToolkit_FOUND
)
include
(
SetCMakeCudaArchitectures
)
if
(
GPUCUBLAS_HAVE_CUDA_TOOLKIT
)
set
(
ZSRC
${
ZSRC
}
cuda_zlag2c.cu
)
endif
()
if
(
GPUCUBLAS_HAVE_CUDA_HALF
)
set
(
ZSRC
${
ZSRC
}
cuda_dlag2h.cu
)
endif
()
...
...
@@ -102,13 +93,24 @@ precisions_rules_py(
set
(
GPUCUBLAS_SRCS
${
GPUCUBLAS_SRCS_GENERATED
}
cuda_hgemm.c
cuda_gemmex.c
cudaglobal.c
)
if
(
GPUCUBLAS_HAVE_CUBLASHGEMM
)
set
(
GPUCUBLAS_SRCS
${
GPUCUBLAS_SRCS
}
cuda_hgemm.c
)
# Need to use CXX compiler to have the __half support and access to cublasHgemm()
set_source_files_properties
(
cuda_hgemm.c PROPERTIES LANGUAGE CXX
)
endif
()
# Need to use CXX compiler to have the __half support and access to cublasHgemm()
set_source_files_properties
(
cuda_hgemm.c PROPERTIES LANGUAGE CXX
)
if
(
GPUCUBLAS_HAVE_CUBLASGEMMEX
)
set
(
GPUCUBLAS_SRCS
${
GPUCUBLAS_SRCS
}
cuda_gemmex.c
)
endif
()
# Force generation of sources
# ---------------------------
...
...
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