Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
caddies
caddies-api
Commits
43b2f030
Commit
43b2f030
authored
Jul 14, 2016
by
mjg226
Browse files
Adapted the cmake, and common files/folders, to separate out the different device common files.
parent
7c31be67
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1871 additions
and
1974 deletions
+1871
-1974
CMakeLists.txt
CMakeLists.txt
+34
-4
impls/common/CPU/Functions.hpp
impls/common/CPU/Functions.hpp
+573
-573
impls/common/CPU/Options.hpp
impls/common/CPU/Options.hpp
+50
-50
impls/common/GPU/Options.hpp
impls/common/GPU/Options.hpp
+77
-77
impls/common/GPU/caexec2D.hpp
impls/common/GPU/caexec2D.hpp
+1136
-1136
impls/square-cell/vn-neighbours/1-levels/opencl/extra/CAAPI_impl.cmake
...cell/vn-neighbours/1-levels/opencl/extra/CAAPI_impl.cmake
+1
-0
impls/square-cell/vn-neighbours/1-levels/openmp/Functions.hpp
...s/square-cell/vn-neighbours/1-levels/openmp/Functions.hpp
+0
-32
impls/square-cell/vn-neighbours/1-levels/openmp/Options.hpp
impls/square-cell/vn-neighbours/1-levels/openmp/Options.hpp
+0
-35
impls/square-cell/vn-neighbours/1-levels/simple/Functions.hpp
...s/square-cell/vn-neighbours/1-levels/simple/Functions.hpp
+0
-32
impls/square-cell/vn-neighbours/1-levels/simple/Options.hpp
impls/square-cell/vn-neighbours/1-levels/simple/Options.hpp
+0
-35
No files found.
CMakeLists.txt
View file @
43b2f030
...
...
@@ -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 ##########################
...
...
impls/common/Functions.hpp
→
impls/common/
CPU/
Functions.hpp
View file @
43b2f030
This diff is collapsed.
Click to expand it.
impls/common/Options.hpp
→
impls/common/
CPU/
Options.hpp
View file @
43b2f030
/*
Copyright (c) 2013 Centre for Water Systems,
University of Exeter
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 Michele Guidolin, University of Exeter,
//! contact: m.guidolin [at] exeter.ac.uk
//! \date 2012-07
#include"Common.hpp"
namespace
CA
{
//! Return a list of implementation specific Options
inline
Options
options
()
{
return
Options
();
}
}
#endif// _CA_BASETYPES_HPP_
/*
Copyright (c) 2013 Centre for Water Systems,
University of Exeter
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 Michele Guidolin, University of Exeter,
//! contact: m.guidolin [at] exeter.ac.uk
//! \date 2012-07
#include"Common.hpp"
namespace
CA
{
//! Return a list of implementation specific Options
inline
Options
options
()
{
return
Options
();
}
}
#endif// _CA_BASETYPES_HPP_
impls/
square-cell/vn-neighbours/1-levels/opencl
/Options.hpp
→
impls/
common/GPU
/Options.hpp
View file @
43b2f030
/*
Copyright (c) 2013 Centre for Water Systems,
University of Exeter
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 Michele Guidolin, University of Exeter,
//! contact: m.guidolin [at] exeter.ac.uk
//! \date 2012-07
#include"Common.hpp"
namespace
CA
{
//! Return a list of implementation specific Options
inline
Options
options
()
{
Options
options
;
// Add the optional arguments. The tag start from 1000 for safety
// reason.
CA
::
Unsigned
na
=
1000
;
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"config-file"
,
"Select the OpenCL config CSV file."
,
""
,
true
,
true
,
false
));
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"device-type"
,
"Select the OpenCL device type (CPU/GPU)."
,
"GPU"
,
true
,
true
,
false
));
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"device-number"
,
"Select the OpenCL device from many available."
,
"0"
,
true
,
true
,
false
));
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"platform-name"
,
"Select the OpenCL specific platform"
,
""
,
true
,
true
,
false
));
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"warp-size"
,
"Select the OpenCL warp size (32)."
,
""
,
true
,
true
,
false
));
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"out-of-order"
,
"Uses an out of order execution."
,
""
,
true
,
false
,
false
));
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"build-info"
,
"Show in standard error the OpenCl buidl info"
,
""
,
true
,
false
,
false
));
return
options
;
}
}
#endif// _CA_BASETYPES_HPP_
/*
Copyright (c) 2013 Centre for Water Systems,
University of Exeter
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 Michele Guidolin, University of Exeter,
//! contact: m.guidolin [at] exeter.ac.uk
//! \date 2012-07
#include"Common.hpp"
namespace
CA
{
//! Return a list of implementation specific Options
inline
Options
options
()
{
Options
options
;
// Add the optional arguments. The tag start from 1000 for safety
// reason.
CA
::
Unsigned
na
=
1000
;
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"config-file"
,
"Select the OpenCL config CSV file."
,
""
,
true
,
true
,
false
));
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"device-type"
,
"Select the OpenCL device type (CPU/GPU)."
,
"GPU"
,
true
,
true
,
false
));
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"device-number"
,
"Select the OpenCL device from many available."
,
"0"
,
true
,
true
,
false
));
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"platform-name"
,
"Select the OpenCL specific platform"
,
""
,
true
,
true
,
false
));
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"warp-size"
,
"Select the OpenCL warp size (32)."
,
""
,
true
,
true
,
false
));
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"out-of-order"
,
"Uses an out of order execution."
,
""
,
true
,
false
,
false
));
options
.
push_back
(
new
Arguments
::
Arg
(
na
++
,
"build-info"
,
"Show in standard error the OpenCl buidl info"
,
""
,
true
,
false
,
false
));
return
options
;
}
}
#endif// _CA_BASETYPES_HPP_
impls/
square-cell/vn-neighbours/1-levels/opencl
/caexec2D.hpp
→
impls/
common/GPU
/caexec2D.hpp
View file @
43b2f030
This diff is collapsed.
Click to expand it.
impls/square-cell/vn-neighbours/1-levels/opencl/extra/CAAPI_impl.cmake
View file @
43b2f030
...
...
@@ -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
...
...
impls/square-cell/vn-neighbours/1-levels/openmp/Functions.hpp
deleted
100644 → 0
View file @
7c31be67
/*
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"
impls/square-cell/vn-neighbours/1-levels/openmp/Options.hpp
deleted
100644 → 0
View file @
7c31be67
/*
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"
impls/square-cell/vn-neighbours/1-levels/simple/Functions.hpp
deleted
100644 → 0
View file @
7c31be67
/*
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"
impls/square-cell/vn-neighbours/1-levels/simple/Options.hpp
deleted
100644 → 0
View file @
7c31be67
/*
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"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment