mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-11-03 12:47:42 -06:00
Compile mixed precision code only if AVX2 is supported.
For this we remove the GCC pragmas and set the needed compiler flag when available.
This commit is contained in:
1 parent
f34f3beb6d
commit
40e8839171
4 files changed
+1
-16
No files matched your search
@@ -756,11 +756,6 @@ if(HAVE_AVX2_EXTENSION)
|
||||
endif()
|
||||
|
||||
# must link libraries after target 'opmsimulators' has been defined
|
||||
|
||||
if(HAVE_AVX2_EXTENSIONS)
|
||||
target_compile_options(opmsimulators
|
||||
${AVX2_FLAGS})
|
||||
endif()
|
||||
if(CUDA_FOUND)
|
||||
if (NOT USE_HIP)
|
||||
target_link_libraries(opmsimulators
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
#pragma GCC push_options
|
||||
#pragma GCC target("avx2")
|
||||
|
||||
bslv_memory *bslv_alloc()
|
||||
{
|
||||
@@ -239,7 +237,7 @@ int bslv_pbicgstab3d(bslv_memory *mem, bsr_matrix *A, const double *b, double *x
|
||||
}
|
||||
|
||||
|
||||
#pragma GCC pop_options
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
#include <immintrin.h>
|
||||
|
||||
#pragma GCC push_options
|
||||
#pragma GCC target("avx2")
|
||||
|
||||
bsr_matrix* bsr_alloc()
|
||||
{
|
||||
@@ -206,5 +204,3 @@ void bsr_nonzeros(bsr_matrix *A, const char *name)
|
||||
printf("]\n");
|
||||
}
|
||||
|
||||
#pragma GCC pop_options
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
#include <assert.h>
|
||||
#include <immintrin.h>
|
||||
|
||||
#pragma GCC push_options
|
||||
#pragma GCC target("avx2")
|
||||
|
||||
|
||||
prec_t *prec_alloc()
|
||||
{
|
||||
@@ -628,4 +625,3 @@ void prec_info(prec_t *P)
|
||||
bsr_info(P->D);
|
||||
bsr_info(P->U);
|
||||
}
|
||||
#pragma GCC pop_options
|
||||
Reference in new issue
Block a user