mirror of
https://github.com/amd/blis.git
synced 2026-05-11 09:39:59 +00:00
BLIS GTestSuite: Link OpenMP if we test serial BLIS, but MKL is used as a reference.
Change-Id: Iacafa5ecf74622fa5e1180a81305cf7a23d79055
This commit is contained in:
committed by
Eleni Vlachopoulou
parent
f5dc3db648
commit
04e091fdca
@@ -1,4 +1,7 @@
|
||||
#include <iostream>
|
||||
#ifdef REF_IS_MKL
|
||||
#include <omp.h>
|
||||
#endif
|
||||
#include "common/refCBLAS.h"
|
||||
|
||||
namespace testinghelpers {
|
||||
@@ -7,6 +10,8 @@ refCBLAS::refCBLAS() {
|
||||
if (!refCBLASModule)
|
||||
{
|
||||
#ifdef REF_IS_MKL
|
||||
// Dummy call to force linker, link OpenMP library if MKL is used.
|
||||
omp_get_num_threads();
|
||||
MKLCoreModule = dlopen(MKL_CORE, RTLD_GLOBAL | RTLD_LAZY);
|
||||
MKLGNUThreadModule = dlopen(MKL_GNU_THREAD, RTLD_GLOBAL | RTLD_LAZY);
|
||||
#endif
|
||||
|
||||
@@ -37,7 +37,8 @@ foreach(dir ${DIRS})
|
||||
set_target_properties(${target_name}.${dir}.${subdir} PROPERTIES OUTPUT_NAME ${target_name}.${dir}.${subdir})
|
||||
target_include_directories(${target_name}.${dir}.${subdir} PUBLIC ${BLIS_INCLUDE} ${CMAKE_SOURCE_DIR}/testinghelpers/inc ${CMAKE_SOURCE_DIR}/testsuite/)
|
||||
target_link_libraries(${target_name}.${dir}.${subdir} gtest gtest_main testinghelpers ${Blis_LIBRARY} ${COMMON_LIBS})
|
||||
if(ENABLE_THREADING STREQUAL "openmp")
|
||||
# if we test serial BLIS, but MKL is used as a reference we still need to set up OpenMP.
|
||||
if( (ENABLE_THREADING STREQUAL "openmp") OR (REF_CBLAS STREQUAL "MKL"))
|
||||
if(LINUX)
|
||||
if(OpenMP_LIBRARY STREQUAL "GNU")
|
||||
target_link_libraries(${target_name}.${dir}.${subdir} -fopenmp)
|
||||
|
||||
Reference in New Issue
Block a user