Permalink
Browse files

added matrix benchmark + copyright update

  • Loading branch information...
1 parent d7dd700 commit d1083e254c17f242599bc7e007bf23b82e38c426 @Neverlord Neverlord committed Mar 21, 2013
View
@@ -4,15 +4,18 @@ project (benchmarks)
set (CMAKE_CXX_FLAGS_RELEASE "-O3")
set (CMAKE_BUILD_TYPE RELEASE)
+set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
+
add_definitions (-DNDEBUG)
+add_definitions (-DCPPA_OPENCL)
if ( "${DISABLED_BENCHMARKS}" MATCHES "cppa"
AND "${DISABLED_BENCHMARKS}" MATCHES "theron")
else ()
# check if the user provided CXXFLAGS on the command line
if ("${CMAKE_CXX_FLAGS}" STREQUAL "")
set (CXXFLAGS_PROVIDED false)
- set (CMAKE_CXX_FLAGS "-std=c++11 -Wextra -Wall -pedantic")
+ set (CMAKE_CXX_FLAGS "-std=c++11 -Wextra -Wall -pedantic ")
else ()
set (CXXFLAGS_PROVIDED true)
endif ()
@@ -43,6 +46,17 @@ else ()
endif ()
endif ()
+if ("${DISABLED_BENCHMARKS}" MATCHES "cppa")
+ # OpenCL only used by cppa benchmarks
+else ()
+ if (ENABLE_OPENCL)
+ find_package(OPENCL REQUIRED)
+ set(LD_FLAGS ${LD_FLAGS} ${OPENCL_LIBRARIES})
+ set(INCLUDE_DIRS ${INCLUDE_DIRS} ${OPENCL_INCLUDE_DIR})
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCPPA_OPENCL")
+ endif (ENABLE_OPENCL)
+endif ()
+
set (CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
set (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set (PROJECT_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/.)
View
@@ -0,0 +1,55 @@
+# - Try to find OpenCL
+# Once done this will define
+#
+# OPENCL_FOUND - system has OpenCL
+# OPENCL_INCLUDE_DIR - the OpenCL include directory
+# OPENCL_LIBRARIES - link these to use OpenCL
+#
+# WIN32 should work, but is untested
+
+IF (WIN32)
+
+ FIND_PATH(OPENCL_INCLUDE_DIR CL/cl.h )
+
+ # TODO this is only a hack assuming the 64 bit library will
+ # not be found on 32 bit system
+ FIND_LIBRARY(OPENCL_LIBRARIES opencl ) #used to say opencl64
+ IF( OPENCL_LIBRARIES )
+ FIND_LIBRARY(OPENCL_LIBRARIES opencl ) #used to say opencl32
+ ENDIF( OPENCL_LIBRARIES )
+
+ELSE (WIN32)
+
+ # Unix style platforms
+ # We also search for OpenCL in the NVIDIA GPU SDK default location
+ #SET(OPENCL_INCLUDE_DIR "$ENV{OPENCL_HOME}/common/inc"
+ # CACHE PATH "path to Opencl Include files")
+
+ #message(***** OPENCL_INCLUDE_DIR: "${OPENCL_INCLUDE_DIR}" ********)
+
+ # does not work. WHY?
+ #SET(inc $ENV{CUDA_LOCAL}/../OpenCL/common/inc /usr/include)
+ #FIND_PATH(OPENCL_INCLUDE_DIR CL/cl.h PATHS ${inc} /usr/include )
+
+ message("lib path: $ENV{LD_LIBRARY_PATH}")
+ #FIND_LIBRARY(OPENCL_LIBRARIES OpenCL $ENV{LD_LIBRARY_PATH})
+ FIND_LIBRARY(OPENCL_LIBRARIES OpenCL ENV LD_LIBRARY_PATH)
+ message("==============")
+ message("opencl_libraries: ${OPENCL_LIBRARIES}")
+
+ #message(***** OPENCL ENV: "$ENV{GPU_SDK}" ********)
+
+#~/NVIDIA_GPU_Computing_SDK/OpenCL/common/inc/
+
+
+ENDIF (WIN32)
+
+SET( OPENCL_FOUND "NO" )
+IF(OPENCL_LIBRARIES )
+ SET( OPENCL_FOUND "YES" )
+ENDIF(OPENCL_LIBRARIES)
+
+MARK_AS_ADVANCED(
+ OPENCL_INCLUDE_DIR
+)
+
View
@@ -1 +1,2 @@
// ADD PREDEFINED MACROS HERE!
+CPPA_OPENCL
View
@@ -19,3 +19,4 @@ scala/mailbox_performance.scala
scala/matching.scala
scala/mixed_case.scala
scala/utility.scala
+cppa/matrix.cpp
View
@@ -21,6 +21,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--no-erlang exclude benchmarks for Erlang
--no-go exclude benchmarks for Go
--no-theron exclude benchmarks for Theron
+ --with-opencl build libcppa with OpenCL support
Compiler Options:
--with-clang=PATH path to clang++ executable
@@ -131,6 +132,9 @@ while [ $# -ne 0 ]; do
--with-theron=*)
append_cache_entry THERON_ROOT PATH $optarg
;;
+ --with-opencl)
+ append_cache_entry ENABLE_OPENCL BOOL true
+ ;;
--no-cppa)
ExcludedBenchmarks="cppa_$ExcludedBenchmarks"
;;
View
@@ -12,7 +12,8 @@ include_directories(. .. ${CPPA_INCLUDE} ${Boost_INCLUDE_DIRS})
macro(add_benchmark name)
add_executable(${name} ${name}.cpp)
- target_link_libraries(${name} ${CMAKE_DL_LIBS} ${CPPA_LIBRARY})
+ # LD_FLAGS set in main CMake file
+ target_link_libraries(${name} ${CMAKE_DL_LIBS} ${CPPA_LIBRARY} ${LD_FLAGS})
add_dependencies(${name} all_benchmarks)
endmacro()
@@ -21,3 +22,4 @@ add_benchmark(mailbox_performance)
add_benchmark(mixed_case)
add_benchmark(distributed)
add_benchmark(matching)
+add_benchmark(matrix)
@@ -9,7 +9,7 @@
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
- * Copyright (C) 2011, 2012 *
+ * Copyright (C) 2011-2013 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
@@ -9,7 +9,7 @@
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
- * Copyright (C) 2011, 2012 *
+ * Copyright (C) 2011-2013 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
@@ -9,7 +9,7 @@
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
- * Copyright (C) 2011, 2012 *
+ * Copyright (C) 2011-2013 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
View
@@ -9,7 +9,7 @@
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
- * Copyright (C) 2011, 2012 *
+ * Copyright (C) 2011-2013 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
Oops, something went wrong.

0 comments on commit d1083e2

Please sign in to comment.