diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 94dac52..5e29d90 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -141,10 +141,10 @@ elseif( CMAKE_COMPILER_IS_GNUCC ) message( STATUS "Detected GNU compiler collection" ) if( clSPARSE_BUILD64 ) - set( CMAKE_CXX_FLAGS "-m64 ${CMAKE_CXX_FLAGS}" ) + set( CMAKE_CXX_FLAGS "-g -m64 ${CMAKE_CXX_FLAGS}" ) set( CMAKE_C_FLAGS "-m64 ${CMAKE_C_FLAGS}" ) else( ) - set( CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}" ) + set( CMAKE_CXX_FLAGS "-g -m32 ${CMAKE_CXX_FLAGS}" ) set( CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}" ) endif( ) else( ) diff --git a/src/tests/resources/opencl_utils.cpp b/src/tests/resources/opencl_utils.cpp index 2dfcc4f..c09be6c 100644 --- a/src/tests/resources/opencl_utils.cpp +++ b/src/tests/resources/opencl_utils.cpp @@ -82,7 +82,7 @@ cl::Device getDevice( cl_platform_type pID, cl_uint dID ) std::map pNames; - //search for AMD or NVIDIA + //search for AMD, NVIDIA or INTEL cl_int pIndex = -1; for( const auto& p : platforms ) { @@ -96,13 +96,21 @@ cl::Device getDevice( cl_platform_type pID, cl_uint dID ) //get index of desired platform; std::string desired_platform_name; + int device_type; if( pID == AMD ) { desired_platform_name = amd_platform_str; + device_type = CL_DEVICE_TYPE_GPU; } else if( pID == NVIDIA ) { desired_platform_name = nvidia_platform_str; + device_type = CL_DEVICE_TYPE_GPU; + } + else if( pID == INTEL ) + { + desired_platform_name = intel_platform_str; + device_type = CL_DEVICE_TYPE_CPU; } else { @@ -122,7 +130,7 @@ cl::Device getDevice( cl_platform_type pID, cl_uint dID ) } std::vector devices; - platforms[ pIndex ].getDevices( CL_DEVICE_TYPE_GPU, &devices ); + platforms[ pIndex ].getDevices( device_type, &devices ); assert( dID < devices.size( ) ); diff --git a/src/tests/resources/opencl_utils.h b/src/tests/resources/opencl_utils.h index 2d3fd12..1df01ea 100644 --- a/src/tests/resources/opencl_utils.h +++ b/src/tests/resources/opencl_utils.h @@ -30,11 +30,13 @@ typedef enum _platform { AMD = 0, - NVIDIA + NVIDIA = 1, + INTEL = 2, } cl_platform_type; const static std::string amd_platform_str = "AMD"; const static std::string nvidia_platform_str = "NVIDIA"; +const static std::string intel_platform_str = "Intel(R)"; cl_int getPlatforms( cl_platform_id **platforms, cl_uint* num_platforms ); diff --git a/src/tests/test-blas1.cpp b/src/tests/test-blas1.cpp index 115c17c..f608572 100644 --- a/src/tests/test-blas1.cpp +++ b/src/tests/test-blas1.cpp @@ -623,7 +623,7 @@ int main (int argc, char* argv[]) desc.add_options() ("help,h", "Produce this message.") ("platform,l", po::value(&platform)->default_value("AMD"), - "OpenCL platform: AMD or NVIDIA.") + "OpenCL platform: AMD, NVIDIA or INTEL.") ("device,d", po::value(&dID)->default_value(0), "Device id within platform.") ("size,s",po::value(&size)->default_value(1024), @@ -669,6 +669,10 @@ int main (int argc, char* argv[]) { pID = NVIDIA; } + else if ("INTEL" == platform) + { + pID = INTEL; + } else { diff --git a/src/tests/test-blas2.cpp b/src/tests/test-blas2.cpp index 84d9d8d..61313cf 100644 --- a/src/tests/test-blas2.cpp +++ b/src/tests/test-blas2.cpp @@ -392,7 +392,7 @@ int main (int argc, char* argv[]) ("help,h", "Produce this message.") ("path,p", po::value(&path)->required(), "Path to matrix in mtx format.") ("platform,l", po::value(&platform)->default_value("AMD"), - "OpenCL platform: AMD or NVIDIA.") + "OpenCL platform: AMD, NVIDIA or INTEL.") ("device,d", po::value(&dID)->default_value(0), "Device id within platform.") ("alpha,a", po::value(&alpha)->default_value(1.0), @@ -439,6 +439,10 @@ int main (int argc, char* argv[]) { pID = NVIDIA; } + else if ("INTEL" == platform) + { + pID = INTEL; + } else { diff --git a/src/tests/test-blas3.cpp b/src/tests/test-blas3.cpp index d00dc25..b1702da 100644 --- a/src/tests/test-blas3.cpp +++ b/src/tests/test-blas3.cpp @@ -657,7 +657,7 @@ int main (int argc, char* argv[]) ("path,p", po::value(&path)->required(), "Path to matrix in mtx format.") ("function,f", po::value(&function)->default_value("SpMdM"), "Sparse functions to test. Options: SpMdM, SpMSpM, All") ("platform,l", po::value(&platform)->default_value("AMD"), - "OpenCL platform: AMD or NVIDIA.") + "OpenCL platform: AMD, NVIDIA or INTEL.") ("device,d", po::value(&dID)->default_value(0), "Device id within platform.") ("alpha,a", po::value(&alpha)->default_value(1.0), @@ -707,6 +707,10 @@ int main (int argc, char* argv[]) { pID = NVIDIA; } + else if ("INTEL" == platform) + { + pID = INTEL; + } else { std::cout << "The platform option is missing or is ill defined!\n";