Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dense_linear_algebra
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
CodeVault
hpc-kernels
dense_linear_algebra
Commits
a8581ed3
Commit
a8581ed3
authored
8 years ago
by
Mariusz Uchronski
Browse files
Options
Downloads
Patches
Plain Diff
LU factorizations code sample with clMAGMA library added.
parent
efd5b34f
Branches
Branches containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-0
1 addition, 0 deletions
CMakeLists.txt
lud/clmagma/CMakeLists.txt
+52
-0
52 additions, 0 deletions
lud/clmagma/CMakeLists.txt
lud/clmagma/src/lud_clmagma.cpp
+46
-0
46 additions, 0 deletions
lud/clmagma/src/lud_clmagma.cpp
with
99 additions
and
0 deletions
CMakeLists.txt
+
1
−
0
View file @
a8581ed3
...
@@ -28,6 +28,7 @@ add_subdirectory(kmeans/kmeans_cuda)
...
@@ -28,6 +28,7 @@ add_subdirectory(kmeans/kmeans_cuda)
add_subdirectory
(
kmeans/kmeans_openmp
)
add_subdirectory
(
kmeans/kmeans_openmp
)
add_subdirectory
(
kmeans/kmeans_rodinia_opencl
)
add_subdirectory
(
kmeans/kmeans_rodinia_opencl
)
add_subdirectory
(
lud/mkl
)
add_subdirectory
(
lud/mkl
)
add_subdirectory
(
lud/clmagma
)
add_subdirectory
(
lud/cublas
)
add_subdirectory
(
lud/cublas
)
add_subdirectory
(
lud/cusolver
)
add_subdirectory
(
lud/cusolver
)
add_subdirectory
(
lud/cublas_mkl
)
add_subdirectory
(
lud/cublas_mkl
)
...
...
This diff is collapsed.
Click to expand it.
lud/clmagma/CMakeLists.txt
0 → 100644
+
52
−
0
View file @
a8581ed3
# ==================================================================================================
# This file is part of the CodeVault project. The project is licensed under Apache Version 2.0.
# CodeVault is part of the EU-project PRACE-4IP (WP7.3.C).
#
# Author(s):
# Mariusz Uchronski <mariusz.uchronski@pwr.edu.nl>
#
# ==================================================================================================
cmake_minimum_required
(
VERSION 2.8.7 FATAL_ERROR
)
include
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../cmake/common.cmake
)
# ==================================================================================================
if
(
"
${
DWARF_PREFIX
}
"
STREQUAL
""
)
set
(
DWARF_PREFIX dense_linear_algebra
)
endif
()
enable_language
(
CXX
)
find_package
(
Common
)
find_package
(
OpenCL
)
# Included as ${CMAKE_MODULE_PATH}/FindOpenCL.cmake
find_package
(
clBLAS
)
find_package
(
clMAGMA
)
# Finds the OpenCL clMAGMA library
find_library
(
CLMAGMA_LIBRARIES
NAMES clMAGMA
PATH_SUFFIXES lib lib64
PATHS /usr /usr/local
DOC
"OpenCL clMAGMA library"
)
# GEMM with the OpenCL clMAGMA library
set
(
NAME
${
DWARF_PREFIX
}
_lud_clmagma
)
if
(
OPENCL_FOUND AND CLMAGMA_FOUND
)
include_directories
(
${
OPENCL_INCLUDE_DIRS
}
)
include_directories
(
${
CLMAGMA_INCLUDE_DIRS
}
)
add_executable
(
${
NAME
}
src/lud_clmagma.cpp
)
target_link_libraries
(
${
NAME
}
${
CLMAGMA_LIBRARIES
}
)
target_link_libraries
(
${
NAME
}
${
OPENCL_LIBRARIES
}
)
target_link_libraries
(
${
NAME
}
${
CLBLAS_LIBRARIES
}
)
target_link_libraries
(
${
NAME
}
blas lapack
)
install
(
TARGETS
${
NAME
}
DESTINATION bin
)
message
(
"** Enabling '
${
NAME
}
': with OpenCL and clMAGMA"
)
else
()
message
(
"## Skipping '
${
NAME
}
': no OpenCL or clMAGMA support found"
)
endif
()
unset
(
NAME
)
This diff is collapsed.
Click to expand it.
lud/clmagma/src/lud_clmagma.cpp
0 → 100644
+
46
−
0
View file @
a8581ed3
#include
<stdio.h>
#include
"magma.h"
int
main
(
int
argc
,
char
*
argv
[])
{
float
*
h_A
;
magmaFloat_ptr
d_A
;
magma_int_t
*
ipiv
;
magma_int_t
M
,
N
,
n2
,
lda
,
ldda
,
info
,
min_mn
;
magma_int_t
status
=
0
;
/* Initialize */
magma_queue_t
queue
;
magma_device_t
devices
[
MagmaMaxGPUs
];
magma_int_t
num
=
0
;
magma_int_t
err
;
magma_init
();
err
=
magma_getdevices
(
devices
,
MagmaMaxGPUs
,
&
num
);
if
(
err
!=
0
or
num
<
1
)
{
fprintf
(
stderr
,
"magma_getdevices failed: %d
\n
"
,
(
int
)
err
);
exit
(
-
1
);
}
err
=
magma_queue_create
(
devices
[
0
],
&
queue
);
if
(
err
!=
0
)
{
fprintf
(
stderr
,
"magma_queue_create failed: %d
\n
"
,
(
int
)
err
);
exit
(
-
1
);
}
lda
=
M
;
n2
=
lda
*
N
;
ldda
=
((
M
+
31
)
/
32
)
*
32
;
//TESTING_MALLOC_DEV( d_A, float, ldda*N );
magma_malloc
(
&
d_A
,
(
ldda
*
N
)
*
sizeof
(
float
)
);
//TESTING_MALLOC_CPU( h_A, float, n2 );
magma_malloc_cpu
(
(
void
**
)
&
h_A
,
(
n2
)
*
sizeof
(
float
)
);
magma_ssetmatrix
(
M
,
N
,
h_A
,
lda
,
d_A
,
0
,
ldda
,
queue
);
magma_sgetrf_gpu
(
M
,
N
,
d_A
,
0
,
ldda
,
ipiv
,
queue
,
&
info
);
magma_free_cpu
(
h_A
);
magma_free
(
d_A
);
magma_finalize
();
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
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