Renamed all C++ source files to .cpp to match the .hpp extension better
parent
f726fbdc9f
commit
61203453aa
|
@ -4,6 +4,7 @@ Development version (next release)
|
|||
- Made it possible to compile the performance tests (clients) separately from the correctness tests
|
||||
- Made a reference BLAS and head-to-head performance comparison optional in the clients
|
||||
- Increased the verbosity of the "-verbose" option in the correctness tests
|
||||
- Refactored the host code for better compilation times and fewer lines of code
|
||||
- Improved the API documentation
|
||||
- Various minor fixes and enhancements
|
||||
- Added tuned parameters for various devices (see README)
|
||||
|
|
|
@ -141,25 +141,25 @@ set(PRECISIONS 32 64 3232 6464)
|
|||
|
||||
# Gathers all source-files
|
||||
set(SOURCES
|
||||
src/database/database.cc
|
||||
src/routines/common.cc
|
||||
src/cache.cc
|
||||
src/clblast.cc
|
||||
src/clblast_c.cc
|
||||
src/routine.cc
|
||||
src/utilities.cc
|
||||
src/database/database.cpp
|
||||
src/routines/common.cpp
|
||||
src/cache.cpp
|
||||
src/clblast.cpp
|
||||
src/clblast_c.cpp
|
||||
src/routine.cpp
|
||||
src/utilities.cpp
|
||||
)
|
||||
foreach(ROUTINE ${LEVEL1_ROUTINES})
|
||||
set(SOURCES ${SOURCES} src/routines/level1/${ROUTINE}.cc)
|
||||
set(SOURCES ${SOURCES} src/routines/level1/${ROUTINE}.cpp)
|
||||
endforeach()
|
||||
foreach(ROUTINE ${LEVEL2_ROUTINES})
|
||||
set(SOURCES ${SOURCES} src/routines/level2/${ROUTINE}.cc)
|
||||
set(SOURCES ${SOURCES} src/routines/level2/${ROUTINE}.cpp)
|
||||
endforeach()
|
||||
foreach(ROUTINE ${LEVEL3_ROUTINES})
|
||||
set(SOURCES ${SOURCES} src/routines/level3/${ROUTINE}.cc)
|
||||
set(SOURCES ${SOURCES} src/routines/level3/${ROUTINE}.cpp)
|
||||
endforeach()
|
||||
foreach(ROUTINE ${LEVELX_ROUTINES})
|
||||
set(SOURCES ${SOURCES} src/routines/levelx/${ROUTINE}.cc)
|
||||
set(SOURCES ${SOURCES} src/routines/levelx/${ROUTINE}.cpp)
|
||||
endforeach()
|
||||
|
||||
# Creates and links the library
|
||||
|
@ -193,7 +193,7 @@ if(SAMPLES)
|
|||
|
||||
# Adds sample programs (C++)
|
||||
foreach(SAMPLE ${SAMPLE_PROGRAMS_CPP})
|
||||
add_executable(clblast_sample_${SAMPLE} samples/${SAMPLE}.cc)
|
||||
add_executable(clblast_sample_${SAMPLE} samples/${SAMPLE}.cpp)
|
||||
target_link_libraries(clblast_sample_${SAMPLE} clblast ${OPENCL_LIBRARIES})
|
||||
install(TARGETS clblast_sample_${SAMPLE} DESTINATION bin)
|
||||
endforeach()
|
||||
|
@ -218,7 +218,7 @@ if(TUNERS)
|
|||
|
||||
# Adds tuning executables
|
||||
foreach(KERNEL ${KERNELS})
|
||||
add_executable(clblast_tuner_${KERNEL} src/tuning/kernels/${KERNEL}.cc)
|
||||
add_executable(clblast_tuner_${KERNEL} src/tuning/kernels/${KERNEL}.cpp)
|
||||
target_link_libraries(clblast_tuner_${KERNEL} clblast ${CLTUNE_LIBRARIES} ${OPENCL_LIBRARIES})
|
||||
install(TARGETS clblast_tuner_${KERNEL} DESTINATION bin)
|
||||
endforeach()
|
||||
|
@ -275,24 +275,24 @@ endif()
|
|||
if(CLIENTS)
|
||||
|
||||
# Creates the common performance-tests objects (requires CMake 2.8.8)
|
||||
add_library(test_performance_common OBJECT test/performance/client.cc)
|
||||
add_library(test_performance_common OBJECT test/performance/client.cpp)
|
||||
|
||||
# Compiles the performance-tests
|
||||
foreach(ROUTINE ${LEVEL1_ROUTINES})
|
||||
add_executable(clblast_client_${ROUTINE} $<TARGET_OBJECTS:test_performance_common>
|
||||
test/performance/routines/level1/${ROUTINE}.cc)
|
||||
test/performance/routines/level1/${ROUTINE}.cpp)
|
||||
endforeach()
|
||||
foreach(ROUTINE ${LEVEL2_ROUTINES})
|
||||
add_executable(clblast_client_${ROUTINE} $<TARGET_OBJECTS:test_performance_common>
|
||||
test/performance/routines/level2/${ROUTINE}.cc)
|
||||
test/performance/routines/level2/${ROUTINE}.cpp)
|
||||
endforeach()
|
||||
foreach(ROUTINE ${LEVEL3_ROUTINES})
|
||||
add_executable(clblast_client_${ROUTINE} $<TARGET_OBJECTS:test_performance_common>
|
||||
test/performance/routines/level3/${ROUTINE}.cc)
|
||||
test/performance/routines/level3/${ROUTINE}.cpp)
|
||||
endforeach()
|
||||
foreach(ROUTINE ${LEVELX_ROUTINES})
|
||||
add_executable(clblast_client_${ROUTINE} $<TARGET_OBJECTS:test_performance_common>
|
||||
test/performance/routines/levelx/${ROUTINE}.cc)
|
||||
test/performance/routines/levelx/${ROUTINE}.cpp)
|
||||
endforeach()
|
||||
foreach(ROUTINE ${ROUTINES})
|
||||
target_link_libraries(clblast_client_${ROUTINE} clblast ${REF_LIBRARIES} ${OPENCL_LIBRARIES})
|
||||
|
@ -310,24 +310,24 @@ if(TESTS)
|
|||
|
||||
# Creates the common correctness-tests objects (requires CMake 2.8.8)
|
||||
add_library(test_correctness_common OBJECT
|
||||
test/correctness/tester.cc test/correctness/testblas.cc)
|
||||
test/correctness/tester.cpp test/correctness/testblas.cpp)
|
||||
|
||||
# Compiles the correctness-tests
|
||||
foreach(ROUTINE ${LEVEL1_ROUTINES})
|
||||
add_executable(clblast_test_${ROUTINE} $<TARGET_OBJECTS:test_correctness_common>
|
||||
test/correctness/routines/level1/${ROUTINE}.cc)
|
||||
test/correctness/routines/level1/${ROUTINE}.cpp)
|
||||
endforeach()
|
||||
foreach(ROUTINE ${LEVEL2_ROUTINES})
|
||||
add_executable(clblast_test_${ROUTINE} $<TARGET_OBJECTS:test_correctness_common>
|
||||
test/correctness/routines/level2/${ROUTINE}.cc)
|
||||
test/correctness/routines/level2/${ROUTINE}.cpp)
|
||||
endforeach()
|
||||
foreach(ROUTINE ${LEVEL3_ROUTINES})
|
||||
add_executable(clblast_test_${ROUTINE} $<TARGET_OBJECTS:test_correctness_common>
|
||||
test/correctness/routines/level3/${ROUTINE}.cc)
|
||||
test/correctness/routines/level3/${ROUTINE}.cpp)
|
||||
endforeach()
|
||||
foreach(ROUTINE ${LEVELX_ROUTINES})
|
||||
add_executable(clblast_test_${ROUTINE} $<TARGET_OBJECTS:test_correctness_common>
|
||||
test/correctness/routines/levelx/${ROUTINE}.cc)
|
||||
test/correctness/routines/levelx/${ROUTINE}.cpp)
|
||||
endforeach()
|
||||
foreach(ROUTINE ${ROUTINES})
|
||||
target_link_libraries(clblast_test_${ROUTINE} clblast ${REF_LIBRARIES} ${OPENCL_LIBRARIES})
|
||||
|
|
|
@ -136,7 +136,7 @@ Note that CLBlast's tuners are based on the CLTune auto-tuning library, which ha
|
|||
|
||||
Compiling with `-DTUNERS=ON` will generate a number of tuners, each named `clblast_tuner_xxxxx`, in which `xxxxx` corresponds to a `.opencl` kernel file as found in `src/kernels`. These kernels corresponds to routines (e.g. `xgemm`) or to common pre-processing or post-processing kernels (`copy` and `transpose`). Running such a tuner will test a number of parameter-value combinations on your device and report which one gave the best performance. Running `make alltuners` runs all tuners for all precisions in one go. You can set the default device and platform for `alltuners` by setting the `DEFAULT_DEVICE` and `DEFAULT_PLATFORM` environmental variables before running CMake.
|
||||
|
||||
The tuners output a JSON-file with the results. The best results need to be added to `include/internal/database/xxxxx.h` in the appropriate section. However, this can be done automatically based on the JSON-data using a Python script in `scripts/database/database.py`. If you want the found parameters to be included in future releases of CLBlast, please attach the JSON files to the corresponding issue on GitHub or [email the main author](http://www.cedricnugteren.nl).
|
||||
The tuners output a JSON-file with the results. The best results need to be added to `include/internal/database/xxxxx.hpp` in the appropriate section. However, this can be done automatically based on the JSON-data using a Python script in `scripts/database/database.py`. If you want the found parameters to be included in future releases of CLBlast, please attach the JSON files to the corresponding issue on GitHub or [email the main author](http://www.cedricnugteren.nl).
|
||||
|
||||
In summary, tuning the entire library for your device can be done as follows (starting from the root of the CLBlast folder):
|
||||
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
# This script automatically generates the bodies of the following files, creating the full CLBlast
|
||||
# API interface and implementation (C, C++, and reference BLAS wrappers):
|
||||
# clblast.h
|
||||
# clblast.cc
|
||||
# clblast.cpp
|
||||
# clblast_c.h
|
||||
# clblast_c.cc
|
||||
# clblast_c.cpp
|
||||
# wrapper_clblas.h
|
||||
# wrapper_cblas.h
|
||||
# It also generates the main functions for the correctness and performance tests as found in
|
||||
# test/correctness/routines/levelX/xYYYY.cc
|
||||
# test/performance/routines/levelX/xYYYY.cc
|
||||
# test/correctness/routines/levelX/xYYYY.cpp
|
||||
# test/performance/routines/levelX/xYYYY.cpp
|
||||
# It also produces the API documentation found in doc/clblast.md
|
||||
#
|
||||
# ==================================================================================================
|
||||
|
@ -200,7 +200,7 @@ def clblast_h(routines):
|
|||
result += routine.RoutineHeaderCPP(12, " = nullptr")+";\n"
|
||||
return result
|
||||
|
||||
# The C++ API implementation (.cc)
|
||||
# The C++ API implementation (.cpp)
|
||||
def clblast_cc(routines):
|
||||
result = ""
|
||||
for routine in routines:
|
||||
|
@ -237,7 +237,7 @@ def clblast_c_h(routines):
|
|||
result += routine.RoutineHeaderC(flavour, 31, " PUBLIC_API")+";\n"
|
||||
return result
|
||||
|
||||
# The C API implementation (.cc)
|
||||
# The C API implementation (.cpp)
|
||||
def clblast_c_cc(routines):
|
||||
result = ""
|
||||
for routine in routines:
|
||||
|
@ -379,9 +379,9 @@ if len(sys.argv) != 2:
|
|||
path_clblast = sys.argv[1]
|
||||
files = [
|
||||
path_clblast+"/include/clblast.h",
|
||||
path_clblast+"/src/clblast.cc",
|
||||
path_clblast+"/src/clblast.cpp",
|
||||
path_clblast+"/include/clblast_c.h",
|
||||
path_clblast+"/src/clblast_c.cc",
|
||||
path_clblast+"/src/clblast_c.cpp",
|
||||
path_clblast+"/test/wrapper_clblas.hpp",
|
||||
path_clblast+"/test/wrapper_cblas.hpp",
|
||||
]
|
||||
|
@ -433,7 +433,7 @@ for i in xrange(0,len(files)):
|
|||
for level in [1,2,3,4]:
|
||||
for routine in routines[level-1]:
|
||||
if routine.has_tests:
|
||||
filename = path_clblast+"/test/correctness/routines/level"+levelnames[level-1]+"/x"+routine.name+".cc"
|
||||
filename = path_clblast+"/test/correctness/routines/level"+levelnames[level-1]+"/x"+routine.name+".cpp"
|
||||
with open(filename, "w") as f:
|
||||
body = ""
|
||||
body += "#include \"test/correctness/testblas.hpp\"\n"
|
||||
|
@ -459,7 +459,7 @@ for level in [1,2,3,4]:
|
|||
for level in [1,2,3,4]:
|
||||
for routine in routines[level-1]:
|
||||
if routine.has_tests:
|
||||
filename = path_clblast+"/test/performance/routines/level"+levelnames[level-1]+"/x"+routine.name+".cc"
|
||||
filename = path_clblast+"/test/performance/routines/level"+levelnames[level-1]+"/x"+routine.name+".cpp"
|
||||
with open(filename, "w") as f:
|
||||
body = ""
|
||||
body += "#include \"test/performance/client.hpp\"\n"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue