Skip to content
Merged
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
33 changes: 33 additions & 0 deletions CMakeModules/FindBoostCompute.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Downloads and builds the Boost Compute library from github.com
# Defines the following variables
# * BoostCompute_FOUND Flag for Boost Compute
# * BoostCompute_INCLUDE_DIR Location of the Boost Compute headers

# Look a directory above for the Boost Compute folder
FIND_PATH( BoostCompute_SOURCE_DIR
NAMES include/boost/compute.hpp
PATH_SUFFIXES compute BoostCompute
DOC "Location of the Boost Compute source directory"
PATHS ${CMAKE_SOURCE_DIR}/..
${CMAKE_SOURCE_DIR}/../..
/usr/local)

FIND_PATH( BoostCompute_INCLUDE_DIR
NAMES boost/compute.hpp
DOC "Location of the Boost Compute include directory."
PATHS ${BoostCompute_SOURCE_DIR}/include)

IF(BoostCompute_INCLUDE_DIR AND BoostCompute_SOURCE_DIR)
SET( BoostCompute_FOUND ON CACHE BOOL "BoostCompute Found" )
ELSE()
SET( BoostCompute_FOUND OFF CACHE BOOL "BoostCompute Found" )
ENDIF()

IF(NOT BoostCompute_FOUND)
MESSAGE(FATAL_ERROR, "Boost.Compute not found! Clone Boost.Compute from https://github.com/kylelutz/compute.git")
ENDIF(NOT BoostCompute_FOUND)

MARK_AS_ADVANCED(
BoostCompute_FOUND
BoostCompute_INCLUDE_DIR
)
93 changes: 93 additions & 0 deletions CMakeModules/FindCLBLAS.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# - Find clBLAS, AMD's OpenCL BLAS library

# This script defines the standard variables
# CLBLAS_FOUND - Whether or not clBLAS was located
# CLBLAS_INCLUDE_DIRS - All include directories for clBLAS headers
# CLBLAS_LIBRARIES - All libraries for clBLAS
#
# This script also creates a few non-standard variables that may be useful
# in your project:
#
# CLBLAS_SOURCE_DIR - The location of the clBLAS src directory, if found.
# CLBLAS_PACKAGE_DIR - The location of the clBLAS package directory, if found.
#
# If your clBLAS installation is not in a standard installation directory, you
# may provide a hint to where it may be found. Simply set the value CLBLAS_ROOT
# to the directory containing 'include/clBLAS.h" prior to calling this script.
#
#=============================================================================
# Copyright 2014 Brian Kloppenborg
#
# 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
#
# 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.
#=============================================================================

# Find packages on which clBLAS depends
find_package(OpenCL REQUIRED)

# Set the CLBLAS_ROOT_DIR relative to the current directory.
IF(NOT DEFINED ${CLBLAS_ROOT_DIR})
LIST(APPEND CLBLAS_ROOT_DIR ${CMAKE_SOURCE_DIR}/.. ${CMAKE_SOURCE_DIR}/../..)
ENDIF()

FIND_PATH(CLBLAS_SOURCE_DIR
NAMES src/clBlas.h src/clAmdBlas.h
PATH_SUFFIXES clblas clBLAS clBlas CLBLAS
DOC "Location of the clBLAS source directory"
HINTS ${CLBLAS_ROOT_DIR}
NO_DEFAULT_PATH)

FIND_PATH(CLBLAS_PACKAGE_DIR
NAMES bin include lib64
PATH_SUFFIXES build/package
DOC "Location of the clBLAS install/package directory."
HINTS ${CLBLAS_SOURCE_DIR}
NO_DEFAULT_PATH)

FIND_PATH(_CLBLAS_INCLUDE_DIR
NAMES clBLAS.h
DOC "Location of the clBLAS include directory."
PATH_SUFFIXES include package/include
HINTS /usr/local
${CLBLAS_PACKAGE_DIR})

FIND_PATH(CLBLAS_LIBRARY_DIR
NAMES libclBLAS${CMAKE_SHARED_LIBRARY_SUFFIX}
DOC "Location of the clBLAS library"
PATH_SUFFIXES lib64 package/lib64 lib64/import package/lib64/import
HINTS ${CLBLAS_PACKAGE_DIR})

FIND_LIBRARY(_CLBLAS_LIBRARY
NAMES clBLAS
DOC "Library files"
PATH_SUFFIXES lib lib64 package/lib64 lib64/import package/lib64/import
HINTS /usr/local
${CLBLAS_PACKAGE_DIR})

# Set up the includes and library directories
SET(CLBLAS_LIBRARY ${_CLBLAS_LIBRARY})
SET(CLBLAS_INCLUDE_DIRS ${_CLBLAS_INCLUDE_DIR} ${OPENCL_CL_INCLUDE_DIRS})
SET(CLBLAS_LIBRARIES ${_CLBLAS_LIBRARY})
SET(CLBLAS_SOURCE_DIR ${CLBLAS_SOURCE_DIR}
CACHE PATH "Path for clBLAS source, if found")
SET(CLBLAS_PACKAGE_DIR ${CLBLAS_PACKAGE_DIR}
CACHE PATH "Path for clBLAS's packaging directory, if found")
SET(CLBLAS_LIBRARY_DIR ${CLBLAS_LIBRARY_DIR}
CACHE PATH "Path for clBLAS's packaging library directory, if found")

# handle the QUIETLY and REQUIRED arguments and set CLBLAS_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE (FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CLBLAS DEFAULT_MSG CLBLAS_LIBRARY
CLBLAS_INCLUDE_DIRS CLBLAS_LIBRARIES)
MARK_AS_ADVANCED(CLBLAS_FOUND CLBLAS_PACKAGE_DIR CLBLAS_INCLUDE_DIRS
CLBLAS_LIBRARY_DIR CLBLAS_LIBRARIES)
78 changes: 78 additions & 0 deletions CMakeModules/FindclFFT.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# - Find clFFT, AMD's OpenCL FFT library

# This script defines the following variables:
# CLFFT_INCLUDE_DIRS - Location of clFFT's include directory.
# CLFFT_LIBRARIES - Location of clFFT's libraries
# CLFFT_FOUND - True if clFFT has been located
#
# If your clFFT installation is not in a standard installation directory, you
# may provide a hint to where it may be found. Simply set the value CLFFT_ROOT
# to the directory containing 'include/clFFT.h" prior to calling this script.
#
# By default this script will attempt to find the 32-bit version of clFFT.
# If you desire to use the 64-bit version instead, set
# set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
# prior to calling this script.
#
#=============================================================================
# Copyright 2014 Brian Kloppenborg
#
# 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
#
# 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.
#=============================================================================

IF(CLFFT_INCLUDE_DIRS)
# Already in cache, be silent
set (CLFFT_FIND_QUIETLY TRUE)
ENDIF (CLFFT_INCLUDE_DIRS)

FIND_PATH(CLFFT_SOURCE_DIR
NAMES src/include/clFFT.h
HINTS "${CMAKE_SOURCE_DIR}/clFFT"
"${CMAKE_SOURCE_DIR}/../clFFT"
"${CMAKE_SOURCE_DIR}/../../clFFT"
DOC "clFFT source directory.")

FIND_PATH(CLFFT_BUILD_DIR
NAMES ./install_manifest.txt
HINTS "${CLFFT_SOURCE_DIR}/build"
"${CLFFT_SOURCE_DIR}/src/build"
DOC "clFFT build directory.")

FIND_PATH(CLFFT_ROOT_DIR
NAMES include/clFFT.h
HINTS "$ENV{CLFFT_ROOT}"
"${CMAKE_SOURCE_DIR}/.."
"${CMAKE_SOURCE_DIR}/../.."
"${CLFFT_BUILD_DIR}/package"
"${CMAKE_INSTALL_PREFIX}"
DOC "clFFT root directory.")

FIND_PATH(_CLFFT_INCLUDE_DIRS
NAMES clFFT.h
HINTS "${CLFFT_ROOT_DIR}/include"
DOC "clFFT Include directory")

FIND_LIBRARY(_CLFFT_LIBRARY
NAMES clFFT
HINTS "${CLFFT_ROOT_DIR}/lib64"
"${CLFFT_ROOT_DIR}/lib64/import"
"${CMAKE_INSTALL_PREFIX}")

SET(CLFFT_INCLUDE_DIRS ${_CLFFT_INCLUDE_DIRS})
SET(CLFFT_LIBRARIES ${_CLFFT_LIBRARY})

# handle the QUIETLY and REQUIRED arguments and set CLFFT_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE (FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CLFFT DEFAULT_MSG CLFFT_LIBRARIES CLFFT_INCLUDE_DIRS)
MARK_AS_ADVANCED(CLFFT_LIBRARIES CLFFT_INCLUDE_DIRS)
61 changes: 0 additions & 61 deletions CMakeModules/build_boost_compute.cmake

This file was deleted.

39 changes: 0 additions & 39 deletions CMakeModules/build_clBLAS.cmake

This file was deleted.

39 changes: 0 additions & 39 deletions CMakeModules/build_clFFT.cmake

This file was deleted.

Loading