Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove glkernel-cmd #26

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 0 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,66 +32,3 @@ ToDo

ToDo

##### glkernel-cmd

Additionally to using glkernel as a library, there is a standalone command line tool to generate kernels from JSON descriptions.
The usage is as follows: ```glkernel-cmd --i {input filename} --o {output filename}```, where ```{input filename}``` is a JSON kernel description file and ```{output file}``` is a JSON file containing a kernel.

The description file must contain an entry "init-kernel" that describes the size and the number of components of the the kernel that will be generated.
It also has to contain an entry "commands", which is an array of commands that will be executed on the kernel.
For these, all glkernel commands can be used.

The naming convention for applying glkernel commands is ```"{namespace}.{function name}"```, e.g. ```"noise.uniform"``` for ```noise::uniform```.
Arguments can be passed as a JSON object, e.g. ```{ "noise.uniform": { "range_min": -1.0, "range_max": 1.0 } }``` will call ```noise::uniform(kernel, -1.0, 1.0)```.

Here is an input JSON for generating 4 samples using golden point set sampling, scaling them to [-0.5, 0.5] and shuffling them randomly:
```json
{
"init-kernel": {
"components": 2,
"width": 4,
"height": 1,
"depth": 1
},

"commands": [
{ "sample.golden_point_set": { } },
{ "scale.range": { "range_to_lower": -0.5, "range_to_upper": 0.5 } },
{ "shuffle.random": { } }
]
}
```

The generated output JSON will look like this:
```json
{
"kernel": [
[
[
[
-0.286392,
-0.437815
],
[
-0.140494,
0.180219
],
[
0.0955744,
-0.201747
],
[
0.47754,
0.416287
]
]
]
],
"size": {
"depth": 1,
"height": 1,
"width": 4
}
}

```
1 change: 1 addition & 0 deletions cmake/ClangTidy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function(perform_clang_tidy check_target target)
set_target_properties(${check_target}
PROPERTIES
FOLDER "Maintenance"
EXCLUDE_FROM_DEFAULT_BUILD 1
)

add_dependencies(${check_target} ${target})
Expand Down
4 changes: 1 addition & 3 deletions cmake/Cppcheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ function(perform_cppcheck check_target target)
COMMAND
${cppcheck_EXECUTABLE}
"$<$<BOOL:${includes}>:-I$<JOIN:${includes},\t-I>>"
--check-config
--enable=warning,performance,portability,information,missingInclude
--quiet
--enable=all
--std=c++11
--verbose
--suppress=missingIncludeSystem
Expand Down
8 changes: 8 additions & 0 deletions cmake/HealthCheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ function(perform_health_checks target)
set_target_properties(check-all
PROPERTIES
FOLDER "Maintenance"
EXCLUDE_FROM_DEFAULT_BUILD 1
)
endif()

add_custom_target(check-${target})

set_target_properties(check-${target}
PROPERTIES
FOLDER "Maintenance"
EXCLUDE_FROM_DEFAULT_BUILD 1
)

if (OPTION_CPPCHECK_ENABLED)
perform_cppcheck(cppcheck-${target} ${target} ${ARGN})
add_dependencies(check-${target} cppcheck-${target})
Expand Down Expand Up @@ -92,5 +99,6 @@ function(add_check_template_target current_template_sha)
set_target_properties(check-template
PROPERTIES
FOLDER "Maintenance"
EXCLUDE_FROM_DEFAULT_BUILD 1
)
endfunction()
11 changes: 7 additions & 4 deletions source/examples/sample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ else()
message(STATUS "Example ${target}")
endif()

if (NOT OPENMP_FOUND)
if (NOT OPENMP_FOUND AND NOT OpenMP_FOUND)
message("Loop parallelization in ${target} skipped: OpenMP not found")
set(OpenMP_SUPPORTED FALSE)
else()
set(OpenMP_SUPPORTED TRUE)
endif()


Expand Down Expand Up @@ -107,7 +110,7 @@ target_link_libraries(${target}

target_compile_definitions(${target}
PRIVATE
$<$<BOOL:"${OPENMP_FOUND}">:USE_OPENMP>
$<$<BOOL:${OpenMP_SUPPORTED}>:USE_OPENMP>
${DEFAULT_COMPILE_DEFINITIONS}
)

Expand All @@ -118,7 +121,7 @@ target_compile_definitions(${target}

target_compile_options(${target}
PRIVATE
$<$<BOOL:"${OPENMP_FOUND}">:${OpenMP_CXX_FLAGS}>
$<$<BOOL:${OpenMP_SUPPORTED}>:${OpenMP_CXX_FLAGS}>
${DEFAULT_COMPILE_OPTIONS}
)

Expand All @@ -130,7 +133,7 @@ target_compile_options(${target}
target_link_libraries(${target}
PRIVATE
${DEFAULT_LINKER_OPTIONS}
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:$<$<BOOL:"${OPENMP_FOUND}">:${OpenMP_CXX_FLAGS}>>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:$<$<BOOL:${OpenMP_SUPPORTED}>:${OpenMP_CXX_FLAGS}>>
)


Expand Down
11 changes: 7 additions & 4 deletions source/tests/glkernel-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ find_package(OpenMP QUIET)
set(target glkernel-test)
message(STATUS "Test ${target}")

if (NOT OPENMP_FOUND)
if (NOT OPENMP_FOUND AND NOT OpenMP_FOUND)
message("Loop parallelization in ${target} skipped: OpenMP not found")
set(OpenMP_SUPPORTED FALSE)
else()
set(OpenMP_SUPPORTED TRUE)
endif()


Expand Down Expand Up @@ -92,7 +95,7 @@ target_link_libraries(${target}
target_compile_definitions(${target}
PRIVATE
GLM_FORCE_RADIANS
$<$<BOOL:"${OPENMP_FOUND}">:USE_OPENMP>
$<$<BOOL:${OpenMP_SUPPORTED}>:USE_OPENMP>
${DEFAULT_COMPILE_DEFINITIONS}
)

Expand All @@ -103,7 +106,7 @@ target_compile_definitions(${target}

target_compile_options(${target}
PRIVATE
$<$<BOOL:"${OPENMP_FOUND}">:${OpenMP_CXX_FLAGS}>
$<$<BOOL:${OpenMP_SUPPORTED}>:${OpenMP_CXX_FLAGS}>
${DEFAULT_COMPILE_OPTIONS}
)

Expand All @@ -115,5 +118,5 @@ target_compile_options(${target}
target_link_libraries(${target}
PRIVATE
${DEFAULT_LINKER_OPTIONS}
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:$<$<BOOL:"${OPENMP_FOUND}">:${OpenMP_CXX_FLAGS}>>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:$<$<BOOL:${OpenMP_SUPPORTED}>:${OpenMP_CXX_FLAGS}>>
)
1 change: 0 additions & 1 deletion source/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ if(NOT OPTION_BUILD_TOOLS)
endif()

# Example applications
add_subdirectory(glkernel-cmd)
129 changes: 0 additions & 129 deletions source/tools/glkernel-cmd/CMakeLists.txt

This file was deleted.

Loading