-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from CNugteren/development
Various improvements
- Loading branch information
Showing
16 changed files
with
353 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,86 @@ | ||
# ######################################################################## | ||
# Copyright 2013 Advanced Micro Devices, Inc. | ||
# ================================================================================================== | ||
# This file is part of the CLTune project, which loosely follows the Google C++ styleguide and uses | ||
# a tab-size of two spaces and a max-width of 100 characters per line. | ||
# | ||
# Author: [email protected] (Cedric Nugteren) | ||
# | ||
# Defines the following variables: | ||
# OPENCL_FOUND Boolean holding whether or not the OpenCL library was found | ||
# OPENCL_INCLUDE_DIRS The OpenCL include directory | ||
# OPENCL_LIBRARIES The OpenCL library | ||
# | ||
# In case OpenCL is not installed in the default directory, set the OPENCL_ROOT variable to point to | ||
# the root of OpenCL, such that 'OpenCL/cl.h' or 'CL/cl.h' can be found in $OPENCL_ROOT/include. | ||
# This can either be done using an environmental variable (e.g. export OPENCL_ROOT=/path/to/opencl) | ||
# or using a CMake variable (e.g. cmake -DOPENCL_ROOT=/path/to/opencl ..). | ||
# | ||
# -------------------------------------------------------------------------------------------------- | ||
# | ||
# Copyright 2014 SURFsara | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ######################################################################## | ||
|
||
|
||
# Locate an OpenCL implementation. | ||
# Currently supports AMD APP SDK (http://developer.amd.com/sdks/AMDAPPSDK/Pages/default.aspx/) | ||
# | ||
# Defines the following variables: | ||
# | ||
# OPENCL_FOUND - Found the OPENCL framework | ||
# OPENCL_INCLUDE_DIRS - Include directories | ||
# | ||
# Also defines the library variables below as normal | ||
# variables. These contain debug/optimized keywords when | ||
# a debugging library is found. | ||
# | ||
# OPENCL_LIBRARIES - libopencl | ||
# | ||
# Accepts the following variables as input: | ||
# | ||
# OPENCL_ROOT - (as a CMake or environment variable) | ||
# The root directory of the OpenCL implementation found | ||
# | ||
# FIND_LIBRARY_USE_LIB64_PATHS - Global property that controls whether findOpenCL should search for | ||
# 64bit or 32bit libs | ||
#----------------------- | ||
# Example Usage: | ||
# | ||
# find_package(OPENCL REQUIRED) | ||
# include_directories(${OPENCL_INCLUDE_DIRS}) | ||
# | ||
# add_executable(foo foo.cc) | ||
# target_link_libraries(foo ${OPENCL_LIBRARIES}) | ||
# | ||
#----------------------- | ||
# ================================================================================================== | ||
|
||
find_path(OPENCL_INCLUDE_DIRS | ||
NAMES OpenCL/cl.h CL/cl.h | ||
HINTS | ||
${OPENCL_ROOT}/include | ||
$ENV{AMDAPPSDKROOT}/include | ||
$ENV{CUDA_PATH}/include | ||
PATHS | ||
/usr/include | ||
/usr/local/include | ||
/usr/local/cuda/include | ||
/opt/cuda/include | ||
DOC "OpenCL header file path" | ||
# Sets the possible install locations | ||
set(OPENCL_HINTS | ||
${OPENCL_ROOT} | ||
$ENV{OPENCL_ROOT} | ||
$ENV{AMDAPPSDKROOT} | ||
$ENV{CUDA_PATH} | ||
$ENV{INTELOCLSDKROOT} | ||
$ENV{NVSDKCOMPUTE_ROOT} | ||
$ENV{ATISTREAMSDKROOT} | ||
) | ||
set(OPENCL_PATHS | ||
/usr/local/cuda | ||
/opt/cuda | ||
/usr | ||
/usr/local | ||
) | ||
mark_as_advanced( OPENCL_INCLUDE_DIRS ) | ||
|
||
# Search for 64bit libs if FIND_LIBRARY_USE_LIB64_PATHS is set to true in the global environment, 32bit libs else | ||
get_property( LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ) | ||
# Finds the include directories | ||
find_path(OPENCL_INCLUDE_DIRS | ||
NAMES OpenCL/cl.h CL/cl.h | ||
HINTS ${OPENCL_HINTS} | ||
PATH_SUFFIXES include OpenCL/common/inc inc include/x86_64 include/x64 | ||
PATHS ${OPENCL_PATHS} | ||
DOC "OpenCL include header OpenCL/cl.h or CL/cl.h" | ||
) | ||
mark_as_advanced(OPENCL_INCLUDE_DIRS) | ||
|
||
if( LIB64 ) | ||
find_library( OPENCL_LIBRARIES | ||
NAMES OpenCL | ||
HINTS | ||
${OPENCL_ROOT}/lib | ||
$ENV{AMDAPPSDKROOT}/lib | ||
$ENV{CUDA_PATH}/lib | ||
DOC "OpenCL dynamic library path" | ||
PATH_SUFFIXES x86_64 x64 | ||
PATHS | ||
/usr/lib | ||
/usr/local/cuda/lib | ||
/opt/cuda/lib | ||
) | ||
else( ) | ||
find_library( OPENCL_LIBRARIES | ||
NAMES OpenCL | ||
HINTS | ||
${OPENCL_ROOT}/lib | ||
$ENV{AMDAPPSDKROOT}/lib | ||
$ENV{CUDA_PATH}/lib | ||
DOC "OpenCL dynamic library path" | ||
PATH_SUFFIXES x86 Win32 | ||
PATHS | ||
/usr/lib | ||
/usr/local/cuda/lib | ||
/opt/cuda/lib | ||
) | ||
endif( ) | ||
mark_as_advanced( OPENCL_LIBRARIES ) | ||
# Finds the library | ||
find_library(OPENCL_LIBRARIES | ||
NAMES OpenCL | ||
HINTS ${OPENCL_HINTS} | ||
PATH_SUFFIXES lib lib64 lib/x86_64 lib/x64 lib/x86 lib/Win32 OpenCL/common/lib/x64 | ||
PATHS ${OPENCL_PATHS} | ||
DOC "OpenCL library" | ||
) | ||
mark_as_advanced(OPENCL_LIBRARIES) | ||
|
||
include( FindPackageHandleStandardArgs ) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS( OPENCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS ) | ||
# ================================================================================================== | ||
|
||
if( NOT OPENCL_FOUND ) | ||
message( STATUS "FindOpenCL looked for libraries named: OpenCL" ) | ||
# Notification messages | ||
if(NOT OPENCL_INCLUDE_DIRS) | ||
message(STATUS "Could NOT find 'OpenCL/cl.h' or 'CL/cl.h', install OpenCL or set OPENCL_ROOT") | ||
endif() | ||
if(NOT OPENCL_LIBRARIES) | ||
message(STATUS "Could NOT find OpenCL library, install it or set OPENCL_ROOT") | ||
endif() | ||
|
||
# Determines whether or not OpenCL was found | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(OpenCL DEFAULT_MSG OPENCL_INCLUDE_DIRS OPENCL_LIBRARIES) | ||
|
||
# ================================================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.