delete copy of PazradisEO-GPU
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2188 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
b1761c7051
commit
984b1addc7
75 changed files with 0 additions and 10070 deletions
|
|
@ -1,11 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>ParadisEO-GPU</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
Authors:
|
|
||||||
Boufaras Karima
|
|
||||||
Thé Van Luong
|
|
||||||
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,79 +0,0 @@
|
||||||
# James Bigler, NVIDIA Corp (nvidia.com - jbigler)
|
|
||||||
# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html
|
|
||||||
#
|
|
||||||
# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
|
|
||||||
#
|
|
||||||
# Copyright (c) 2007-2009
|
|
||||||
# Scientific Computing and Imaging Institute, University of Utah
|
|
||||||
#
|
|
||||||
# This code is licensed under the MIT License. See the FindCUDA.cmake script
|
|
||||||
# for the text of the license.
|
|
||||||
|
|
||||||
# The MIT License
|
|
||||||
#
|
|
||||||
# License for the specific language governing rights and limitations under
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
|
|
||||||
#######################################################################
|
|
||||||
# This converts a file written in makefile syntax into one that can be included
|
|
||||||
# by CMake.
|
|
||||||
|
|
||||||
file(READ ${input_file} depend_text)
|
|
||||||
|
|
||||||
if (${depend_text} MATCHES ".+")
|
|
||||||
|
|
||||||
# message("FOUND DEPENDS")
|
|
||||||
|
|
||||||
# Remember, four backslashes is escaped to one backslash in the string.
|
|
||||||
string(REGEX REPLACE "\\\\ " " " depend_text ${depend_text})
|
|
||||||
|
|
||||||
# This works for the nvcc -M generated dependency files.
|
|
||||||
string(REGEX REPLACE "^.* : " "" depend_text ${depend_text})
|
|
||||||
string(REGEX REPLACE "[ \\\\]*\n" ";" depend_text ${depend_text})
|
|
||||||
|
|
||||||
set(dependency_list "")
|
|
||||||
|
|
||||||
foreach(file ${depend_text})
|
|
||||||
|
|
||||||
string(REGEX REPLACE "^ +" "" file ${file})
|
|
||||||
|
|
||||||
if(NOT IS_DIRECTORY ${file})
|
|
||||||
# If softlinks start to matter, we should change this to REALPATH. For now we need
|
|
||||||
# to flatten paths, because nvcc can generate stuff like /bin/../include instead of
|
|
||||||
# just /include.
|
|
||||||
get_filename_component(file_absolute "${file}" ABSOLUTE)
|
|
||||||
list(APPEND dependency_list "${file_absolute}")
|
|
||||||
endif(NOT IS_DIRECTORY ${file})
|
|
||||||
|
|
||||||
endforeach(file)
|
|
||||||
|
|
||||||
else()
|
|
||||||
# message("FOUND NO DEPENDS")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Remove the duplicate entries and sort them.
|
|
||||||
list(REMOVE_DUPLICATES dependency_list)
|
|
||||||
list(SORT dependency_list)
|
|
||||||
|
|
||||||
foreach(file ${dependency_list})
|
|
||||||
set(cuda_nvcc_depend "${cuda_nvcc_depend} \"${file}\"\n")
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
file(WRITE ${output_file} "# Generated by: make2cmake.cmake\nSET(CUDA_NVCC_DEPEND\n ${cuda_nvcc_depend})\n\n")
|
|
||||||
|
|
@ -1,112 +0,0 @@
|
||||||
# James Bigler, NVIDIA Corp (nvidia.com - jbigler)
|
|
||||||
# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html
|
|
||||||
#
|
|
||||||
# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
|
|
||||||
#
|
|
||||||
# Copyright (c) 2007-2009
|
|
||||||
# Scientific Computing and Imaging Institute, University of Utah
|
|
||||||
#
|
|
||||||
# This code is licensed under the MIT License. See the FindCUDA.cmake script
|
|
||||||
# for the text of the license.
|
|
||||||
|
|
||||||
# The MIT License
|
|
||||||
#
|
|
||||||
# License for the specific language governing rights and limitations under
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
|
|
||||||
#######################################################################
|
|
||||||
# Parses a .cubin file produced by nvcc and reports statistics about the file.
|
|
||||||
|
|
||||||
|
|
||||||
file(READ ${input_file} file_text)
|
|
||||||
|
|
||||||
if (${file_text} MATCHES ".+")
|
|
||||||
|
|
||||||
# Remember, four backslashes is escaped to one backslash in the string.
|
|
||||||
string(REGEX REPLACE ";" "\\\\;" file_text ${file_text})
|
|
||||||
string(REGEX REPLACE "\ncode" ";code" file_text ${file_text})
|
|
||||||
|
|
||||||
list(LENGTH file_text len)
|
|
||||||
|
|
||||||
foreach(line ${file_text})
|
|
||||||
|
|
||||||
# Only look at "code { }" blocks.
|
|
||||||
if(line MATCHES "^code")
|
|
||||||
|
|
||||||
# Break into individual lines.
|
|
||||||
string(REGEX REPLACE "\n" ";" line ${line})
|
|
||||||
|
|
||||||
foreach(entry ${line})
|
|
||||||
|
|
||||||
# Extract kernel names.
|
|
||||||
if (${entry} MATCHES "[^g]name = ([^ ]+)")
|
|
||||||
string(REGEX REPLACE ".* = ([^ ]+)" "\\1" entry ${entry})
|
|
||||||
|
|
||||||
# Check to see if the kernel name starts with "_"
|
|
||||||
set(skip FALSE)
|
|
||||||
# if (${entry} MATCHES "^_")
|
|
||||||
# Skip the rest of this block.
|
|
||||||
# message("Skipping ${entry}")
|
|
||||||
# set(skip TRUE)
|
|
||||||
# else (${entry} MATCHES "^_")
|
|
||||||
message("Kernel: ${entry}")
|
|
||||||
# endif (${entry} MATCHES "^_")
|
|
||||||
|
|
||||||
endif(${entry} MATCHES "[^g]name = ([^ ]+)")
|
|
||||||
|
|
||||||
# Skip the rest of the block if necessary
|
|
||||||
if(NOT skip)
|
|
||||||
|
|
||||||
# Registers
|
|
||||||
if (${entry} MATCHES "reg([ ]+)=([ ]+)([^ ]+)")
|
|
||||||
string(REGEX REPLACE ".*([ ]+)=([ ]+)([^ ]+)" "\\3" entry ${entry})
|
|
||||||
message("Registers: ${entry}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Local memory
|
|
||||||
if (${entry} MATCHES "lmem([ ]+)=([ ]+)([^ ]+)")
|
|
||||||
string(REGEX REPLACE ".*([ ]+)=([ ]+)([^ ]+)" "\\3" entry ${entry})
|
|
||||||
message("Local: ${entry}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Shared memory
|
|
||||||
if (${entry} MATCHES "smem([ ]+)=([ ]+)([^ ]+)")
|
|
||||||
string(REGEX REPLACE ".*([ ]+)=([ ]+)([^ ]+)" "\\3" entry ${entry})
|
|
||||||
message("Shared: ${entry}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (${entry} MATCHES "^}")
|
|
||||||
message("")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endif(NOT skip)
|
|
||||||
|
|
||||||
|
|
||||||
endforeach(entry)
|
|
||||||
|
|
||||||
endif(line MATCHES "^code")
|
|
||||||
|
|
||||||
endforeach(line)
|
|
||||||
|
|
||||||
else()
|
|
||||||
# message("FOUND NO DEPENDS")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,280 +0,0 @@
|
||||||
# James Bigler, NVIDIA Corp (nvidia.com - jbigler)
|
|
||||||
#
|
|
||||||
# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
|
|
||||||
#
|
|
||||||
# This code is licensed under the MIT License. See the FindCUDA.cmake script
|
|
||||||
# for the text of the license.
|
|
||||||
|
|
||||||
# The MIT License
|
|
||||||
#
|
|
||||||
# License for the specific language governing rights and limitations under
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# This file runs the nvcc commands to produce the desired output file along with
|
|
||||||
# the dependency file needed by CMake to compute dependencies. In addition the
|
|
||||||
# file checks the output of each command and if the command fails it deletes the
|
|
||||||
# output files.
|
|
||||||
|
|
||||||
# Input variables
|
|
||||||
#
|
|
||||||
# verbose:BOOL=<> OFF: Be as quiet as possible (default)
|
|
||||||
# ON : Describe each step
|
|
||||||
#
|
|
||||||
# build_configuration:STRING=<> Typically one of Debug, MinSizeRel, Release, or
|
|
||||||
# RelWithDebInfo, but it should match one of the
|
|
||||||
# entries in CUDA_HOST_FLAGS. This is the build
|
|
||||||
# configuration used when compiling the code. If
|
|
||||||
# blank or unspecified Debug is assumed as this is
|
|
||||||
# what CMake does.
|
|
||||||
#
|
|
||||||
# generated_file:STRING=<> File to generate. This argument must be passed in.
|
|
||||||
#
|
|
||||||
# generated_cubin_file:STRING=<> File to generate. This argument must be passed
|
|
||||||
# in if build_cubin is true.
|
|
||||||
|
|
||||||
if(NOT generated_file)
|
|
||||||
message(FATAL_ERROR "You must specify generated_file on the command line")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Set these up as variables to make reading the generated file easier
|
|
||||||
set(CMAKE_COMMAND "@CMAKE_COMMAND@")
|
|
||||||
set(source_file "@source_file@")
|
|
||||||
set(NVCC_generated_dependency_file "@NVCC_generated_dependency_file@")
|
|
||||||
set(cmake_dependency_file "@cmake_dependency_file@")
|
|
||||||
set(CUDA_make2cmake "@CUDA_make2cmake@")
|
|
||||||
set(CUDA_parse_cubin "@CUDA_parse_cubin@")
|
|
||||||
set(build_cubin @build_cubin@)
|
|
||||||
# We won't actually use these variables for now, but we need to set this, in
|
|
||||||
# order to force this file to be run again if it changes.
|
|
||||||
set(generated_file_path "@generated_file_path@")
|
|
||||||
set(generated_file_internal "@generated_file@")
|
|
||||||
set(generated_cubin_file_internal "@generated_cubin_file@")
|
|
||||||
|
|
||||||
set(CUDA_NVCC_EXECUTABLE "@CUDA_NVCC_EXECUTABLE@")
|
|
||||||
set(CUDA_NVCC_FLAGS "@CUDA_NVCC_FLAGS@;;@CUDA_WRAP_OPTION_NVCC_FLAGS@")
|
|
||||||
@CUDA_NVCC_FLAGS_CONFIG@
|
|
||||||
set(nvcc_flags "@nvcc_flags@")
|
|
||||||
set(CUDA_NVCC_INCLUDE_ARGS "@CUDA_NVCC_INCLUDE_ARGS@")
|
|
||||||
set(format_flag "@format_flag@")
|
|
||||||
|
|
||||||
if(build_cubin AND NOT generated_cubin_file)
|
|
||||||
message(FATAL_ERROR "You must specify generated_cubin_file on the command line")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# This is the list of host compilation flags. It C or CXX should already have
|
|
||||||
# been chosen by FindCUDA.cmake.
|
|
||||||
@CUDA_HOST_FLAGS@
|
|
||||||
|
|
||||||
# Take the compiler flags and package them up to be sent to the compiler via -Xcompiler
|
|
||||||
set(nvcc_host_compiler_flags "")
|
|
||||||
# If we weren't given a build_configuration, use Debug.
|
|
||||||
if(NOT build_configuration)
|
|
||||||
set(build_configuration Debug)
|
|
||||||
endif()
|
|
||||||
string(TOUPPER "${build_configuration}" build_configuration)
|
|
||||||
#message("CUDA_NVCC_HOST_COMPILER_FLAGS = ${CUDA_NVCC_HOST_COMPILER_FLAGS}")
|
|
||||||
foreach(flag ${CMAKE_HOST_FLAGS} ${CMAKE_HOST_FLAGS_${build_configuration}})
|
|
||||||
# Extra quotes are added around each flag to help nvcc parse out flags with spaces.
|
|
||||||
set(nvcc_host_compiler_flags "${nvcc_host_compiler_flags},\"${flag}\"")
|
|
||||||
endforeach()
|
|
||||||
if (nvcc_host_compiler_flags)
|
|
||||||
set(nvcc_host_compiler_flags "-Xcompiler" ${nvcc_host_compiler_flags})
|
|
||||||
endif()
|
|
||||||
#message("nvcc_host_compiler_flags = \"${nvcc_host_compiler_flags}\"")
|
|
||||||
# Add the build specific configuration flags
|
|
||||||
list(APPEND CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS_${build_configuration}})
|
|
||||||
|
|
||||||
if(DEFINED CCBIN)
|
|
||||||
set(CCBIN -ccbin "${CCBIN}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# cuda_execute_process - Executes a command with optional command echo and status message.
|
|
||||||
#
|
|
||||||
# status - Status message to print if verbose is true
|
|
||||||
# command - COMMAND argument from the usual execute_process argument structure
|
|
||||||
# ARGN - Remaining arguments are the command with arguments
|
|
||||||
#
|
|
||||||
# CUDA_result - return value from running the command
|
|
||||||
#
|
|
||||||
# Make this a macro instead of a function, so that things like RESULT_VARIABLE
|
|
||||||
# and other return variables are present after executing the process.
|
|
||||||
macro(cuda_execute_process status command)
|
|
||||||
set(_command ${command})
|
|
||||||
if(NOT _command STREQUAL "COMMAND")
|
|
||||||
message(FATAL_ERROR "Malformed call to cuda_execute_process. Missing COMMAND as second argument. (command = ${command})")
|
|
||||||
endif()
|
|
||||||
if(verbose)
|
|
||||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E echo -- ${status})
|
|
||||||
# Now we need to build up our command string. We are accounting for quotes
|
|
||||||
# and spaces, anything else is left up to the user to fix if they want to
|
|
||||||
# copy and paste a runnable command line.
|
|
||||||
set(cuda_execute_process_string)
|
|
||||||
foreach(arg ${ARGN})
|
|
||||||
# If there are quotes, excape them, so they come through.
|
|
||||||
string(REPLACE "\"" "\\\"" arg ${arg})
|
|
||||||
# Args with spaces need quotes around them to get them to be parsed as a single argument.
|
|
||||||
if(arg MATCHES " ")
|
|
||||||
list(APPEND cuda_execute_process_string "\"${arg}\"")
|
|
||||||
else()
|
|
||||||
list(APPEND cuda_execute_process_string ${arg})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
# Echo the command
|
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E echo ${cuda_execute_process_string})
|
|
||||||
endif(verbose)
|
|
||||||
# Run the command
|
|
||||||
execute_process(COMMAND ${ARGN} RESULT_VARIABLE CUDA_result )
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
# Delete the target file
|
|
||||||
cuda_execute_process(
|
|
||||||
"Removing ${generated_file}"
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -E remove "${generated_file}"
|
|
||||||
)
|
|
||||||
|
|
||||||
# For CUDA 2.3 and below, -G -M doesn't work, so remove the -G flag
|
|
||||||
# for dependency generation and hope for the best.
|
|
||||||
set(depends_CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}")
|
|
||||||
set(CUDA_VERSION @CUDA_VERSION@)
|
|
||||||
if(CUDA_VERSION VERSION_LESS "3.0")
|
|
||||||
cmake_policy(PUSH)
|
|
||||||
# CMake policy 0007 NEW states that empty list elements are not
|
|
||||||
# ignored. I'm just setting it to avoid the warning that's printed.
|
|
||||||
cmake_policy(SET CMP0007 NEW)
|
|
||||||
# Note that this will remove all occurances of -G.
|
|
||||||
list(REMOVE_ITEM depends_CUDA_NVCC_FLAGS "-G")
|
|
||||||
cmake_policy(POP)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# nvcc doesn't define __CUDACC__ for some reason when generating dependency files. This
|
|
||||||
# can cause incorrect dependencies when #including files based on this macro which is
|
|
||||||
# defined in the generating passes of nvcc invokation. We will go ahead and manually
|
|
||||||
# define this for now until a future version fixes this bug.
|
|
||||||
set(CUDACC_DEFINE -D__CUDACC__)
|
|
||||||
|
|
||||||
# Generate the dependency file
|
|
||||||
cuda_execute_process(
|
|
||||||
"Generating dependency file: ${NVCC_generated_dependency_file}"
|
|
||||||
COMMAND "${CUDA_NVCC_EXECUTABLE}"
|
|
||||||
-M
|
|
||||||
${CUDACC_DEFINE}
|
|
||||||
"${source_file}"
|
|
||||||
-o "${NVCC_generated_dependency_file}"
|
|
||||||
${CCBIN}
|
|
||||||
${nvcc_flags}
|
|
||||||
${nvcc_host_compiler_flags}
|
|
||||||
${depends_CUDA_NVCC_FLAGS}
|
|
||||||
-DNVCC
|
|
||||||
${CUDA_NVCC_INCLUDE_ARGS}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(CUDA_result)
|
|
||||||
message(FATAL_ERROR "Error generating ${generated_file}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Generate the cmake readable dependency file to a temp file. Don't put the
|
|
||||||
# quotes just around the filenames for the input_file and output_file variables.
|
|
||||||
# CMake will pass the quotes through and not be able to find the file.
|
|
||||||
cuda_execute_process(
|
|
||||||
"Generating temporary cmake readable file: ${cmake_dependency_file}.tmp"
|
|
||||||
COMMAND "${CMAKE_COMMAND}"
|
|
||||||
-D "input_file:FILEPATH=${NVCC_generated_dependency_file}"
|
|
||||||
-D "output_file:FILEPATH=${cmake_dependency_file}.tmp"
|
|
||||||
-P "${CUDA_make2cmake}"
|
|
||||||
)
|
|
||||||
|
|
||||||
if(CUDA_result)
|
|
||||||
message(FATAL_ERROR "Error generating ${generated_file}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Copy the file if it is different
|
|
||||||
cuda_execute_process(
|
|
||||||
"Copy if different ${cmake_dependency_file}.tmp to ${cmake_dependency_file}"
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${cmake_dependency_file}.tmp" "${cmake_dependency_file}"
|
|
||||||
)
|
|
||||||
|
|
||||||
if(CUDA_result)
|
|
||||||
message(FATAL_ERROR "Error generating ${generated_file}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Delete the temporary file
|
|
||||||
cuda_execute_process(
|
|
||||||
"Removing ${cmake_dependency_file}.tmp and ${NVCC_generated_dependency_file}"
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -E remove "${cmake_dependency_file}.tmp" "${NVCC_generated_dependency_file}"
|
|
||||||
)
|
|
||||||
|
|
||||||
if(CUDA_result)
|
|
||||||
message(FATAL_ERROR "Error generating ${generated_file}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Generate the code
|
|
||||||
cuda_execute_process(
|
|
||||||
"Generating ${generated_file}"
|
|
||||||
COMMAND "${CUDA_NVCC_EXECUTABLE}"
|
|
||||||
"${source_file}"
|
|
||||||
${format_flag} -o "${generated_file}"
|
|
||||||
${CCBIN}
|
|
||||||
${nvcc_flags}
|
|
||||||
${nvcc_host_compiler_flags}
|
|
||||||
${CUDA_NVCC_FLAGS}
|
|
||||||
-DNVCC
|
|
||||||
${CUDA_NVCC_INCLUDE_ARGS}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(CUDA_result)
|
|
||||||
# Since nvcc can sometimes leave half done files make sure that we delete the output file.
|
|
||||||
cuda_execute_process(
|
|
||||||
"Removing ${generated_file}"
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -E remove "${generated_file}"
|
|
||||||
)
|
|
||||||
message(FATAL_ERROR "Error generating file ${generated_file}")
|
|
||||||
else()
|
|
||||||
if(verbose)
|
|
||||||
message("Generated ${generated_file} successfully.")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Cubin resource report commands.
|
|
||||||
if( build_cubin )
|
|
||||||
# Run with -cubin to produce resource usage report.
|
|
||||||
cuda_execute_process(
|
|
||||||
"Generating ${generated_cubin_file}"
|
|
||||||
COMMAND "${CUDA_NVCC_EXECUTABLE}"
|
|
||||||
"${source_file}"
|
|
||||||
${CUDA_NVCC_FLAGS}
|
|
||||||
${nvcc_flags}
|
|
||||||
${CCBIN}
|
|
||||||
${nvcc_host_compiler_flags}
|
|
||||||
-DNVCC
|
|
||||||
-cubin
|
|
||||||
-o "${generated_cubin_file}"
|
|
||||||
${CUDA_NVCC_INCLUDE_ARGS}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Execute the parser script.
|
|
||||||
cuda_execute_process(
|
|
||||||
"Executing the parser script"
|
|
||||||
COMMAND "${CMAKE_COMMAND}"
|
|
||||||
-D "input_file:STRING=${generated_cubin_file}"
|
|
||||||
-P "${CUDA_parse_cubin}"
|
|
||||||
)
|
|
||||||
|
|
||||||
endif( build_cubin )
|
|
||||||
|
|
@ -1,132 +0,0 @@
|
||||||
######################################################################################
|
|
||||||
### 0) Set your application properties
|
|
||||||
######################################################################################
|
|
||||||
# check cmake version compatibility
|
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
|
||||||
|
|
||||||
# Here define your project name
|
|
||||||
PROJECT(Paradiseo-GPU)
|
|
||||||
|
|
||||||
SET(PACKAGE_BUGREPORT "paradiseo-help@lists.gforge.inria.fr" CACHE STRING "Package bug report" FORCE)
|
|
||||||
SET(PACKAGE_NAME "ParadisEO-GPU - Moving Objects GPU" CACHE STRING "Package name" FORCE)
|
|
||||||
SET(PACKAGE_STRING "ParadisEO-GPU 1.0" CACHE STRING "GPU Package string full name" FORCE)
|
|
||||||
SET(PACKAGE_VERSION "1.0" CACHE STRING "Package version" FORCE)
|
|
||||||
SET(GLOBAL_VERSION "1.0" CACHE STRING "Global version" FORCE)
|
|
||||||
SET(VERSION "1.0.0" CACHE STRING "Version" FORCE)
|
|
||||||
|
|
||||||
# regular expression checking
|
|
||||||
INCLUDE_REGULAR_EXPRESSION("^.*$" "^$")
|
|
||||||
|
|
||||||
# set a language for the entire project.
|
|
||||||
ENABLE_LANGUAGE(CXX)
|
|
||||||
ENABLE_LANGUAGE(C)
|
|
||||||
|
|
||||||
######################################################################################
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# Find Cuda package #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake/cuda" ${CMAKE_MODULE_PATH})
|
|
||||||
find_package(CUDA QUIET REQUIRED)
|
|
||||||
|
|
||||||
# Check if CUDA was found
|
|
||||||
if (CUDA_FOUND)
|
|
||||||
message("CUDA found")
|
|
||||||
else()
|
|
||||||
message("CUDA not found")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
######################################################################################
|
|
||||||
### 1) Include the install configuration file where are defined the main variables
|
|
||||||
######################################################################################
|
|
||||||
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/install.cmake)
|
|
||||||
|
|
||||||
######################################################################################
|
|
||||||
|
|
||||||
######################################################################################
|
|
||||||
### 2) Include the sources
|
|
||||||
######################################################################################
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
# Include required modules & utilities #
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
INCLUDE(CMakeBackwardCompatibilityCXX)
|
|
||||||
|
|
||||||
INCLUDE(FindDoxygen)
|
|
||||||
|
|
||||||
INCLUDE(CheckLibraryExists)
|
|
||||||
|
|
||||||
INCLUDE(Dart OPTIONAL)
|
|
||||||
|
|
||||||
# Set a special flag if the environment is windows (should do the same in a config.g file)
|
|
||||||
IF (WIN32)
|
|
||||||
ADD_DEFINITIONS(-D_WINDOWS=1)
|
|
||||||
ENDIF (WIN32)
|
|
||||||
|
|
||||||
######################################################################################
|
|
||||||
|
|
||||||
#########################
|
|
||||||
# Manage the build type #
|
|
||||||
#########################
|
|
||||||
|
|
||||||
# the user should choose the build type on windows environments,excepted under cygwin (default=none)
|
|
||||||
SET(CMAKE_DEFAULT_BUILD_TYPE "Release" CACHE STRING "Variable that stores the default CMake build type" FORCE)
|
|
||||||
|
|
||||||
FIND_PROGRAM(MEMORYCHECK_COMMAND
|
|
||||||
NAMES purify valgrind
|
|
||||||
PATHS
|
|
||||||
"/usr/local/bin /usr/bin [HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]"
|
|
||||||
DOC "Path to the memory checking command, used for memory error detection.")
|
|
||||||
|
|
||||||
IF(NOT CMAKE_BUILD_TYPE)
|
|
||||||
SET( CMAKE_BUILD_TYPE
|
|
||||||
${CMAKE_DEFAULT_BUILD_TYPE} CACHE STRING
|
|
||||||
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
|
|
||||||
FORCE)
|
|
||||||
ENDIF(NOT CMAKE_BUILD_TYPE)
|
|
||||||
|
|
||||||
IF(WIN32 AND NOT CYGWIN)
|
|
||||||
IF(CMAKE_CXX_COMPILER MATCHES cl)
|
|
||||||
IF(NOT WITH_SHARED_LIBS)
|
|
||||||
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
|
|
||||||
SET(CMAKE_CXX_FLAGS "/nologo /Gy")
|
|
||||||
SET(CMAKE_CXX_FLAGS_DEBUG "/W3 /MTd /Z7 /Od")
|
|
||||||
SET(CMAKE_CXX_FLAGS_RELEASE "/w /MT /O2 /wd4530")
|
|
||||||
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2")
|
|
||||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od")
|
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE")
|
|
||||||
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
|
|
||||||
ENDIF(NOT WITH_SHARED_LIBS)
|
|
||||||
ENDIF(CMAKE_CXX_COMPILER MATCHES cl)
|
|
||||||
ELSE(WIN32 AND NOT CYGWIN)
|
|
||||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
|
||||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2 -g -pg -fprofile-arcs -ftest-coverage -Wall -Wextra -Wno-unused-parameter")
|
|
||||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
|
|
||||||
SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -O6")
|
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
|
||||||
ENDIF(WIN32 AND NOT CYGWIN)
|
|
||||||
|
|
||||||
IF(CMAKE_BUILD_TYPE MATCHES Debug)
|
|
||||||
ADD_DEFINITIONS(-DCMAKE_VERBOSE_MAKEFILE=ON)
|
|
||||||
ENDIF(CMAKE_BUILD_TYPE MATCHES Debug)
|
|
||||||
|
|
||||||
EXECUTE_PROCESS(
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
||||||
${PARADISEO_GPU_SRC_DIR}/CTestCustom.cmake
|
|
||||||
${PARADISEO_GPU_BIN_DIR}/CTestCustom.cmake)
|
|
||||||
##########################################################################################################################################
|
|
||||||
######################################################################################
|
|
||||||
### 3) Link the librairies for your executable
|
|
||||||
######################################################################################
|
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(doc)
|
|
||||||
ADD_SUBDIRECTORY(src)
|
|
||||||
ADD_SUBDIRECTORY(test)
|
|
||||||
ADD_SUBDIRECTORY(tutoriel)
|
|
||||||
|
|
||||||
######################################################################################
|
|
||||||
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
set(CTEST_PROJECT_NAME "ParadisEO")
|
|
||||||
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
|
|
||||||
|
|
||||||
set(CTEST_DROP_METHOD "http")
|
|
||||||
set(CTEST_DROP_SITE "cdash.inria.fr")
|
|
||||||
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=ParadisEO")
|
|
||||||
set(CTEST_DROP_SITE_CDASH TRUE)
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
|
|
||||||
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
|
|
||||||
"test/"
|
|
||||||
"paradiseo-eo/"
|
|
||||||
"paradiseo-mo/"
|
|
||||||
"paradiseo-moeo/"
|
|
||||||
"problems/"
|
|
||||||
"tutorial/"
|
|
||||||
)
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
This package contains the source for ParadisEO-GPU problems.
|
|
||||||
|
|
||||||
# Step 1 - Configuration
|
|
||||||
------------------------
|
|
||||||
Edit the "install.cmake" file by entering the FULL PATH of :
|
|
||||||
|
|
||||||
-"ParadisEO_PATH" where Paradiseo directory has been installed in your host.
|
|
||||||
-"ParadisEO-GPU_PATH" where ParadisEO-GPU package has been decompressed in your host.
|
|
||||||
-"CUDA_PATH" where CUDA has been installed in your host.
|
|
||||||
-"NVIDIA_PATH" where NVIDIA has been installed in your host.
|
|
||||||
|
|
||||||
|
|
||||||
# Step 2 - Build process
|
|
||||||
------------------------
|
|
||||||
ParadisEO is assumed to be compiled. To download ParadisEO, please visit http://paradiseo.gforge.inria.fr/.
|
|
||||||
Go to the ParadisEO-GPU/build/ directory and lunch cmake:
|
|
||||||
(Unix) > cmake .. -DENABLE_CMAKE_TESTING=TRUE -DCMAKE_BUILD_TYPE=Debug
|
|
||||||
|
|
||||||
|
|
||||||
# Step 3 - Compilation
|
|
||||||
----------------------
|
|
||||||
In the ParadisEO-GPU/build/ directory:
|
|
||||||
(Unix) > make
|
|
||||||
|
|
||||||
# Step 4 - Execution
|
|
||||||
---------------------
|
|
||||||
A toy example is given to test the components. You can run these tests as following.
|
|
||||||
To define problem-related components for your own problem, please refer to the tutorials available on the website : http://paradiseo.gforge.inria.fr/.
|
|
||||||
In the ParadisEO-GPU/build/ directory:
|
|
||||||
(Unix) > ctest -D ExperimentalStart -D ExperimentalBuild -D ExperimentalTest -D ExperimentalSubmit
|
|
||||||
|
|
||||||
In the directory "tutorial", there is an example of One Max problem which illustrate how to use this package.
|
|
||||||
|
|
||||||
# Documentation
|
|
||||||
---------------
|
|
||||||
The API-documentation is available in doc/html/index.html
|
|
||||||
|
|
||||||
|
|
@ -1,240 +0,0 @@
|
||||||
# Doxyfile 1.5.1
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Project related configuration options
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
PROJECT_NAME = @PACKAGE_NAME@
|
|
||||||
PROJECT_NUMBER = @PACKAGE_VERSION@
|
|
||||||
OUTPUT_DIRECTORY = @CMAKE_BINARY_DIR@/doc
|
|
||||||
CREATE_SUBDIRS = NO
|
|
||||||
OUTPUT_LANGUAGE = English
|
|
||||||
BRIEF_MEMBER_DESC = YES
|
|
||||||
REPEAT_BRIEF = YES
|
|
||||||
ABBREVIATE_BRIEF = "The $name class" \
|
|
||||||
"The $name widget" \
|
|
||||||
"The $name file" \
|
|
||||||
is \
|
|
||||||
provides \
|
|
||||||
specifies \
|
|
||||||
contains \
|
|
||||||
represents \
|
|
||||||
a \
|
|
||||||
an \
|
|
||||||
the
|
|
||||||
ALWAYS_DETAILED_SEC = NO
|
|
||||||
INLINE_INHERITED_MEMB = NO
|
|
||||||
FULL_PATH_NAMES = NO
|
|
||||||
STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@
|
|
||||||
STRIP_FROM_INC_PATH =
|
|
||||||
SHORT_NAMES = NO
|
|
||||||
JAVADOC_AUTOBRIEF = YES
|
|
||||||
MULTILINE_CPP_IS_BRIEF = NO
|
|
||||||
DETAILS_AT_TOP = NO
|
|
||||||
INHERIT_DOCS = YES
|
|
||||||
SEPARATE_MEMBER_PAGES = NO
|
|
||||||
TAB_SIZE = 8
|
|
||||||
ALIASES =
|
|
||||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
|
||||||
OPTIMIZE_OUTPUT_JAVA = NO
|
|
||||||
BUILTIN_STL_SUPPORT = NO
|
|
||||||
DISTRIBUTE_GROUP_DOC = NO
|
|
||||||
SUBGROUPING = YES
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Build related configuration options
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
EXTRACT_ALL = YES
|
|
||||||
EXTRACT_PRIVATE = YES
|
|
||||||
EXTRACT_STATIC = YES
|
|
||||||
EXTRACT_LOCAL_CLASSES = YES
|
|
||||||
EXTRACT_LOCAL_METHODS = YES
|
|
||||||
HIDE_UNDOC_MEMBERS = YES
|
|
||||||
HIDE_UNDOC_CLASSES = YES
|
|
||||||
HIDE_FRIEND_COMPOUNDS = NO
|
|
||||||
HIDE_IN_BODY_DOCS = NO
|
|
||||||
INTERNAL_DOCS = NO
|
|
||||||
CASE_SENSE_NAMES = YES
|
|
||||||
HIDE_SCOPE_NAMES = NO
|
|
||||||
SHOW_INCLUDE_FILES = YES
|
|
||||||
INLINE_INFO = YES
|
|
||||||
SORT_MEMBER_DOCS = NO
|
|
||||||
SORT_BRIEF_DOCS = NO
|
|
||||||
SORT_BY_SCOPE_NAME = NO
|
|
||||||
GENERATE_TODOLIST = YES
|
|
||||||
GENERATE_TESTLIST = YES
|
|
||||||
GENERATE_BUGLIST = YES
|
|
||||||
GENERATE_DEPRECATEDLIST= YES
|
|
||||||
ENABLED_SECTIONS =
|
|
||||||
MAX_INITIALIZER_LINES = 30
|
|
||||||
SHOW_USED_FILES = YES
|
|
||||||
SHOW_DIRECTORIES = NO
|
|
||||||
FILE_VERSION_FILTER =
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to warning and progress messages
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
QUIET = YES
|
|
||||||
WARNINGS = NO
|
|
||||||
WARN_IF_UNDOCUMENTED = NO
|
|
||||||
WARN_IF_DOC_ERROR = YES
|
|
||||||
WARN_NO_PARAMDOC = NO
|
|
||||||
WARN_FORMAT = "$file:$line: $text"
|
|
||||||
WARN_LOGFILE =
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the input files
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
INPUT = @CMAKE_SOURCE_DIR@
|
|
||||||
FILE_PATTERNS = *.cu \
|
|
||||||
*.cpp \
|
|
||||||
*.h \
|
|
||||||
NEWS README
|
|
||||||
RECURSIVE = YES
|
|
||||||
EXCLUDE =
|
|
||||||
EXCLUDE_SYMLINKS = NO
|
|
||||||
EXCLUDE_PATTERNS =
|
|
||||||
EXAMPLE_PATH =
|
|
||||||
EXAMPLE_PATTERNS = *
|
|
||||||
EXAMPLE_RECURSIVE = NO
|
|
||||||
IMAGE_PATH =
|
|
||||||
INPUT_FILTER =
|
|
||||||
FILTER_PATTERNS =
|
|
||||||
FILTER_SOURCE_FILES = NO
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to source browsing
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
SOURCE_BROWSER = YES
|
|
||||||
INLINE_SOURCES = NO
|
|
||||||
STRIP_CODE_COMMENTS = YES
|
|
||||||
REFERENCED_BY_RELATION = YES
|
|
||||||
REFERENCES_RELATION = YES
|
|
||||||
REFERENCES_LINK_SOURCE = YES
|
|
||||||
USE_HTAGS = NO
|
|
||||||
VERBATIM_HEADERS = YES
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the alphabetical class index
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
ALPHABETICAL_INDEX = YES
|
|
||||||
COLS_IN_ALPHA_INDEX = 3
|
|
||||||
IGNORE_PREFIX =
|
|
||||||
#moeo
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the HTML output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_HTML = YES
|
|
||||||
HTML_OUTPUT = html
|
|
||||||
HTML_FILE_EXTENSION = .html
|
|
||||||
HTML_HEADER =
|
|
||||||
HTML_FOOTER =
|
|
||||||
HTML_STYLESHEET =
|
|
||||||
HTML_ALIGN_MEMBERS = YES
|
|
||||||
GENERATE_HTMLHELP = NO
|
|
||||||
CHM_FILE =
|
|
||||||
HHC_LOCATION =
|
|
||||||
GENERATE_CHI = NO
|
|
||||||
BINARY_TOC = NO
|
|
||||||
TOC_EXPAND = NO
|
|
||||||
DISABLE_INDEX = NO
|
|
||||||
ENUM_VALUES_PER_LINE = 4
|
|
||||||
GENERATE_TREEVIEW = YES
|
|
||||||
TREEVIEW_WIDTH = 250
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the LaTeX output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_LATEX = YES
|
|
||||||
LATEX_OUTPUT = latex
|
|
||||||
LATEX_CMD_NAME = latex
|
|
||||||
MAKEINDEX_CMD_NAME = makeindex
|
|
||||||
COMPACT_LATEX = NO
|
|
||||||
PAPER_TYPE = a4wide
|
|
||||||
EXTRA_PACKAGES =
|
|
||||||
LATEX_HEADER =
|
|
||||||
PDF_HYPERLINKS = NO
|
|
||||||
USE_PDFLATEX = NO
|
|
||||||
LATEX_BATCHMODE = NO
|
|
||||||
LATEX_HIDE_INDICES = NO
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the RTF output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_RTF = NO
|
|
||||||
RTF_OUTPUT = rtf
|
|
||||||
COMPACT_RTF = NO
|
|
||||||
RTF_HYPERLINKS = NO
|
|
||||||
RTF_STYLESHEET_FILE =
|
|
||||||
RTF_EXTENSIONS_FILE =
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the man page output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_MAN = YES
|
|
||||||
MAN_OUTPUT = man
|
|
||||||
MAN_EXTENSION = .3
|
|
||||||
MAN_LINKS = NO
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the XML output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_XML = NO
|
|
||||||
XML_OUTPUT = xml
|
|
||||||
XML_SCHEMA =
|
|
||||||
XML_DTD =
|
|
||||||
XML_PROGRAMLISTING = YES
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options for the AutoGen Definitions output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_AUTOGEN_DEF = NO
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the Perl module output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_PERLMOD = NO
|
|
||||||
PERLMOD_LATEX = NO
|
|
||||||
PERLMOD_PRETTY = YES
|
|
||||||
PERLMOD_MAKEVAR_PREFIX =
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to the preprocessor
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
ENABLE_PREPROCESSING = YES
|
|
||||||
MACRO_EXPANSION = NO
|
|
||||||
EXPAND_ONLY_PREDEF = NO
|
|
||||||
SEARCH_INCLUDES = YES
|
|
||||||
INCLUDE_PATH =
|
|
||||||
INCLUDE_FILE_PATTERNS =
|
|
||||||
PREDEFINED =
|
|
||||||
EXPAND_AS_DEFINED =
|
|
||||||
SKIP_FUNCTION_MACROS = YES
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration::additions related to external references
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
TAGFILES = @PARADISEO_EO_BIN_DIR@/doc/eo.doxytag=http://eodev.sourceforge.net/eo/doc/html \
|
|
||||||
@PARADISEO_MO_BIN_DIR@/doc/mo.doxytag=http://paradiseo.gforge.inria.fr/addon/paradiseo-mo/doc \
|
|
||||||
|
|
||||||
GENERATE_TAGFILE = @CMAKE_BINARY_DIR@/doc/mogpu.doxytag
|
|
||||||
ALLEXTERNALS = NO
|
|
||||||
EXTERNAL_GROUPS = YES
|
|
||||||
PERL_PATH = /usr/bin/perl
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to the dot tool
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
CLASS_DIAGRAMS = YES
|
|
||||||
HIDE_UNDOC_RELATIONS = YES
|
|
||||||
HAVE_DOT = YES
|
|
||||||
CLASS_GRAPH = YES
|
|
||||||
COLLABORATION_GRAPH = YES
|
|
||||||
GROUP_GRAPHS = YES
|
|
||||||
UML_LOOK = YES
|
|
||||||
TEMPLATE_RELATIONS = YES
|
|
||||||
INCLUDE_GRAPH = YES
|
|
||||||
INCLUDED_BY_GRAPH = YES
|
|
||||||
CALL_GRAPH = YES
|
|
||||||
CALLER_GRAPH = YES
|
|
||||||
GRAPHICAL_HIERARCHY = YES
|
|
||||||
DIRECTORY_GRAPH = YES
|
|
||||||
DOT_IMAGE_FORMAT = png
|
|
||||||
DOT_PATH =
|
|
||||||
DOTFILE_DIRS =
|
|
||||||
DOT_GRAPH_MAX_NODES = 50
|
|
||||||
MAX_DOT_GRAPH_DEPTH = 50
|
|
||||||
DOT_TRANSPARENT = YES
|
|
||||||
DOT_MULTI_TARGETS = YES
|
|
||||||
GENERATE_LEGEND = YES
|
|
||||||
DOT_CLEANUP = YES
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration::additions related to the search engine
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
SEARCHENGINE = YES
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
/** @mainpage Welcome ParadisEO GPU
|
|
||||||
|
|
||||||
@section intro Introduction
|
|
||||||
|
|
||||||
ParadisEO-GPU is a white-box object-oriented generic framework dedicated to the flexible design of local search algorithms on GPU (hill-climbing, tabu search ...)
|
|
||||||
|
|
||||||
@section tutorials Tutorials
|
|
||||||
|
|
||||||
Tutorials for ParadisEO-GPU are available in the "Tutorials section" of the <a href="http://paradiseo.gforge.inria.fr/index.php?n=Doc.Tutorials">ParadisEO tutorials</a>.
|
|
||||||
|
|
||||||
@section install Installation
|
|
||||||
|
|
||||||
The installation procedure of the package is detailed in the "README.txt" file located in the top-directory of the source-tree.
|
|
||||||
|
|
||||||
|
|
||||||
@section design Design
|
|
||||||
|
|
||||||
For an introduction to the design of ParadisEO,
|
|
||||||
you can look at the <a href="http://paradiseo.gforge.inria.fr">ParadisEO website</a>.
|
|
||||||
|
|
||||||
|
|
||||||
@section LICENSE
|
|
||||||
|
|
||||||
This software is governed by the CeCILL license under French law and
|
|
||||||
abiding by the rules of distribution of free software. You can use,
|
|
||||||
modify and/ or redistribute the software under the terms of the CeCILL
|
|
||||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
|
||||||
"http://www.cecill.info".
|
|
||||||
|
|
||||||
As a counterpart to the access to the source code and rights to copy,
|
|
||||||
modify and redistribute granted by the license, users are provided only
|
|
||||||
with a limited warranty and the software's author, the holder of the
|
|
||||||
economic rights, and the successive licensors have only limited liability.
|
|
||||||
|
|
||||||
In this respect, the user's attention is drawn to the risks associated
|
|
||||||
with loading, using, modifying and/or developing or reproducing the
|
|
||||||
software by the user in light of its specific status of free software,
|
|
||||||
that may mean that it is complicated to manipulate, and that also
|
|
||||||
therefore means that it is reserved for developers and experienced
|
|
||||||
professionals having in-depth computer knowledge. Users are therefore
|
|
||||||
encouraged to load and test the software's suitability as regards their
|
|
||||||
requirements in conditions enabling the security of their systems and/or
|
|
||||||
data to be ensured and, more generally, to use and operate it in the
|
|
||||||
same conditions as regards security.
|
|
||||||
The fact that you are presently reading this means that you have had
|
|
||||||
knowledge of the CeCILL license and that you accept its terms.
|
|
||||||
|
|
||||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
|
||||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @page webpages Related webpages
|
|
||||||
|
|
||||||
- ParadisEO <a href="http://paradiseo.gforge.inria.fr">homepage</a>
|
|
||||||
- INRIA GForge <a href="http://gforge.inria.fr/projects/paradiseo/">project page</a>
|
|
||||||
- Fore any questions, please contact paradiseo-help@lists.gforge.inria.fr
|
|
||||||
*/
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
#########################################################################################################
|
|
||||||
# 1) ParadisEO-GPU install: SIMPLE Configuration
|
|
||||||
#########################################################################################################
|
|
||||||
|
|
||||||
# Here, just specify PARADISEO_DIR : the directory where ParadisEO has been installed
|
|
||||||
SET(PARADISEO_DIR "/home/mia/workspace/trunk" CACHE PATH "ParadisEO directory" FORCE)
|
|
||||||
|
|
||||||
# Here, just specify CUDA_DIR : the directory where CUDA has been installed
|
|
||||||
SET(CUDA_DIR "/usr/local/cuda" CACHE PATH "CUDA directory" FORCE)
|
|
||||||
|
|
||||||
# Here, just specify NVIDIA_DIR : the directory where NVIDIA header has been installed
|
|
||||||
SET(NVIDIA_DIR "/home/mia/NVIDIA_GPU_Computing_SDK" CACHE PATH "NVIDIA directory" FORCE)
|
|
||||||
|
|
||||||
# Here, just specify GPU_DIR : the directory where package Paradiseo GPU has been extrated
|
|
||||||
SET(PARADISEO_GPU_DIR "/home/mia/workspace/ParadisEO-GPU" CACHE PATH "ParadisEO-GPU directory" FORCE)
|
|
||||||
#########################################################################################################
|
|
||||||
# 2) ParadisEO-GPU install: ADVANCED Configuration
|
|
||||||
#########################################################################################################
|
|
||||||
|
|
||||||
SET(NVIDIA_SRC_DIR "${NVIDIA_DIR}/C/common/inc" CACHE PATH "NVIDIA source directory" FORCE)
|
|
||||||
SET(NVIDIA_LIB_DIR "${NVIDIA_DIR}/C/lib" CACHE PATH "NVIDIA library directory" FORCE)
|
|
||||||
|
|
||||||
SET(CUDA_SRC_DIR "${CUDA_DIR}/include" CACHE PATH "CUDA source directory" FORCE)
|
|
||||||
SET(CUDA_LIB_DIR "${CUDA_DIR}/lib" CACHE PATH "CUDA library directory" FORCE)
|
|
||||||
|
|
||||||
SET(PARADISEO_EO_SRC_DIR "${PARADISEO_DIR}/paradiseo-eo" CACHE PATH "ParadisEO-EO source directory" FORCE)
|
|
||||||
SET(PARADISEO_EO_BIN_DIR "${PARADISEO_DIR}/paradiseo-eo/build" CACHE PATH "ParadisEO-EO binary directory" FORCE)
|
|
||||||
|
|
||||||
SET(PARADISEO_MO_SRC_DIR "${PARADISEO_DIR}/paradiseo-mo" CACHE PATH "ParadisEO-MO source directory" FORCE)
|
|
||||||
SET(PARADISEO_MO_BIN_DIR "${PARADISEO_DIR}/paradiseo-mo/build" CACHE PATH "ParadisEO-MO binary directory" FORCE)
|
|
||||||
|
|
||||||
SET(PARADISEO_MOEO_SRC_DIR "${PARADISEO_DIR}/paradiseo-moeo" CACHE PATH "ParadisEO-MOEO source directory" FORCE)
|
|
||||||
SET(PARADISEO_MOEO_BIN_DIR "${PARADISEO_DIR}/paradiseo-moeo/build" CACHE PATH "ParadisEO-MOEO binary directory" FORCE)
|
|
||||||
|
|
||||||
SET(PARADISEO_PEO_SRC_DIR "${PARADISEO_DIR}/paradiseo-peo" CACHE PATH "ParadisEO-PEO source directory" FORCE)
|
|
||||||
SET(PARADISEO_PEO_BIN_DIR "${PARADISEO_DIR}/paradiseo-peo/build" CACHE PATH "ParadisEO-PEO binary directory" FORCE)
|
|
||||||
|
|
||||||
SET(PARADISEO_GPU_SRC_DIR "${PARADISEO_GPU_DIR}/src" CACHE PATH "ParadisEO-GPU source directory" FORCE)
|
|
||||||
SET(PARADISEO_GPU_BIN_DIR "${PARADISEO_GPU_DIR}/build" CACHE PATH "ParadisEO-GPU binary directory" FORCE)
|
|
||||||
|
|
||||||
SET(PARADISEO_PROBLEMS_SRC_DIR "${PARADISEO_DIR}/problems" CACHE PATH "ParadisEO-problems source directory" FORCE)
|
|
||||||
|
|
||||||
#########################################################################################################
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
/*
|
|
||||||
<moCudaBitVector.h>
|
|
||||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
|
||||||
|
|
||||||
Karima Boufaras, Thé Van LUONG
|
|
||||||
|
|
||||||
This software is governed by the CeCILL license under French law and
|
|
||||||
abiding by the rules of distribution of free software. You can use,
|
|
||||||
modify and/ or redistribute the software under the terms of the CeCILL
|
|
||||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
|
||||||
"http://www.cecill.info".
|
|
||||||
|
|
||||||
As a counterpart to the access to the source code and rights to copy,
|
|
||||||
modify and redistribute granted by the license, users are provided only
|
|
||||||
with a limited warranty and the software's author, the holder of the
|
|
||||||
economic rights, and the successive licensors have only limited liability.
|
|
||||||
|
|
||||||
In this respect, the user's attention is drawn to the risks associated
|
|
||||||
with loading, using, modifying and/or developing or reproducing the
|
|
||||||
software by the user in light of its specific status of free software,
|
|
||||||
that may mean that it is complicated to manipulate, and that also
|
|
||||||
therefore means that it is reserved for developers and experienced
|
|
||||||
professionals having in-depth computer knowledge. Users are therefore
|
|
||||||
encouraged to load and test the software's suitability as regards their
|
|
||||||
requirements in conditions enabling the security of their systems and/or
|
|
||||||
data to be ensured and, more generally, to use and operate it in the
|
|
||||||
same conditions as regards security.
|
|
||||||
The fact that you are presently reading this means that you have had
|
|
||||||
knowledge of the CeCILL license and that you accept its terms.
|
|
||||||
|
|
||||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
|
||||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _moCudaBitVector_H_
|
|
||||||
#define _moCudaBitVector_H_
|
|
||||||
|
|
||||||
#include <cudaType/moCudaVector.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of Bit vector representation on CUDA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Fitness>
|
|
||||||
|
|
||||||
class moCudaBitVector: public moCudaVector<bool, Fitness> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
using moCudaVector<bool, Fitness>::vect;
|
|
||||||
using moCudaVector<bool, Fitness>::N;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default constructor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moCudaBitVector() :
|
|
||||||
moCudaVector<bool, Fitness> () {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Constructor.
|
|
||||||
*@param _size The neighborhood size.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moCudaBitVector(unsigned _size) {
|
|
||||||
|
|
||||||
N = _size;
|
|
||||||
|
|
||||||
vect = new bool[_size];
|
|
||||||
|
|
||||||
create();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Constructor.
|
|
||||||
*@param _size The neighborhood size.
|
|
||||||
*@param _b Value to assign to vector.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moCudaBitVector(unsigned _size, bool _b) {
|
|
||||||
|
|
||||||
N = _size;
|
|
||||||
|
|
||||||
vect = new bool[_size];
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < _size; i++)
|
|
||||||
vect[i] = _b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Initializer of random bit vector.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void create() {
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < N; i++) {
|
|
||||||
|
|
||||||
vect[i] = (bool) round((float) rng.rand() / RAND_MAX);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,113 +0,0 @@
|
||||||
/*
|
|
||||||
<moCudaIntVector.h>
|
|
||||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
|
||||||
|
|
||||||
Karima Boufaras, Thé Van LUONG
|
|
||||||
|
|
||||||
This software is governed by the CeCILL license under French law and
|
|
||||||
abiding by the rules of distribution of free software. You can use,
|
|
||||||
modify and/ or redistribute the software under the terms of the CeCILL
|
|
||||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
|
||||||
"http://www.cecill.info".
|
|
||||||
|
|
||||||
As a counterpart to the access to the source code and rights to copy,
|
|
||||||
modify and redistribute granted by the license, users are provided only
|
|
||||||
with a limited warranty and the software's author, the holder of the
|
|
||||||
economic rights, and the successive licensors have only limited liability.
|
|
||||||
|
|
||||||
In this respect, the user's attention is drawn to the risks associated
|
|
||||||
with loading, using, modifying and/or developing or reproducing the
|
|
||||||
software by the user in light of its specific status of free software,
|
|
||||||
that may mean that it is complicated to manipulate, and that also
|
|
||||||
therefore means that it is reserved for developers and experienced
|
|
||||||
professionals having in-depth computer knowledge. Users are therefore
|
|
||||||
encouraged to load and test the software's suitability as regards their
|
|
||||||
requirements in conditions enabling the security of their systems and/or
|
|
||||||
data to be ensured and, more generally, to use and operate it in the
|
|
||||||
same conditions as regards security.
|
|
||||||
The fact that you are presently reading this means that you have had
|
|
||||||
knowledge of the CeCILL license and that you accept its terms.
|
|
||||||
|
|
||||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
|
||||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _moCudaIntVector_H_
|
|
||||||
#define _moCudaIntVector_H_
|
|
||||||
|
|
||||||
#include <cudaType/moCudaVector.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of integer vector representation on CUDA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Fitness>
|
|
||||||
|
|
||||||
class moCudaIntVector: public moCudaVector<int, Fitness> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
using moCudaVector<int, Fitness>::vect;
|
|
||||||
using moCudaVector<int, Fitness>::N;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default constructor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moCudaIntVector() :
|
|
||||||
moCudaVector<int, Fitness> () {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Constructor.
|
|
||||||
*@param _size The neighborhood size.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moCudaIntVector(unsigned _size) {
|
|
||||||
|
|
||||||
N = _size;
|
|
||||||
|
|
||||||
vect = new int[_size];
|
|
||||||
|
|
||||||
create();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Assignment operator
|
|
||||||
*@param _vector The vector passed to the function determine the new content.
|
|
||||||
*@return a new vector.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moCudaIntVector& operator=(const moCudaIntVector & _vector) {
|
|
||||||
|
|
||||||
N = _vector.N;
|
|
||||||
vect = new int[N];
|
|
||||||
for (unsigned i = 0; i < N; i++)
|
|
||||||
vect[i] = _vector.vect[i];
|
|
||||||
fitness(_vector.fitness());
|
|
||||||
return (*this);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Initializer of random integer vector.
|
|
||||||
*/
|
|
||||||
void create() {
|
|
||||||
|
|
||||||
unsigned random;
|
|
||||||
int temp;
|
|
||||||
for (unsigned i = 0; i < N; i++)
|
|
||||||
vect[i] = i;
|
|
||||||
// we want a random permutation so we shuffle
|
|
||||||
for (unsigned i = 0; i < N; i++) {
|
|
||||||
random = rng.rand() % (N - i) + i;
|
|
||||||
temp = vect[i];
|
|
||||||
vect[i] = vect[random];
|
|
||||||
vect[random] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,159 +0,0 @@
|
||||||
/*
|
|
||||||
<moCudaVector.h>
|
|
||||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
|
||||||
|
|
||||||
Thé Van LUONG, Karima Boufaras
|
|
||||||
|
|
||||||
This software is governed by the CeCILL license under French law and
|
|
||||||
abiding by the rules of distribution of free software. You can use,
|
|
||||||
modify and/ or redistribute the software under the terms of the CeCILL
|
|
||||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
|
||||||
"http://www.cecill.info".
|
|
||||||
|
|
||||||
As a counterpart to the access to the source code and rights to copy,
|
|
||||||
modify and redistribute granted by the license, users are provided only
|
|
||||||
with a limited warranty and the software's author, the holder of the
|
|
||||||
economic rights, and the successive licensors have only limited liability.
|
|
||||||
|
|
||||||
In this respect, the user's attention is drawn to the risks associated
|
|
||||||
with loading, using, modifying and/or developing or reproducing the
|
|
||||||
software by the user in light of its specific status of free software,
|
|
||||||
that may mean that it is complicated to manipulate, and that also
|
|
||||||
therefore means that it is reserved for developers and experienced
|
|
||||||
professionals having in-depth computer knowledge. Users are therefore
|
|
||||||
encouraged to load and test the software's suitability as regards their
|
|
||||||
requirements in conditions enabling the security of their systems and/or
|
|
||||||
data to be ensured and, more generally, to use and operate it in the
|
|
||||||
same conditions as regards security.
|
|
||||||
The fact that you are presently reading this means that you have had
|
|
||||||
knowledge of the CeCILL license and that you accept its terms.
|
|
||||||
|
|
||||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
|
||||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _moCudaVector_H_
|
|
||||||
#define _moCudaVector_H_
|
|
||||||
|
|
||||||
#include <eo>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of vector representation on CUDA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class ElemT, class Fitness>
|
|
||||||
|
|
||||||
class moCudaVector: public EO<Fitness> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef ElemT ElemType;
|
|
||||||
ElemType * vect;
|
|
||||||
unsigned N;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default constructor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moCudaVector() :
|
|
||||||
N(0) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Constructor.
|
|
||||||
*@param _size The neighborhood size.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moCudaVector(unsigned _size) {
|
|
||||||
|
|
||||||
N = _size;
|
|
||||||
|
|
||||||
vect = new ElemType[_size];
|
|
||||||
|
|
||||||
create();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destructor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
~moCudaVector() {
|
|
||||||
if (N > 1)
|
|
||||||
delete[] vect;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*How to fill the vector.
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual void create() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Assignment operator
|
|
||||||
*@param _vector The vector passed to the function determine the new content.
|
|
||||||
*@return a new vector.
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual moCudaVector& operator=(const moCudaVector & _vector) {
|
|
||||||
|
|
||||||
N = _vector.N;
|
|
||||||
vect = new ElemType[N];
|
|
||||||
for (unsigned i = 0; i < N; i++)
|
|
||||||
vect[i] = _vector.vect[i];
|
|
||||||
fitness(_vector.fitness());
|
|
||||||
return (*this);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*An accessor read only on the i'th element of the vector (function inline can be called from host or device).
|
|
||||||
*@param
|
|
||||||
*_i The i'th element of vector.
|
|
||||||
*@return
|
|
||||||
*The i'th element of the vector for read only
|
|
||||||
*/
|
|
||||||
|
|
||||||
inline __host__ __device__ const ElemType & operator[](unsigned _i) const {
|
|
||||||
|
|
||||||
return vect[_i];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*An accessor read-write on the i'th element of the vector(function inline can be called from host or device).
|
|
||||||
*@param _i The i'th element of the vector.
|
|
||||||
*@return The i'th element of the vector for read-write
|
|
||||||
*/
|
|
||||||
|
|
||||||
inline __host__ __device__ ElemType & operator[](unsigned _i) {
|
|
||||||
|
|
||||||
return vect[_i];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Function inline to get the size of vector, called from host and device.
|
|
||||||
*@return The vector size's
|
|
||||||
*/
|
|
||||||
|
|
||||||
inline __host__ __device__ unsigned size() {
|
|
||||||
|
|
||||||
return N;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void printOn(std::ostream& os) const {
|
|
||||||
EO<Fitness>::printOn(os);
|
|
||||||
os << ' ';
|
|
||||||
os << N << ' ';
|
|
||||||
unsigned int i;
|
|
||||||
for (i = 0; i < N; i++)
|
|
||||||
os << vect[i] << ' ';
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,136 +0,0 @@
|
||||||
/*
|
|
||||||
<moCudaEval.h>
|
|
||||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
|
||||||
|
|
||||||
Karima Boufaras, Thé Van LUONG
|
|
||||||
|
|
||||||
This software is governed by the CeCILL license under French law and
|
|
||||||
abiding by the rules of distribution of free software. You can use,
|
|
||||||
modify and/ or redistribute the software under the terms of the CeCILL
|
|
||||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
|
||||||
"http://www.cecill.info".
|
|
||||||
|
|
||||||
As a counterpart to the access to the source code and rights to copy,
|
|
||||||
modify and redistribute granted by the license, users are provided only
|
|
||||||
with a limited warranty and the software's author, the holder of the
|
|
||||||
economic rights, and the successive licensors have only limited liability.
|
|
||||||
|
|
||||||
In this respect, the user's attention is drawn to the risks associated
|
|
||||||
with loading, using, modifying and/or developing or reproducing the
|
|
||||||
software by the user in light of its specific status of free software,
|
|
||||||
that may mean that it is complicated to manipulate, and that also
|
|
||||||
therefore means that it is reserved for developers and experienced
|
|
||||||
professionals having in-depth computer knowledge. Users are therefore
|
|
||||||
encouraged to load and test the software's suitability as regards their
|
|
||||||
requirements in conditions enabling the security of their systems and/or
|
|
||||||
data to be ensured and, more generally, to use and operate it in the
|
|
||||||
same conditions as regards security.
|
|
||||||
The fact that you are presently reading this means that you have had
|
|
||||||
knowledge of the CeCILL license and that you accept its terms.
|
|
||||||
|
|
||||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
|
||||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef moCudaEval_H
|
|
||||||
#define moCudaEval_H
|
|
||||||
#include <eval/moEval.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Abstract class for evaluation on GPU
|
|
||||||
*/
|
|
||||||
template<class Neighbor>
|
|
||||||
class moCudaEval: public moEval<Neighbor> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define type of a solution corresponding to Neighbor
|
|
||||||
*/
|
|
||||||
typedef typename Neighbor::EOT EOT;
|
|
||||||
|
|
||||||
typedef typename EOT::Fitness Fitness;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
* @param _neighborhoodSize the size of the neighborhood
|
|
||||||
*/
|
|
||||||
|
|
||||||
moCudaEval(unsigned int _neighborhoodSize) {
|
|
||||||
|
|
||||||
neighborhoodSize = _neighborhoodSize;
|
|
||||||
host_FitnessArray = new Fitness[neighborhoodSize];
|
|
||||||
cudaMalloc((void**) &device_FitnessArray, neighborhoodSize
|
|
||||||
* sizeof(Fitness));
|
|
||||||
kernel_Dim = neighborhoodSize / BLOCK_SIZE + ((neighborhoodSize
|
|
||||||
% BLOCK_SIZE == 0) ? 0 : 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destructor
|
|
||||||
*/
|
|
||||||
|
|
||||||
~moCudaEval() {
|
|
||||||
|
|
||||||
delete[] host_FitnessArray;
|
|
||||||
cudaFree(device_FitnessArray);
|
|
||||||
cudaFree(&device_solution);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set fitness of a solution neighbors
|
|
||||||
*@param _sol the solution which generate the neighborhood
|
|
||||||
*@param _neighbor the current neighbor
|
|
||||||
*/
|
|
||||||
|
|
||||||
void operator()(EOT & _sol, Neighbor & _neighbor) {
|
|
||||||
|
|
||||||
_neighbor.fitness(host_FitnessArray[_neighbor.index()]);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute fitness for all Kswap solution neighbors in device
|
|
||||||
* @param _sol the solution which generate the neighborhood
|
|
||||||
* @param _mapping the neighborhood mapping
|
|
||||||
* @param _Kswap the number of swap
|
|
||||||
*/
|
|
||||||
virtual void neighborhoodKswapEval(EOT & _sol, unsigned * _mapping,
|
|
||||||
unsigned _Kswap) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute fitness for all Kflip solution neighbors in device
|
|
||||||
* @param _sol the solution which generate the neighborhood
|
|
||||||
* @param _mapping the neighborhood mapping
|
|
||||||
* @param _Kflip the number of bit to flip
|
|
||||||
*/
|
|
||||||
virtual void neighborhoodKflipEval(EOT & _sol, unsigned * _mapping,
|
|
||||||
unsigned _Kflip) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute fitness for all solution neighbors in device
|
|
||||||
* @param _sol the solution which generate the neighborhood
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual void neighborhoodEval(EOT & _sol)=0;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
//the host array to save all neighbors fitness
|
|
||||||
Fitness * host_FitnessArray;
|
|
||||||
//the device array to save neighbors fitness computed in device
|
|
||||||
Fitness * device_FitnessArray;
|
|
||||||
//the device solution
|
|
||||||
EOT device_solution;
|
|
||||||
//the size of neighborhood
|
|
||||||
unsigned int neighborhoodSize;
|
|
||||||
//Cuda kernel dimension
|
|
||||||
int kernel_Dim;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
/*
|
|
||||||
<moCudaEvalFunc.h>
|
|
||||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
|
||||||
|
|
||||||
Thé Van LUONG, Karima Boufaras
|
|
||||||
|
|
||||||
This software is governed by the CeCILL license under French law and
|
|
||||||
abiding by the rules of distribution of free software. You can use,
|
|
||||||
modify and/ or redistribute the software under the terms of the CeCILL
|
|
||||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
|
||||||
"http://www.cecill.info".
|
|
||||||
|
|
||||||
As a counterpart to the access to the source code and rights to copy,
|
|
||||||
modify and redistribute granted by the license, users are provided only
|
|
||||||
with a limited warranty and the software's author, the holder of the
|
|
||||||
economic rights, and the successive licensors have only limited liability.
|
|
||||||
|
|
||||||
In this respect, the user's attention is drawn to the risks associated
|
|
||||||
with loading, using, modifying and/or developing or reproducing the
|
|
||||||
software by the user in light of its specific status of free software,
|
|
||||||
that may mean that it is complicated to manipulate, and that also
|
|
||||||
therefore means that it is reserved for developers and experienced
|
|
||||||
professionals having in-depth computer knowledge. Users are therefore
|
|
||||||
encouraged to load and test the software's suitability as regards their
|
|
||||||
requirements in conditions enabling the security of their systems and/or
|
|
||||||
data to be ensured and, more generally, to use and operate it in the
|
|
||||||
same conditions as regards security.
|
|
||||||
The fact that you are presently reading this means that you have had
|
|
||||||
knowledge of the CeCILL license and that you accept its terms.
|
|
||||||
|
|
||||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
|
||||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __moCudaEvalFunc_H
|
|
||||||
#define __moCudaEvalFunc_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Abstract class for CUDA evaluation of neighbor
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Neighbor>
|
|
||||||
class moCudaEvalFunc {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define type of a solution corresponding to Neighbor
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef typename Neighbor::EOT EOT;
|
|
||||||
typedef typename EOT::ElemType T;
|
|
||||||
typedef typename EOT::Fitness Fitness;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*/
|
|
||||||
|
|
||||||
moCudaEvalFunc() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destructor
|
|
||||||
*/
|
|
||||||
|
|
||||||
~moCudaEvalFunc() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Virtual functor to compute fitness of a solution neighbor
|
|
||||||
*@param _solution the solution which generate the neighborhood
|
|
||||||
*@param _fitness the current solution fitness
|
|
||||||
*@param _index the index neighbor
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual inline __host__ __device__ Fitness operator() (EOT & _solution,Fitness _fitness, unsigned int * _index){
|
|
||||||
|
|
||||||
return _fitness;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,213 +0,0 @@
|
||||||
/*
|
|
||||||
<moCudaKswapEval.h>
|
|
||||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
|
||||||
|
|
||||||
Karima Boufaras, Thé Van LUONG
|
|
||||||
|
|
||||||
This software is governed by the CeCILL license under French law and
|
|
||||||
abiding by the rules of distribution of free software. You can use,
|
|
||||||
modify and/ or redistribute the software under the terms of the CeCILL
|
|
||||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
|
||||||
"http://www.cecill.info".
|
|
||||||
|
|
||||||
As a counterpart to the access to the source code and rights to copy,
|
|
||||||
modify and redistribute granted by the license, users are provided only
|
|
||||||
with a limited warranty and the software's author, the holder of the
|
|
||||||
economic rights, and the successive licensors have only limited liability.
|
|
||||||
|
|
||||||
In this respect, the user's attention is drawn to the risks associated
|
|
||||||
with loading, using, modifying and/or developing or reproducing the
|
|
||||||
software by the user in light of its specific status of free software,
|
|
||||||
that may mean that it is complicated to manipulate, and that also
|
|
||||||
therefore means that it is reserved for developers and experienced
|
|
||||||
professionals having in-depth computer knowledge. Users are therefore
|
|
||||||
encouraged to load and test the software's suitability as regards their
|
|
||||||
requirements in conditions enabling the security of their systems and/or
|
|
||||||
data to be ensured and, more generally, to use and operate it in the
|
|
||||||
same conditions as regards security.
|
|
||||||
The fact that you are presently reading this means that you have had
|
|
||||||
knowledge of the CeCILL license and that you accept its terms.
|
|
||||||
|
|
||||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
|
||||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef moCudaKswapEval_H
|
|
||||||
#define moCudaKswapEval_H
|
|
||||||
#include <eval/moCudaEval.h>
|
|
||||||
#include <eval/moCudakernelEval.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* class for the K-swap neighborhood evaluation
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Neighbor, class IncrementEval>
|
|
||||||
class moCudaKswapEval: public moCudaEval<Neighbor> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define type of a solution corresponding to Neighbor
|
|
||||||
*/
|
|
||||||
typedef typename Neighbor::EOT EOT;
|
|
||||||
/**
|
|
||||||
* Define type of a vector corresponding to Solution
|
|
||||||
*/
|
|
||||||
typedef typename EOT::ElemType T;
|
|
||||||
/**
|
|
||||||
* Define type of a fitness corresponding to Solution
|
|
||||||
*/
|
|
||||||
typedef typename EOT::Fitness Fitness;
|
|
||||||
|
|
||||||
using moCudaEval<Neighbor>::neighborhoodSize;
|
|
||||||
using moCudaEval<Neighbor>::host_FitnessArray;
|
|
||||||
using moCudaEval<Neighbor>::device_FitnessArray;
|
|
||||||
using moCudaEval<Neighbor>::device_solution;
|
|
||||||
using moCudaEval<Neighbor>::kernel_Dim;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
* @param _neighborhoodSize the size of the neighborhood
|
|
||||||
* @param _incrEval the incremental evaluation
|
|
||||||
*/
|
|
||||||
|
|
||||||
moCudaKswapEval(unsigned int _neighborhoodSize, IncrementEval & _incrEval) :
|
|
||||||
moCudaEval<Neighbor> (_neighborhoodSize), incrEval(_incrEval) {
|
|
||||||
mutex = false;
|
|
||||||
mutex_kswap = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destructor
|
|
||||||
*/
|
|
||||||
~moCudaKswapEval() {
|
|
||||||
if (mutex_kswap) {
|
|
||||||
cudaFree(&device_setSolution);
|
|
||||||
cudaFree(&device_tmp);
|
|
||||||
delete[] vect;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute fitness for all solution neighbors in device without specific mapping
|
|
||||||
* @param _sol the solution which generate the neighborhood
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual void neighborhoodEval(EOT & _sol) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute fitness for all solution neighbors in device with K-swap mapping
|
|
||||||
* @param _sol the solution which generate the neighborhood
|
|
||||||
* @param _mapping the array of mapping indexes for K-swap neighborhood
|
|
||||||
* @param _Kswap the number of swap
|
|
||||||
*/
|
|
||||||
|
|
||||||
void neighborhoodKswapEval(EOT & _sol, unsigned * _mapping, unsigned _Kswap) {
|
|
||||||
|
|
||||||
// the solution size
|
|
||||||
unsigned _size = _sol.size();
|
|
||||||
|
|
||||||
// Get Current solution fitness
|
|
||||||
Fitness fitness = _sol.fitness();
|
|
||||||
|
|
||||||
//Case of Permutation
|
|
||||||
if (_Kswap == 1) {
|
|
||||||
if (!mutex) {
|
|
||||||
//Allocate the space for solution in the device global memory
|
|
||||||
cudaMalloc((void**) &device_solution.vect, _size * sizeof(T));
|
|
||||||
mutex = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Copy the solution vector from the host to device
|
|
||||||
cudaMemcpy(device_solution.vect, _sol.vect, _size * sizeof(T),
|
|
||||||
cudaMemcpyHostToDevice);
|
|
||||||
|
|
||||||
//Launch the Kernel to compute all permutation neighbors fitness
|
|
||||||
kernelPermutation<EOT,Fitness,Neighbor,IncrementEval><<<kernel_Dim,BLOCK_SIZE >>>(incrEval,device_solution,device_FitnessArray,fitness,neighborhoodSize,_mapping,_size);
|
|
||||||
//Copy the result from device to host
|
|
||||||
cudaMemcpy(host_FitnessArray, device_FitnessArray, neighborhoodSize
|
|
||||||
* sizeof(Fitness), cudaMemcpyDeviceToHost);
|
|
||||||
}
|
|
||||||
//Case Kswap
|
|
||||||
else if (_Kswap > 1) {
|
|
||||||
if (!mutex_kswap) {
|
|
||||||
vect = new T[neighborhoodSize * _size];
|
|
||||||
//Allocate the space for set of solution in the device global memory
|
|
||||||
cudaMalloc((void**) &device_setSolution.vect, neighborhoodSize
|
|
||||||
* _size * sizeof(T));
|
|
||||||
//Allocate the space to save temporary EOT element to swap
|
|
||||||
cudaMalloc((void**) &device_tmp.vect, neighborhoodSize
|
|
||||||
* sizeof(T));
|
|
||||||
mutex_kswap = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < neighborhoodSize; i++) {
|
|
||||||
for (int j = 0; j < _size; j++) {
|
|
||||||
vect[j + i * _size] = _sol.vect[j];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Copy the set of solution from the host to device
|
|
||||||
cudaMemcpy(device_setSolution.vect, vect, neighborhoodSize * _size
|
|
||||||
* sizeof(T), cudaMemcpyHostToDevice);
|
|
||||||
|
|
||||||
//Launch the Kernel to compute all Kswap neighbors fitness
|
|
||||||
kernelKswap<EOT,Fitness,Neighbor,IncrementEval><<<kernel_Dim,BLOCK_SIZE >>>(incrEval,device_setSolution,device_tmp,device_FitnessArray,fitness,neighborhoodSize,_mapping,_Kswap,_size);
|
|
||||||
|
|
||||||
//Copy the result from device to host
|
|
||||||
cudaMemcpy(host_FitnessArray, device_FitnessArray, neighborhoodSize
|
|
||||||
* sizeof(Fitness), cudaMemcpyDeviceToHost);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute fitness for all solution neighbors(K-flip of binary solution) in device
|
|
||||||
* @param _sol the solution which generate the neighborhood
|
|
||||||
* @param _mapping the array of mapping indexes for k-flip neighborhood
|
|
||||||
* @param _Kflip the number of flip to do
|
|
||||||
*/
|
|
||||||
|
|
||||||
void neighborhoodKflipEval(EOT & _sol, unsigned * _mapping,
|
|
||||||
unsigned _Kflip) {
|
|
||||||
|
|
||||||
// the solution size
|
|
||||||
unsigned _size = _sol.size();
|
|
||||||
|
|
||||||
// Get Current solution fitness
|
|
||||||
Fitness fitness = _sol.fitness();
|
|
||||||
if (!mutex) {
|
|
||||||
//Allocate the space for solution in the device global memory
|
|
||||||
cudaMalloc((void**) &device_solution.vect, _size * sizeof(T));
|
|
||||||
mutex = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Copy the solution vector from the host to device
|
|
||||||
cudaMemcpy(device_solution.vect, _sol.vect, _size * sizeof(T),
|
|
||||||
cudaMemcpyHostToDevice);
|
|
||||||
|
|
||||||
//Launch the Kernel to compute all flip neighbors fitness
|
|
||||||
kernelKflip<EOT,Fitness,Neighbor,IncrementEval><<<kernel_Dim,BLOCK_SIZE >>>(incrEval,device_solution,device_FitnessArray,fitness,neighborhoodSize,_mapping,_Kflip);
|
|
||||||
|
|
||||||
//Copy the result from device to host
|
|
||||||
cudaMemcpy(host_FitnessArray, device_FitnessArray, neighborhoodSize
|
|
||||||
* sizeof(Fitness), cudaMemcpyDeviceToHost);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
IncrementEval & incrEval;
|
|
||||||
//NeighborhoodSize copy of solution
|
|
||||||
EOT device_setSolution;
|
|
||||||
//NeighborhoodSize element of EOT
|
|
||||||
EOT device_tmp;
|
|
||||||
//Vector of neighborhoodSize copy of solution
|
|
||||||
T * vect;
|
|
||||||
bool mutex_kswap;
|
|
||||||
bool mutex;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
@ -1,113 +0,0 @@
|
||||||
/*
|
|
||||||
<moCudaVectorEval.h>
|
|
||||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
|
||||||
|
|
||||||
Karima Boufaras, Thé Van LUONG
|
|
||||||
|
|
||||||
This software is governed by the CeCILL license under French law and
|
|
||||||
abiding by the rules of distribution of free software. You can use,
|
|
||||||
modify and/ or redistribute the software under the terms of the CeCILL
|
|
||||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
|
||||||
"http://www.cecill.info".
|
|
||||||
|
|
||||||
As a counterpart to the access to the source code and rights to copy,
|
|
||||||
modify and redistribute granted by the license, users are provided only
|
|
||||||
with a limited warranty and the software's author, the holder of the
|
|
||||||
economic rights, and the successive licensors have only limited liability.
|
|
||||||
|
|
||||||
In this respect, the user's attention is drawn to the risks associated
|
|
||||||
with loading, using, modifying and/or developing or reproducing the
|
|
||||||
software by the user in light of its specific status of free software,
|
|
||||||
that may mean that it is complicated to manipulate, and that also
|
|
||||||
therefore means that it is reserved for developers and experienced
|
|
||||||
professionals having in-depth computer knowledge. Users are therefore
|
|
||||||
encouraged to load and test the software's suitability as regards their
|
|
||||||
requirements in conditions enabling the security of their systems and/or
|
|
||||||
data to be ensured and, more generally, to use and operate it in the
|
|
||||||
same conditions as regards security.
|
|
||||||
The fact that you are presently reading this means that you have had
|
|
||||||
knowledge of the CeCILL license and that you accept its terms.
|
|
||||||
|
|
||||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
|
||||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef moCudaVectorEval_H
|
|
||||||
#define moCudavectorEval_H
|
|
||||||
#include <eval/moCudaEval.h>
|
|
||||||
#include <eval/moCudakernelEval.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* class for the parallel evaluation of neighborhood without mapping
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Neighbor, class IncrementEval>
|
|
||||||
class moCudaVectorEval: public moCudaEval<Neighbor> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define type of a solution corresponding to Neighbor
|
|
||||||
*/
|
|
||||||
typedef typename Neighbor::EOT EOT;
|
|
||||||
/**
|
|
||||||
* Define type of a vector corresponding to Solution
|
|
||||||
*/
|
|
||||||
typedef typename EOT::ElemType T;
|
|
||||||
/**
|
|
||||||
* Define type of a fitness corresponding to Solution
|
|
||||||
*/
|
|
||||||
typedef typename EOT::Fitness Fitness;
|
|
||||||
|
|
||||||
using moCudaEval<Neighbor>::neighborhoodSize;
|
|
||||||
using moCudaEval<Neighbor>::host_FitnessArray;
|
|
||||||
using moCudaEval<Neighbor>::device_FitnessArray;
|
|
||||||
using moCudaEval<Neighbor>::device_solution;
|
|
||||||
using moCudaEval<Neighbor>::kernel_Dim;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
* @param _neighborhoodSize the size of the neighborhood
|
|
||||||
* @param _incrEval the incremental evaluation
|
|
||||||
*/
|
|
||||||
|
|
||||||
moCudaVectorEval(unsigned int _neighborhoodSize, IncrementEval & _incrEval) :
|
|
||||||
moCudaEval<Neighbor> (_neighborhoodSize), incrEval(_incrEval) {
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Compute fitness for all solution neighbors in device
|
|
||||||
* @param _sol the solution which generate the neighborhood
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual void neighborhoodEval(EOT & _sol) {
|
|
||||||
|
|
||||||
// the solution vector size
|
|
||||||
unsigned _size = _sol.size();
|
|
||||||
|
|
||||||
// Get Current solution fitness
|
|
||||||
Fitness fitness = _sol.fitness();
|
|
||||||
|
|
||||||
//Allocate the space for solution in the global memory of device
|
|
||||||
cudaMalloc((void**) &device_solution.vect, _size * sizeof(T));
|
|
||||||
|
|
||||||
//Copy the solution vector from the host to device
|
|
||||||
cudaMemcpy(device_solution.vect, _sol.vect, _size * sizeof(T),
|
|
||||||
cudaMemcpyHostToDevice);
|
|
||||||
|
|
||||||
//Launch the Kernel to compute all neighbors fitness
|
|
||||||
kernelEval<EOT,Fitness,Neighbor,IncrementEval><<<kernel_Dim,BLOCK_SIZE >>>(incrEval,device_solution,device_FitnessArray,fitness,neighborhoodSize);
|
|
||||||
|
|
||||||
//Copy the result from device to host
|
|
||||||
cudaMemcpy(host_FitnessArray, device_FitnessArray, neighborhoodSize
|
|
||||||
* sizeof(Fitness), cudaMemcpyDeviceToHost);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
IncrementEval & incrEval;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue