Skip to content

Commit

Permalink
Fixes for CUDA version of CLBlast
Browse files Browse the repository at this point in the history
  • Loading branch information
CNugteren committed Jun 3, 2018
1 parent 4f594e3 commit bd1715a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
26 changes: 15 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,14 @@ if(TUNERS)
target_include_directories(clblast_tuner_${KERNEL} PUBLIC $<TARGET_PROPERTY:clblast,INTERFACE_INCLUDE_DIRECTORIES> ${API_INCLUDE_DIRS})
install(TARGETS clblast_tuner_${KERNEL} DESTINATION bin)
endforeach()
foreach(ROUTINE_TUNER ${ROUTINE_TUNERS})
add_executable(clblast_tuner_routine_${ROUTINE_TUNER} ${TUNERS_COMMON} src/tuning/routines/${ROUTINE_TUNER}.cpp test/test_utilities.cpp)
target_link_libraries(clblast_tuner_routine_${ROUTINE_TUNER} clblast)
target_include_directories(clblast_tuner_routine_${ROUTINE_TUNER} PUBLIC $<TARGET_PROPERTY:clblast,INTERFACE_INCLUDE_DIRECTORIES> ${API_INCLUDE_DIRS} ${clblast_SOURCE_DIR})
install(TARGETS clblast_tuner_routine_${ROUTINE_TUNER} DESTINATION bin)
endforeach()
if(OPENCL)
foreach(ROUTINE_TUNER ${ROUTINE_TUNERS})
add_executable(clblast_tuner_routine_${ROUTINE_TUNER} ${TUNERS_COMMON} src/tuning/routines/${ROUTINE_TUNER}.cpp test/test_utilities.cpp)
target_link_libraries(clblast_tuner_routine_${ROUTINE_TUNER} clblast)
target_include_directories(clblast_tuner_routine_${ROUTINE_TUNER} PUBLIC $<TARGET_PROPERTY:clblast,INTERFACE_INCLUDE_DIRECTORIES> ${API_INCLUDE_DIRS} ${clblast_SOURCE_DIR})
install(TARGETS clblast_tuner_routine_${ROUTINE_TUNER} DESTINATION bin)
endforeach()
endif()

# Adds 'alltuners' target: runs all tuners for all precisions
set(ALLTUNERS )
Expand All @@ -440,12 +442,14 @@ if(TUNERS)
endforeach()
set(ALLTUNERSDEPENDS clblast_tuner_${KERNEL})
endforeach()
foreach(ROUTINE_TUNER ${ROUTINE_TUNERS})
foreach(PRECISION ${PRECISIONS})
set(ALLTUNERS ${ALLTUNERS} COMMAND clblast_tuner_routine_${ROUTINE_TUNER} -precision ${PRECISION})
if(OPENCL)
foreach(ROUTINE_TUNER ${ROUTINE_TUNERS})
foreach(PRECISION ${PRECISIONS})
set(ALLTUNERS ${ALLTUNERS} COMMAND clblast_tuner_routine_${ROUTINE_TUNER} -precision ${PRECISION})
endforeach()
set(ALLTUNERSDEPENDS clblast_tuner_routine_${ROUTINE_TUNER})
endforeach()
set(ALLTUNERSDEPENDS clblast_tuner_routine_${ROUTINE_TUNER})
endforeach()
endif()
add_custom_target(alltuners ${ALLTUNERS} DEPENDS ${ALLTUNERSDEPENDS})

endif()
Expand Down
4 changes: 2 additions & 2 deletions src/cupp11.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,8 @@ class Kernel {
}

// Regular constructor with memory management
explicit Kernel(const Program &program, const std::string &name): name_(name) {
CheckError(cuModuleGetFunction(&kernel_, program.GetModule(), name.c_str()));
explicit Kernel(const std::shared_ptr<Program> program, const std::string &name): name_(name) {
CheckError(cuModuleGetFunction(&kernel_, program->GetModule(), name.c_str()));
}

// Sets a kernel argument at the indicated position. This stores both the value of the argument
Expand Down

0 comments on commit bd1715a

Please sign in to comment.