Commit 43b2f030 authored by mjg226's avatar mjg226
Browse files

Adapted the cmake, and common files/folders, to separate out the different device common files.

parent 7c31be67
......@@ -112,13 +112,16 @@ set(CAAPI_SOURCES)
set(CAAPI_CACOMMON)
set(CAAPI_CAHEADERS)
set(CAAPI_COMMON_FOLDER "/impls/common/")
# From common directory
CAAPI_add_source_dir(impls\\\\common "${CMAKE_CURRENT_SOURCE_DIR}/impls/common/*.hpp" CAAPI_HEADERS)
CAAPI_add_source_dir(impls\\\\common "${CMAKE_CURRENT_SOURCE_DIR}/impls/common/*.cpp" CAAPI_SOURCES)
CAAPI_add_source_dir(impls\\\\common "${CMAKE_CURRENT_SOURCE_DIR}/impls/common/*.ca" CAAPI_CACOMMON)
CAAPI_add_source_dir(impls\\\\common "${CMAKE_CURRENT_SOURCE_DIR}${CAAPI_COMMON_FOLDER}*.hpp" CAAPI_HEADERS)
CAAPI_add_source_dir(impls\\\\common "${CMAKE_CURRENT_SOURCE_DIR}${CAAPI_COMMON_FOLDER}*.cpp" CAAPI_SOURCES)
CAAPI_add_source_dir(impls\\\\common "${CMAKE_CURRENT_SOURCE_DIR}${CAAPI_COMMON_FOLDER}*.ca" CAAPI_CACOMMON)
# Add the needed directories into the compilation
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/impls/common/")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}${CAAPI_COMMON_FOLDER}")
########################## INSTALL ##########################
......@@ -283,6 +286,33 @@ add_custom_target(caapi_do_impl_headers ALL DEPENDS ${CAAPI_CAHEADERS} ${CAAPI_H
# Add the needed directories into the compilation
include_directories(${CAAPI_IMPL_INCLUDE_DIRS})
########################## CAPI DEVICE common files ##########################
#message(STATUS "${CAAPI_DEVICE}")
if(NOT DEFINED CAAPI_DEVICE)
message(STATUS "Device: CPU")
set(CAAPI_DEVICE_COMMON_FOLDER "${CAAPI_COMMON_FOLDER}CPU/")
elseif(CAAPI_DEVICE STREQUAL "GPU")
set(CAAPI_DEVICE_COMMON_FOLDER "${CAAPI_COMMON_FOLDER}GPU/")
message(STATUS "Device: GPU")
else()
message(STATUS "Device: UNKNOWN")
endif()
if(DEFINED CAAPI_DEVICE_COMMON_FOLDER)
CAAPI_add_source_dir(impls\\\\common "${CMAKE_CURRENT_SOURCE_DIR}${CAAPI_DEVICE_COMMON_FOLDER}*.hpp" CAAPI_HEADERS)
CAAPI_add_source_dir(impls\\\\common "${CMAKE_CURRENT_SOURCE_DIR}${CAAPI_DEVICE_COMMON_FOLDER}*.cpp" CAAPI_SOURCES)
CAAPI_add_source_dir(impls\\\\common "${CMAKE_CURRENT_SOURCE_DIR}${CAAPI_DEVICE_COMMON_FOLDER}*.ca" CAAPI_CACOMMON)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}${CAAPI_DEVICE_COMMON_FOLDER}")
endif()
########################## CAPI APPS ##########################
......
......@@ -85,6 +85,7 @@ endif()
# Definitions, which are used to take advantage of different code segments,
# in order to make this GPU compatible
set(CAAPI_DEVICE "GPU")
add_definitions(-DCA2D_GPU)
# Chose between to use event or not to use event (event has tendency
......
/*
Copyright (c) 2016 EAWAG - Swiss Federal Institute of Water Science
and Technology
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
//! \file ca.hpp
//! Contains the classes and methods to make CA functions.
//! \author Luís de Sousa, EAWAG,
//! contact: luis.desousa [at] eawag.ch
//! \date 2016-03
#include "../../../../common/Functions.hpp"
/*
Copyright (c) 2016 EAWAG - Swiss Federal Institute of Water Science
and Technology
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef _CA_OPTIONS_HPP_
#define _CA_OPTIONS_HPP_
//! \file Options.hpp
//! Contains the list of implementation specific Options
//! \author Luís de Sousa, EAWAG,
//! contact: luis.desousa [at] eawag.ch
//! \date 2016-03
#include"../../../common/Options.hpp"
/*
Copyright (c) 2016 EAWAG - Swiss Federal Institute of Water Science
and Technology
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
//! \file ca.hpp
//! Contains the classes and methods to make CA functions.
//! \author Luís de Sousa, EAWAG,
//! contact: luis.desousa [at] eawag.ch
//! \date 2016-03
#include "../../../../common/Functions.hpp"
/*
Copyright (c) 2016 EAWAG - Swiss Federal Institute of Water Science
and Technology
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef _CA_OPTIONS_HPP_
#define _CA_OPTIONS_HPP_
//! \file Options.hpp
//! Contains the list of implementation specific Options
//! \author Luís de Sousa, EAWAG,
//! contact: luis.desousa [at] eawag.ch
//! \date 2016-03
#include"../../../common/Options.hpp"
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