Commit 0fa97094 authored by Bram Veenboer's avatar Bram Veenboer

Many fixes/cleanups to make compilation work with external idg-util library

parent 184d5b33
......@@ -77,6 +77,8 @@ endif()
if (${IDG_OnePackage})
include_directories (${CMAKE_BINARY_DIR}/idg-lib/src)
include_directories (${CMAKE_SOURCE_DIR}/idg-lib/src)
include_directories (${CMAKE_BINARY_DIR}/idg-util/src)
include_directories (${CMAKE_SOURCE_DIR}/idg-util/src)
else()
find_package(IDG NO_MODULE REQUIRED)
include_directories (${IDG_INCLUDE_DIR})
......@@ -104,10 +106,10 @@ install(
${CMAKE_INSTALL_PREFIX}
)
set (IDG_BIN_UTILITY_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/utility)
#set (IDG_BIN_UTILITY_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/utility)
# build utilities
add_subdirectory(utility)
#add_subdirectory(utility)
# build all examples
add_subdirectory(examples)
......
......@@ -6,6 +6,9 @@ include_directories(${IDG_BIN_UTILITY_INCLUDE_DIR})
# set common include directory
include_directories(common)
# set common link libraries
set(LINK_LIBRARIES idg-util)
# add subfolders
add_subdirectory(CPU)
add_subdirectory(Hybrid)
......
project(examples-cpu)
# add subfolders
set(LINK_LIBRARIES ${LINK_LIBRARIES} idg-cpu)
add_subdirectory(Reference)
add_subdirectory(Optimized)
......@@ -8,12 +8,9 @@ set (${PROJECT_NAME}_sources
# Set build target
add_executable (${PROJECT_NAME} ${${PROJECT_NAME}_sources})
# link
set(LINK_LIRBRARIES idg-utility idg-cpu)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIRBRARIES}
${LINK_LIBRARIES}
)
# install
......
......@@ -8,12 +8,9 @@ set (${PROJECT_NAME}_sources
# Set build target
add_executable (${PROJECT_NAME} ${${PROJECT_NAME}_sources})
# link
set(LINK_LIRBRARIES idg-utility idg-cpu)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIRBRARIES}
${LINK_LIBRARIES}
)
# install
......
project(examples-cuda)
# add subfolders
set(LINK_LIBRARIES ${LINK_LIBRARIES} idg-cuda)
add_subdirectory(Generic)
......@@ -9,14 +9,9 @@ set ( ${PROJECT_NAME}_sources
add_executable (${PROJECT_NAME} ${${PROJECT_NAME}_sources}
)
# Set libraries to link
set (
LINK_LIRBRARIES idg-utility idg-cuda
)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIRBRARIES}
${LINK_LIBRARIES}
)
# Set install
......
project(examples-hybrid)
# add subfolders
if (BUILD_LIB_CPU AND BUILD_LIB_CUDA)
add_subdirectory(CUDA)
endif()
if (BUILD_LIB_CPU AND BUILD_LIB_OPENCL)
# add_subdirectory(OpenCL)
endif()
project(examples-hybrid-cuda)
# add subfolders
set(LINK_LIBRARIES ${LINK_LIBRARIES} idg-hybrid-cuda)
add_subdirectory(GenericOptimized)
......@@ -12,14 +12,9 @@ add_executable (
${${PROJECT_NAME}_sources}
)
# Set libraries to link
set (
LINK_LIRBRARIES idg-utility idg-hybrid-cuda
)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIRBRARIES}
${LINK_LIBRARIES}
)
# Set install
......
project(hybrid-opencl.x)
set (${PROJECT_NAME}_sources
main.cpp
)
# Set build target
add_executable (${PROJECT_NAME} ${${PROJECT_NAME}_sources})
# link
link_directories (${LIBRARY_OUTPUT_PATH})
set(LINK_LIRBRARIES idg-utility idg-hybrid-opencl)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIRBRARIES}
)
# install
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin/examples/cxx
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static
)
#include "idg-hybrid-opencl.h"
#include "common.h"
int main(int argc, char **argv) {
run<idg::proxy::hybrid::HybridOpenCL>();
}
project(examples-opencl)
# add subfolders
set(LINK_LIBRARIES ${LINK_LIBRARIES} idg-opencl)
add_subdirectory(Generic)
......@@ -7,14 +7,9 @@ set (${PROJECT_NAME}_sources
# Set build target
add_executable (${PROJECT_NAME} ${${PROJECT_NAME}_sources})
# link
link_directories (${LIBRARY_OUTPUT_PATH})
set(LINK_LIRBRARIES idg-utility idg-opencl)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIRBRARIES}
${LINK_LIBRARIES}
)
# install
......
......@@ -7,7 +7,7 @@
#include <vector>
#include "idg-cpu.h"
#include "idg-utility.h" // Data init routines
#include "idg-util.h" // Data init routines
using namespace std;
......
......@@ -9,11 +9,11 @@ set (${PROJECT_NAME}_sources
add_executable (${PROJECT_NAME} ${${PROJECT_NAME}_sources})
# link
set(LINK_LIRBRARIES idg-utility idg-common)
set(LINK_LIBRARIES idg-util idg-common)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIRBRARIES}
${LINK_LIBRARIES}
)
# install
......
......@@ -7,7 +7,7 @@
#include <vector>
#include "idg-cpu.h"
#include "idg-utility.h" // Data init routines
#include "idg-util.h" // Data init routines
using namespace std;
......
......@@ -6,6 +6,9 @@ include_directories(${IDG_BIN_UTILITY_INCLUDE_DIR})
# set common include directory
include_directories(common)
# set common link libraries
set(LINK_LIBRARIES idg-util idg-cpu)
# add subfolders
if (BUILD_LIB_CPU)
add_subdirectory(CPU)
......
project(tests-cpu)
# add subfolders
add_subdirectory(Reference)
add_subdirectory(Optimized)
......@@ -10,11 +10,9 @@ add_executable (${PROJECT_NAME} ${${PROJECT_NAME}_sources})
# link
link_directories (${LIBRARY_OUTPUT_PATH})
set(LINK_LIRBRARIES idg-utility idg-cpu)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIRBRARIES}
${LINK_LIBRARIES}
)
# install
......
......@@ -10,11 +10,9 @@ add_executable (${PROJECT_NAME} ${${PROJECT_NAME}_sources})
# link
link_directories (${LIBRARY_OUTPUT_PATH})
set(LINK_LIRBRARIES idg-utility idg-cpu)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIRBRARIES}
${LINK_LIBRARIES}
)
# install
......
project(tests-cuda)
# add subfolders
set(LINK_LIBRARIES ${LINK_LIBRARIES} idg-cuda)
add_subdirectory(Generic)
......@@ -11,14 +11,9 @@ add_executable (
${PROJECT_NAME} ${${PROJECT_NAME}_sources}
)
# Set libraries to link
set (
LINK_LIRBRARIES idg-utility idg-cpu idg-cuda
)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIRBRARIES}
${LINK_LIBRARIES}
)
# Set install
......@@ -33,4 +28,3 @@ install (
add_test(
NAME ${PROJECT_NAME}
COMMAND ${CMAKE_INSTALL_PREFIX}/bin/tests/cxx/${PROJECT_NAME})
)
project(tests-hybrid)
# add subfolders
if (BUILD_LIB_CPU AND BUILD_LIB_CUDA)
add_subdirectory(CUDA)
endif()
if (BUILD_LIB_CPU AND BUILD_LIB_OPENCL)
# add_subdirectory(OpenCL)
endif()
project(tests-hybrid-cuda)
# add subfolders
set(LINK_LIBRARIES ${LINK_LIBRARIES} idg-common idg-hybrid-cuda)
add_subdirectory(GenericOptimized)
......@@ -14,13 +14,9 @@ add_executable (
# Set libraries to link
link_directories (${LIBRARY_OUTPUT_PATH})
set(
LINK_LIRBRARIES idg-utility idg-cpu idg-hybrid-cuda
)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIRBRARIES}
${LINK_LIBRARIES}
)
# Set install
......@@ -35,4 +31,3 @@ install (
add_test(
NAME ${PROJECT_NAME}
COMMAND ${CMAKE_INSTALL_PREFIX}/bin/tests/cxx/${PROJECT_NAME})
)
project(test-hybrid-opencl.x)
# Set sources
set (
${PROJECT_NAME}_sources
main.cpp
)
# Set build target
add_executable (
${PROJECT_NAME} ${${PROJECT_NAME}_sources}
)
# Set libraries to link
link_directories (${LIBRARY_OUTPUT_PATH})
set(
LINK_LIRBRARIES idg-utility idg-hybrid-opencl
)
target_link_libraries (
${PROJECT_NAME}
${LINK_LIRBRARIES}
)
# Set install
install (
TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin/tests/cxx
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static
)
# Set test
add_test(
NAME ${PROJECT_NAME}
COMMAND ${CMAKE_INSTALL_PREFIX}/bin/tests/cxx/${PROJECT_NAME})
)
#include "idg-hybrid-opencl.h"
#include "../../CPU/common/common.h"
using namespace std;
int main(int argc, char *argv[])
{
// Compares to reference implementation
int info = compare_to_reference<idg::proxy::hybrid::HybridOpenCL>();
return info;
}
project(tests-opencl)
# add subfolders
set(LINK_LIBRARIES ${LINK_LIBRARIES} idg-opencl)
add_subdirectory(Generic)
......@@ -7,14 +7,9 @@ set (${PROJECT_NAME}_sources
# Set build target
add_executable (${PROJECT_NAME} ${${PROJECT_NAME}_sources})
# link
link_directories (${LIBRARY_OUTPUT_PATH})
set(LINK_LIRBRARIES idg-utility idg-cpu idg-opencl ${CMAKE_DL_LIBS})
target_link_libraries (
${PROJECT_NAME}
${LINK_LIRBRARIES}
${LINK_LIBRARIES}
)
# install
......
......@@ -7,7 +7,7 @@
using namespace std;
#include "idg-cpu.h" // Reference proxy
#include "idg-utility.h" // Data init routines
#include "idg-util.h" // Data init routines
// computes max|A[i]-B[i]| / max|B[i]|
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment