git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2567 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
97420e84f3
commit
aefc42cf54
110 changed files with 0 additions and 12792 deletions
|
|
@ -1,5 +0,0 @@
|
||||||
Authors:
|
|
||||||
Boufaras Karima
|
|
||||||
Thé Van Luong
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,131 +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(test)
|
|
||||||
ADD_SUBDIRECTORY(tutorial)
|
|
||||||
|
|
||||||
######################################################################################
|
|
||||||
|
|
||||||
|
|
@ -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,81 +0,0 @@
|
||||||
PARADISEO-GPU README FILE
|
|
||||||
=======================================================================
|
|
||||||
check latest news at http://paradiseo.gforge.inria.fr/
|
|
||||||
=======================================================================
|
|
||||||
|
|
||||||
Welcome to ParadisEO-GPU, the reusable design and implementation of parallel meta-
|
|
||||||
heuristics on Graphics Processing Units (GPU).
|
|
||||||
The latest news about ParadisEO-GPU can be found on the gforge repository at
|
|
||||||
http://paradiseo.gforge.inria.fr/index.php?n=Doc.API
|
|
||||||
In case of any problem, please e-mail us at
|
|
||||||
paradiseo-help@lists.gforge.inria.fr
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=======================================================================
|
|
||||||
BUILDING PARADISEO-PEO
|
|
||||||
=======================================================================
|
|
||||||
The basic installation procedure goes the following.
|
|
||||||
|
|
||||||
To compile paradiseo-gpu in the default directory,
|
|
||||||
go to paradiseo-gpu/build/ and run:
|
|
||||||
> cmake ..
|
|
||||||
> make
|
|
||||||
// for an easy-use of the provided lessons
|
|
||||||
> make install
|
|
||||||
// optional (if the documentation is not already available)
|
|
||||||
> make doc
|
|
||||||
|
|
||||||
To compile paradiseo-peo anywhere else, simply run:
|
|
||||||
> cmake $(GPU) -Dconfig=<path to the install.cmake file>
|
|
||||||
> make
|
|
||||||
// for an easy-use of the provided lessons
|
|
||||||
> make install
|
|
||||||
// optional (if the documentation is not already available)
|
|
||||||
> make doc
|
|
||||||
|
|
||||||
To clean everything, simply run
|
|
||||||
> make clean
|
|
||||||
|
|
||||||
|
|
||||||
===================================================================
|
|
||||||
DIRECTORY STRUCTURE
|
|
||||||
===================================================================
|
|
||||||
After unpacking the archive file, you should end up with the following
|
|
||||||
structure:
|
|
||||||
|
|
||||||
.../ The main PARADISEO-GPU directory, created when unpacking.
|
|
||||||
|
|
|
||||||
+-- build BUILD directory that contains libraries and executable files.
|
|
||||||
|
|
|
||||||
+-- src SOURCE directory Contains most PARADISEO-GPU .h files.
|
|
||||||
|
|
|
||||||
+-- doc DOCUMENTATION directory (generated by Doxygen).
|
|
||||||
| |
|
|
||||||
| +- html HTML files - start at index.html.
|
|
||||||
| |
|
|
||||||
| +- latex latex files - use to generate Postcript doc.
|
|
||||||
| |
|
|
||||||
| +- man Unix man format documentation.
|
|
||||||
|
|
|
||||||
|
|
|
||||||
+-- tutorial APPLICATIONS
|
|
||||||
|
|
|
||||||
+-- INSTANCES The instances problem directory (QAP instances ...)
|
|
||||||
|
|
|
||||||
+-- OneMax How make One max problem with parallel evalution of neighborhood(bit flipping) with hamming distances =1
|
|
||||||
|
|
|
||||||
+-- KswapOneMax How make One max problem with parallel evalution of neighborhood(bit flipping) with hamming distances >=1
|
|
||||||
|
|
|
||||||
+-- PPP_GPU How make Permuted Perceptron Problem with parallel evalution of neighborhood on GPU
|
|
||||||
|
|
|
||||||
+-- QAP_GPU How make Quadratic Assignement Problem with parallel evaluation of neighborhood on GPU
|
|
||||||
|
|
|
||||||
+-- QAP_CPU How make Quadratic Assignement Problem with sequentiel evaluation of neighborhood on CPU
|
|
||||||
|
|
||||||
|
|
||||||
===================================================================
|
|
||||||
NOTES
|
|
||||||
===================================================================
|
|
||||||
|
|
||||||
Mailing list : paradiseo-help@lists.gforge.inria.fr
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
##########################################################################################
|
|
||||||
### Doc generation using Doxygen
|
|
||||||
##########################################################################################
|
|
||||||
|
|
||||||
IF (DOXYGEN_FOUND)
|
|
||||||
|
|
||||||
SET(DOC_DIR ${CMAKE_BINARY_DIR}/doc CACHE PATH "GPU documentation directory")
|
|
||||||
SET(GPU_DOC_CONFIG_FILE "doxyfile" CACHE PATH "GPU documentation configuration file")
|
|
||||||
# define the doc target
|
|
||||||
IF (DOXYGEN_EXECUTABLE)
|
|
||||||
ADD_CUSTOM_TARGET(doc
|
|
||||||
COMMAND ${DOXYGEN_EXECUTABLE} ${GPU_DOC_CONFIG_FILE}
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
)
|
|
||||||
ENDIF (DOXYGEN_EXECUTABLE)
|
|
||||||
|
|
||||||
# configure doxyfile file
|
|
||||||
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/doc/${GPU_DOC_CONFIG_FILE}.cmake"
|
|
||||||
"${CMAKE_BINARY_DIR}/doc/${GPU_DOC_CONFIG_FILE}")
|
|
||||||
|
|
||||||
ELSE (DOXYGEN_FOUND)
|
|
||||||
MESSAGE(STATUS "Unable to generate the documentation, Doxygen package not found")
|
|
||||||
ENDIF (DOXYGEN_FOUND)
|
|
||||||
|
|
||||||
##########################################################################################
|
|
||||||
|
|
@ -1,274 +0,0 @@
|
||||||
# Doxyfile 1.7.1
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Project related configuration options
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
DOXYFILE_ENCODING = UTF-8
|
|
||||||
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 = YES
|
|
||||||
FULL_PATH_NAMES = NO
|
|
||||||
STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@
|
|
||||||
STRIP_FROM_INC_PATH =
|
|
||||||
SHORT_NAMES = NO
|
|
||||||
JAVADOC_AUTOBRIEF = YES
|
|
||||||
QT_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
|
|
||||||
OPTIMIZE_FOR_FORTRAN = NO
|
|
||||||
OPTIMIZE_OUTPUT_VHDL = NO
|
|
||||||
BUILTIN_STL_SUPPORT = YES
|
|
||||||
CPP_CLI_SUPPORT = NO
|
|
||||||
SIP_SUPPORT = NO
|
|
||||||
IDL_PROPERTY_SUPPORT = YES
|
|
||||||
TYPEDEF_HIDES_STRUCT = NO
|
|
||||||
SYMBOL_CACHE_SIZE = 0
|
|
||||||
EXTENSION_MAPPING =
|
|
||||||
BUILTIN_STL_SUPPORT = NO
|
|
||||||
DISTRIBUTE_GROUP_DOC = NO
|
|
||||||
SUBGROUPING = YES
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Build related configuration options
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
EXTRACT_ALL = NO
|
|
||||||
EXTRACT_PRIVATE = YES
|
|
||||||
EXTRACT_STATIC = YES
|
|
||||||
EXTRACT_LOCAL_CLASSES = YES
|
|
||||||
EXTRACT_LOCAL_METHODS = NO
|
|
||||||
EXTRACT_ANON_NSPACES = NO
|
|
||||||
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_GROUP_NAMES = 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 = YES
|
|
||||||
SHOW_FILES = YES
|
|
||||||
SHOW_NAMESPACES = YES
|
|
||||||
FILE_VERSION_FILTER =
|
|
||||||
LAYOUT_FILE =
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# 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@
|
|
||||||
INPUT_ENCODING = UTF-8
|
|
||||||
FILE_PATTERNS = *.cu \
|
|
||||||
*.cpp \
|
|
||||||
*.h \
|
|
||||||
NEWS README
|
|
||||||
RECURSIVE = YES
|
|
||||||
EXCLUDE =
|
|
||||||
EXCLUDE_SYMLINKS = NO
|
|
||||||
EXCLUDE_PATTERNS =
|
|
||||||
EXCLUDE_SYMBOLS = *::*
|
|
||||||
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 = moGPU
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# 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
|
|
||||||
HTML_DYNAMIC_SECTIONS = NO
|
|
||||||
GENERATE_DOCSET = NO
|
|
||||||
DOCSET_FEEDNAME = "Doxygen generated docs"
|
|
||||||
DOCSET_BUNDLE_ID = org.doxygen.Project
|
|
||||||
CHM_FILE =
|
|
||||||
HHC_LOCATION =
|
|
||||||
GENERATE_CHI = NO
|
|
||||||
CHM_INDEX_ENCODING =
|
|
||||||
GENERATE_QHP = NO
|
|
||||||
QCH_FILE =
|
|
||||||
QHP_NAMESPACE =
|
|
||||||
QHP_VIRTUAL_FOLDER = doc
|
|
||||||
QHP_CUST_FILTER_NAME =
|
|
||||||
QHP_CUST_FILTER_ATTRS =
|
|
||||||
QHG_LOCATION =
|
|
||||||
DISABLE_INDEX = NO
|
|
||||||
ENUM_VALUES_PER_LINE = 4
|
|
||||||
GENERATE_TREEVIEW = YES
|
|
||||||
TREEVIEW_WIDTH = 250
|
|
||||||
FORMULA_FONTSIZE = 10
|
|
||||||
BINARY_TOC = NO
|
|
||||||
TOC_EXPAND = NO
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# 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
|
|
||||||
MSCGEN_PATH =
|
|
||||||
HIDE_UNDOC_RELATIONS = YES
|
|
||||||
HAVE_DOT = YES
|
|
||||||
DOT_FONTNAME = FreeSans
|
|
||||||
CLASS_GRAPH = YES
|
|
||||||
COLLABORATION_GRAPH = NO
|
|
||||||
GROUP_GRAPHS = YES
|
|
||||||
UML_LOOK = YES
|
|
||||||
TEMPLATE_RELATIONS = YES
|
|
||||||
INCLUDE_GRAPH = YES
|
|
||||||
INCLUDED_BY_GRAPH = YES
|
|
||||||
CALL_GRAPH = NO
|
|
||||||
CALLER_GRAPH = NO
|
|
||||||
GRAPHICAL_HIERARCHY = YES
|
|
||||||
DIRECTORY_GRAPH = YES
|
|
||||||
DOT_IMAGE_FORMAT = png
|
|
||||||
DOT_PATH =
|
|
||||||
DOTFILE_DIRS =
|
|
||||||
DOT_GRAPH_MAX_NODES = 50
|
|
||||||
MAX_DOT_GRAPH_DEPTH = 0
|
|
||||||
DOT_TRANSPARENT = NO
|
|
||||||
DOT_MULTI_TARGETS = NO
|
|
||||||
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,25 +0,0 @@
|
||||||
#######################################################################################
|
|
||||||
### Paths to EO, MO, GPU, MOEO and CUDA must be specified above.
|
|
||||||
#######################################################################################
|
|
||||||
|
|
||||||
SET(EO_SRC_DIR "${CMAKE_SOURCE_DIR}/../paradiseo-eo" CACHE PATH "ParadisEO-EO source directory" FORCE)
|
|
||||||
SET(EO_BIN_DIR "${CMAKE_BINARY_DIR}/../../paradiseo-eo/build" CACHE PATH "ParadisEO-EO binary directory" FORCE)
|
|
||||||
|
|
||||||
SET(MO_SRC_DIR "${CMAKE_SOURCE_DIR}/../paradiseo-mo" CACHE PATH "ParadisMO-MO source directory" FORCE)
|
|
||||||
SET(MO_BIN_DIR "${CMAKE_BINARY_DIR}/../../paradiseo-mo/build" CACHE PATH "ParadisMO-MO binary directory" FORCE)
|
|
||||||
|
|
||||||
SET(GPU_SRC_DIR "${CMAKE_SOURCE_DIR}/../paradiseo-gpu" CACHE PATH "ParadisEO-GPU source directory" FORCE)
|
|
||||||
SET(GPU_BIN_DIR "${CMAKE_BINARY_DIR}/../../paradiseo-gpu/build" CACHE PATH "ParadisEO-GPU binary directory" FORCE)
|
|
||||||
|
|
||||||
|
|
||||||
SET(OLDMO_SRC_DIR "${CMAKE_SOURCE_DIR}/../paradiseo-old-mo" CACHE PATH "ParadisMO-MO source directory" FORCE)
|
|
||||||
SET(OLDMO_BIN_DIR "${CMAKE_BINARY_DIR}/../../paradiseo-old-mo/build" CACHE PATH "ParadisMO-MO binary directory" FORCE)
|
|
||||||
|
|
||||||
SET(MOEO_SRC_DIR "${CMAKE_SOURCE_DIR}/../paradiseo-moeo" CACHE PATH "ParadisMOEO-MOEO source directory" FORCE)
|
|
||||||
SET(MOEO_BIN_DIR "${CMAKE_BINARY_DIR}/../../paradiseo-moeo/build" CACHE PATH "ParadisMOEO-MOEO binary directory" FORCE)
|
|
||||||
|
|
||||||
SET(PROBLEMS_SRC_DIR "${CMAKE_SOURCE_DIR}/../problems" CACHE PATH "Problems dependant source directory" FORCE)
|
|
||||||
|
|
||||||
SET(CUDA_DIR "/usr/local/cuda" CACHE PATH "cuda directory" FORCE)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
###############################################################
|
|
||||||
# This is a dummy file
|
|
||||||
###############################################################
|
|
||||||
|
|
@ -1,141 +0,0 @@
|
||||||
/*
|
|
||||||
<moGPUBitVector.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 __moGPUBitVector_H_
|
|
||||||
#define __moGPUBitVector_H_
|
|
||||||
|
|
||||||
#include <GPUType/moGPUVector.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of Bit vector representation on GPU.
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Fitness>
|
|
||||||
|
|
||||||
class moGPUBitVector: public moGPUVector<bool, Fitness> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define bool vector corresponding to Solution
|
|
||||||
**/
|
|
||||||
typedef bool ElemType;
|
|
||||||
using moGPUVector<bool, Fitness>::vect;
|
|
||||||
using moGPUVector<bool, Fitness>::N;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default constructor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUBitVector() :
|
|
||||||
moGPUVector<bool, Fitness> () {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Constructor.
|
|
||||||
*@param _neighborhoodSize The neighborhood size.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUBitVector(unsigned _neighborhoodSize) :
|
|
||||||
moGPUVector<bool, Fitness> (_neighborhoodSize) {
|
|
||||||
create();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Constructor.
|
|
||||||
*@param _neighborhoodSize The neighborhood size.
|
|
||||||
*@param _b Value to assign to vector.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUBitVector(unsigned _neighborhoodSize, bool _b) :
|
|
||||||
moGPUVector<bool, Fitness> (_neighborhoodSize) {
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < _neighborhoodSize; i++)
|
|
||||||
vect[i] = _b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Initializer of random bit vector.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void create() {
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < N; i++) {
|
|
||||||
|
|
||||||
vect[i] = (int) (rng.rand() / RAND_MAX);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Function inline to set the size of vector, called from host.
|
|
||||||
*@param _size the vector size
|
|
||||||
*/
|
|
||||||
|
|
||||||
void setSize(unsigned _size) {
|
|
||||||
|
|
||||||
if (_size < N) {
|
|
||||||
moGPUBitVector<Fitness> tmp_vect(_size);
|
|
||||||
for (unsigned i = 0; i < tmp_vect.N; i++)
|
|
||||||
tmp_vect.vect[i] = vect[i];
|
|
||||||
(tmp_vect).invalidate();
|
|
||||||
(*this) = tmp_vect;
|
|
||||||
} else if (_size > N) {
|
|
||||||
moGPUBitVector<Fitness> tmp_vect(_size);
|
|
||||||
for (unsigned i = 0; i < N; i++)
|
|
||||||
tmp_vect.vect[i] = vect[i];
|
|
||||||
(tmp_vect).invalidate();
|
|
||||||
(*this) = tmp_vect;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write object. Called printOn since it prints the object _on_ a stream.
|
|
||||||
* @param _os A std::ostream.
|
|
||||||
*/
|
|
||||||
void printOn(std::ostream& _os) const {
|
|
||||||
EO<Fitness>::printOn(_os);
|
|
||||||
_os << ' ';
|
|
||||||
_os << N << ' ';
|
|
||||||
for (unsigned int i = 0; i < N; i++)
|
|
||||||
_os << (*this)[i] << ' ';
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,122 +0,0 @@
|
||||||
/*
|
|
||||||
<moGPUIntVector.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 __moGPUIntVector_H_
|
|
||||||
#define __moGPUIntVector_H_
|
|
||||||
|
|
||||||
#include <GPUType/moGPUVector.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of integer vector representation on GPU.
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Fitness>
|
|
||||||
|
|
||||||
class moGPUIntVector: public moGPUVector<int, Fitness> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
using moGPUVector<int, Fitness>::vect;
|
|
||||||
using moGPUVector<int, Fitness>::N;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default constructor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUIntVector() :
|
|
||||||
moGPUVector<int, Fitness> () {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Constructor.
|
|
||||||
*@param _neighborhoodSize The neighborhood size.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUIntVector(unsigned _neighborhoodSize) :
|
|
||||||
moGPUVector<int, Fitness> (_neighborhoodSize) {
|
|
||||||
create();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Initializer of random integer vector.
|
|
||||||
*/
|
|
||||||
virtual void create() {
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < N; i++)
|
|
||||||
vect[i] = ((int) (rng.rand())) % N + 1;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Function inline to set the size of vector, called from host.
|
|
||||||
*@param _size the vector size
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual inline __host__ void setSize(unsigned _size) {
|
|
||||||
|
|
||||||
if(N==_size)
|
|
||||||
return;
|
|
||||||
moGPUIntVector<Fitness> tmp_vect(_size);
|
|
||||||
if(_size<N) {
|
|
||||||
for (unsigned i = 0; i < tmp_vect.N; i++)
|
|
||||||
tmp_vect.vect[i]= vect[i];
|
|
||||||
}
|
|
||||||
else if(_size>N) {
|
|
||||||
for (unsigned i = 0; i <N; i++)
|
|
||||||
tmp_vect.vect[i]= vect[i];
|
|
||||||
}
|
|
||||||
(tmp_vect).invalidate();
|
|
||||||
(*this)=tmp_vect;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write object. Called printOn since it prints the object _on_ a stream.
|
|
||||||
* @param _os A std::ostream.
|
|
||||||
*/
|
|
||||||
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,92 +0,0 @@
|
||||||
/*
|
|
||||||
<moGPUPermutationVector.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 __moGPUPermutationVector_H_
|
|
||||||
#define __moGPUPermutationVector_H_
|
|
||||||
|
|
||||||
#include <GPUType/moGPUIntVector.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of Permutation vector representation on GPU.
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Fitness>
|
|
||||||
|
|
||||||
class moGPUPermutationVector: public moGPUIntVector<Fitness> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
using moGPUIntVector<Fitness>::vect;
|
|
||||||
using moGPUIntVector<Fitness>::N;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default constructor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUPermutationVector() :
|
|
||||||
moGPUIntVector<Fitness> () {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Constructor.
|
|
||||||
*@param _size The solution size.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUPermutationVector(unsigned _size) :
|
|
||||||
moGPUIntVector<Fitness> (_size) {
|
|
||||||
create();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*Initializer of random permuatation vector.
|
|
||||||
*/
|
|
||||||
void create() {
|
|
||||||
|
|
||||||
unsigned random;
|
|
||||||
int tmp;
|
|
||||||
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;
|
|
||||||
tmp = vect[i];
|
|
||||||
vect[i] = vect[random];
|
|
||||||
vect[random] = tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,123 +0,0 @@
|
||||||
/*
|
|
||||||
<moGPURealVector.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 __moGPURealVector_H_
|
|
||||||
#define __moGPURealVector_H_
|
|
||||||
|
|
||||||
#include <GPUType/moGPUVector.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of real vector representation on GPU.
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Fitness>
|
|
||||||
|
|
||||||
class moGPURealVector: public moGPUVector<float, Fitness> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
using moGPUVector<float, Fitness>::vect;
|
|
||||||
using moGPUVector<float, Fitness>::N;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default constructor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPURealVector() :
|
|
||||||
moGPUVector<float, Fitness> () {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Constructor.
|
|
||||||
*@param _neighborhoodSize The neighborhood size.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPURealVector(unsigned _neighborhoodSize) :
|
|
||||||
moGPUVector<float, Fitness> (_neighborhoodSize) {
|
|
||||||
create();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Initializer of random real vector.
|
|
||||||
*/
|
|
||||||
void create() {
|
|
||||||
for (unsigned i = 0; i < N; i++)
|
|
||||||
vect[i] = (float) rng.rand() / RAND_MAX;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Function inline to set the size of vector, called from host.
|
|
||||||
*@param _size the vector size
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual inline __host__ void setSize(unsigned _size) {
|
|
||||||
|
|
||||||
if(_size<N) {
|
|
||||||
moGPURealVector<Fitness> tmp_vect(_size);
|
|
||||||
for (unsigned i = 0; i < tmp_vect.N; i++)
|
|
||||||
tmp_vect.vect[i]= vect[i];
|
|
||||||
(tmp_vect).invalidate();
|
|
||||||
(*this)=tmp_vect;
|
|
||||||
}
|
|
||||||
else if(_size>N) {
|
|
||||||
moGPURealVector<Fitness> tmp_vect(_size);
|
|
||||||
for (unsigned i = 0; i <N; i++)
|
|
||||||
tmp_vect.vect[i]= vect[i];
|
|
||||||
(tmp_vect).invalidate();
|
|
||||||
(*this)=tmp_vect;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write object. Called printOn since it prints the object _on_ a stream.
|
|
||||||
* @param _os A std::ostream.
|
|
||||||
*/
|
|
||||||
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,184 +0,0 @@
|
||||||
/*
|
|
||||||
<moGPUVector.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 __moGPUVector_H_
|
|
||||||
#define __moGPUVector_H_
|
|
||||||
|
|
||||||
#include <eo>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of a GPU solution representation.
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class ElemT, class Fitness>
|
|
||||||
|
|
||||||
class moGPUVector: public EO<Fitness> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define vector type corresponding to Solution
|
|
||||||
*/
|
|
||||||
typedef ElemT ElemType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default constructor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUVector() :
|
|
||||||
N(0) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Constructor.
|
|
||||||
*@param _size The solution size.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUVector(unsigned _size) :
|
|
||||||
N(_size) {
|
|
||||||
vect = new ElemType[N];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Copy Constructor
|
|
||||||
*@param _vector The vector passed to the function to determine the new content.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUVector(const moGPUVector & _vector) {
|
|
||||||
|
|
||||||
N = _vector.N;
|
|
||||||
vect = new ElemType[N];
|
|
||||||
for (unsigned i = 0; i < N; i++)
|
|
||||||
vect[i] = _vector.vect[i];
|
|
||||||
if (!(_vector.invalid()))
|
|
||||||
fitness(_vector.fitness());
|
|
||||||
else
|
|
||||||
(*this).invalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destructor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
~moGPUVector() {
|
|
||||||
if (N >= 1)
|
|
||||||
delete[] vect;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*How to fill the solution vector.
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual void create() =0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*Assignment operator
|
|
||||||
*@param _vector The vector passed to the function to determine the new content.
|
|
||||||
*@return a new vector.
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUVector& operator=(const moGPUVector & _vector) {
|
|
||||||
|
|
||||||
if (!(N == _vector.N)) {
|
|
||||||
N = _vector.N;
|
|
||||||
vect = new ElemType[N];
|
|
||||||
}
|
|
||||||
for (unsigned i = 0; i < N; i++){
|
|
||||||
vect[i] = _vector[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(_vector.invalid()))
|
|
||||||
fitness(_vector.fitness());
|
|
||||||
else
|
|
||||||
(*this).invalidate();
|
|
||||||
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;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* method to set the size of vector
|
|
||||||
*@param _size the vector size
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual void setSize(unsigned _size)=0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write object. Called printOn since it prints the object _on_ a stream.
|
|
||||||
* @param _os A std::ostream.
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual void printOn(std::ostream& _os) const=0;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
ElemType * vect;
|
|
||||||
unsigned N;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,146 +0,0 @@
|
||||||
/*
|
|
||||||
<moGPUEval.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 moGPUEval_H
|
|
||||||
#define moGPUEval_H
|
|
||||||
#include <eval/moEval.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Abstract class for evaluation on GPU
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Neighbor>
|
|
||||||
class moGPUEval: public moEval<Neighbor> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define type of a solution corresponding to Neighbor
|
|
||||||
**/
|
|
||||||
typedef typename Neighbor::EOT EOT;
|
|
||||||
/**
|
|
||||||
* Define type of a fitness corresponding to Solution
|
|
||||||
**/
|
|
||||||
typedef typename EOT::Fitness Fitness;
|
|
||||||
/**
|
|
||||||
* Define type of a vector corresponding to Solution
|
|
||||||
*/
|
|
||||||
typedef typename EOT::ElemType T;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
* @param _neighborhoodSize the size of the neighborhood
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUEval(unsigned int _neighborhoodSize) {
|
|
||||||
|
|
||||||
neighborhoodSize = _neighborhoodSize;
|
|
||||||
host_FitnessArray = new Fitness[neighborhoodSize];
|
|
||||||
cudaMalloc((void**) &device_FitnessArray, neighborhoodSize
|
|
||||||
* sizeof(Fitness));
|
|
||||||
mutex = false;
|
|
||||||
#ifdef BLOCK_SIZE
|
|
||||||
NEW_kernel_Dim = neighborhoodSize / BLOCK_SIZE + ((neighborhoodSize
|
|
||||||
% BLOCK_SIZE == 0) ? 0 : 1);
|
|
||||||
NEW_BLOCK_SIZE = BLOCK_SIZE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destructor
|
|
||||||
*/
|
|
||||||
|
|
||||||
~moGPUEval() {
|
|
||||||
|
|
||||||
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 solution neighbors in device
|
|
||||||
* @param _sol the solution which generate the neighborhood
|
|
||||||
* @param _cpySolution Launch kernel with local copy option of solution in each thread
|
|
||||||
* @param _withCalibration an automatic configuration of kernel to launch( NB_THREAD BY BLOCK & NB_BLOCK BY KERNEL ),default (1)
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual void neighborhoodEval(EOT & _sol, bool _cpySolution,
|
|
||||||
bool _withCalibration) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute fitness for all solution neighbors in device
|
|
||||||
* @param _sol the solution which generate the neighborhood
|
|
||||||
* @param _mapping the associated neighborhood mapping
|
|
||||||
* @param _cpySolution Launch kernel with local copy option of solution in each thread
|
|
||||||
* @param _withCalibration an automatic configuration of kernel to launch( NB_THREAD BY BLOCK & NB_BLOCK BY KERNEL ), default (1)
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual void neighborhoodEval(EOT & _sol, unsigned int * _mapping,
|
|
||||||
bool _cpySolution, bool _withCalibration) {
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
//Assure mapping transfer from CPU memory to GPU global memory for once time
|
|
||||||
unsigned mutex;
|
|
||||||
//GPU kernel dimension
|
|
||||||
unsigned NEW_BLOCK_SIZE;
|
|
||||||
unsigned NEW_kernel_Dim;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,200 +0,0 @@
|
||||||
/*
|
|
||||||
<moGPUEvalByCpy.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 __moGPUEvalByCpy_H
|
|
||||||
#define __moGPUEvalByCpy_H
|
|
||||||
|
|
||||||
#include <eval/moGPUEval.h>
|
|
||||||
#include <eval/moGPUKernelEvalByCpy.h>
|
|
||||||
#include <performance/moGPUTimer.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* class for the parallel evaluation of neighborhood
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Neighbor, class Eval>
|
|
||||||
class moGPUEvalByCpy: public moGPUEval<Neighbor> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define type of a solution corresponding to Neighbor
|
|
||||||
**/
|
|
||||||
typedef typename Neighbor::EOT EOT;
|
|
||||||
/**
|
|
||||||
* Define vector type of vector corresponding to Solution
|
|
||||||
**/
|
|
||||||
typedef typename EOT::ElemType T;
|
|
||||||
/**
|
|
||||||
* Define type of a fitness corresponding to Solution
|
|
||||||
**/
|
|
||||||
typedef typename EOT::Fitness Fitness;
|
|
||||||
|
|
||||||
using moGPUEval<Neighbor>::neighborhoodSize;
|
|
||||||
using moGPUEval<Neighbor>::host_FitnessArray;
|
|
||||||
using moGPUEval<Neighbor>::device_FitnessArray;
|
|
||||||
using moGPUEval<Neighbor>::device_solution;
|
|
||||||
using moGPUEval<Neighbor>::NEW_kernel_Dim;
|
|
||||||
using moGPUEval<Neighbor>::NEW_BLOCK_SIZE;
|
|
||||||
using moGPUEval<Neighbor>::mutex;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
* @param _neighborhoodSize the size of the neighborhood
|
|
||||||
* @param _eval how to evaluate a neighbor
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUEvalByCpy(unsigned int _neighborhoodSize, Eval & _eval) :
|
|
||||||
moGPUEval<Neighbor> (_neighborhoodSize), eval(_eval) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute fitness for all solution neighbors in device
|
|
||||||
* @param _sol the solution that generate the neighborhood to evaluate parallely
|
|
||||||
* @param _cpySolution Launch kernel with local copy option of solution in each thread
|
|
||||||
* @param _withCalibration an automatic configuration of kernel to launch( NB_THREAD BY BLOCK & NB_BLOCK BY KERNEL ),default (1)
|
|
||||||
*/
|
|
||||||
|
|
||||||
void neighborhoodEval(EOT & _sol, bool _cpySolution, bool _withCalibration) {
|
|
||||||
|
|
||||||
if (_cpySolution) {
|
|
||||||
unsigned size=_sol.size();
|
|
||||||
if (!mutex) {
|
|
||||||
//Allocate the space for solution in the global memory of device
|
|
||||||
cudaMalloc((void**) &device_solution.vect, size * sizeof(T));
|
|
||||||
if (_withCalibration)
|
|
||||||
calibration(_sol);
|
|
||||||
mutex = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get Current solution fitness
|
|
||||||
Fitness fitness = _sol.fitness();
|
|
||||||
//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 with local copy of solution
|
|
||||||
moGPUKernelEvalByCpy<T,Fitness,Eval><<<NEW_kernel_Dim,NEW_BLOCK_SIZE >>>(eval,device_solution.vect,device_FitnessArray,fitness,neighborhoodSize);
|
|
||||||
|
|
||||||
//Copy the result from device to host
|
|
||||||
cudaMemcpy(host_FitnessArray, device_FitnessArray, neighborhoodSize
|
|
||||||
* sizeof(Fitness), cudaMemcpyDeviceToHost);
|
|
||||||
|
|
||||||
} else
|
|
||||||
cout << "It's evaluation by copy set cpySolution to true" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute the best combination of number of block by grid and number of thread within block
|
|
||||||
* @param _sol the solution that generate the neighborhood to evaluate parallely
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual void calibration(EOT & _sol) {
|
|
||||||
|
|
||||||
unsigned size = _sol.size();
|
|
||||||
Fitness fitness = _sol.fitness();
|
|
||||||
unsigned NB_THREAD[6] = { 16, 32, 64, 128, 256, 512 };
|
|
||||||
double mean_time[7] = { 0, 0, 0, 0, 0, 0 };
|
|
||||||
unsigned i = 0;
|
|
||||||
double best_time = RAND_MAX;
|
|
||||||
unsigned tmp_kernel_Dim;
|
|
||||||
|
|
||||||
#ifndef BLOCK_SIZE
|
|
||||||
|
|
||||||
do {
|
|
||||||
tmp_kernel_Dim = neighborhoodSize / NB_THREAD[i]
|
|
||||||
+ ((neighborhoodSize % NB_THREAD[i] == 0) ? 0 : 1);
|
|
||||||
for (unsigned k = 0; k < 5; k++) {
|
|
||||||
cudaMemcpy(device_solution.vect, _sol.vect, size * sizeof(T),
|
|
||||||
cudaMemcpyHostToDevice);
|
|
||||||
moGPUTimer timer;
|
|
||||||
timer.start();
|
|
||||||
moGPUKernelEvalByCpy<T,Fitness,Eval><<<tmp_kernel_Dim,NB_THREAD[i] >>>(eval,device_solution.vect,device_FitnessArray,fitness,neighborhoodSize);
|
|
||||||
timer.stop();
|
|
||||||
mean_time[i] += (timer.getTime());
|
|
||||||
}
|
|
||||||
if (best_time >= (mean_time[i] / 5)) {
|
|
||||||
best_time = mean_time[i] / 5;
|
|
||||||
NEW_BLOCK_SIZE = NB_THREAD[i];
|
|
||||||
NEW_kernel_Dim = tmp_kernel_Dim;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
} while (i < 6);
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
tmp_kernel_Dim =NEW_kernel_Dim;
|
|
||||||
for (unsigned k = 0; k < 5; k++) {
|
|
||||||
cudaMemcpy(device_solution.vect, _sol.vect, size * sizeof(T),
|
|
||||||
cudaMemcpyHostToDevice);
|
|
||||||
moGPUTimer timer;
|
|
||||||
timer.start();
|
|
||||||
moGPUKernelEvalByCpy<T,Fitness,Eval><<<tmp_kernel_Dim,BLOCK_SIZE >>>(eval,device_solution.vect,device_FitnessArray,fitness,neighborhoodSize);
|
|
||||||
timer.stop();
|
|
||||||
mean_time[6] += (timer.getTime());
|
|
||||||
}
|
|
||||||
if (best_time >= (mean_time[6] / 5))
|
|
||||||
best_time = mean_time[6] / 5;
|
|
||||||
do {
|
|
||||||
tmp_kernel_Dim = neighborhoodSize / NB_THREAD[i]
|
|
||||||
+ ((neighborhoodSize % NB_THREAD[i] == 0) ? 0 : 1);
|
|
||||||
for (unsigned k = 0; k < 5; k++) {
|
|
||||||
cudaMemcpy(device_solution.vect, _sol.vect, size * sizeof(T),
|
|
||||||
cudaMemcpyHostToDevice);
|
|
||||||
moGPUTimer timer;
|
|
||||||
timer.start();
|
|
||||||
moGPUKernelEvalByCpy<T,Fitness,Eval><<<tmp_kernel_Dim,NB_THREAD[i] >>>(eval,device_solution.vect,device_FitnessArray,fitness,neighborhoodSize);
|
|
||||||
timer.stop();
|
|
||||||
mean_time[i] += (timer.getTime());
|
|
||||||
}
|
|
||||||
if (best_time >= (mean_time[i] / 5)) {
|
|
||||||
best_time = mean_time[i] / 5;
|
|
||||||
NEW_BLOCK_SIZE = NB_THREAD[i];
|
|
||||||
NEW_kernel_Dim = tmp_kernel_Dim;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}while (i < 6);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
Eval & eval;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,199 +0,0 @@
|
||||||
/*
|
|
||||||
<moGPUEvalByModif.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 __moGPUEvalByModif_H
|
|
||||||
#define __moGPUEvalByModif_H
|
|
||||||
|
|
||||||
#include <eval/moGPUKernelEvalByModif.h>
|
|
||||||
#include <eval/moGPUEval.h>
|
|
||||||
#include <performance/moGPUTimer.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* class for the parallel evaluation of neighborhood
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Neighbor, class Eval>
|
|
||||||
class moGPUEvalByModif: public moGPUEval<Neighbor> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define type of a solution corresponding to Neighbor
|
|
||||||
**/
|
|
||||||
typedef typename Neighbor::EOT EOT;
|
|
||||||
/**
|
|
||||||
* Define vector type of vector corresponding to Solution
|
|
||||||
**/
|
|
||||||
typedef typename EOT::ElemType T;
|
|
||||||
/**
|
|
||||||
* Define type of a fitness corresponding to Solution
|
|
||||||
**/
|
|
||||||
typedef typename EOT::Fitness Fitness;
|
|
||||||
|
|
||||||
using moGPUEval<Neighbor>::neighborhoodSize;
|
|
||||||
using moGPUEval<Neighbor>::host_FitnessArray;
|
|
||||||
using moGPUEval<Neighbor>::device_FitnessArray;
|
|
||||||
using moGPUEval<Neighbor>::device_solution;
|
|
||||||
using moGPUEval<Neighbor>::NEW_kernel_Dim;
|
|
||||||
using moGPUEval<Neighbor>::NEW_BLOCK_SIZE;
|
|
||||||
using moGPUEval<Neighbor>::mutex;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
* @param _neighborhoodSize the size of the neighborhood
|
|
||||||
* @param _eval the incremental evaluation
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUEvalByModif(unsigned int _neighborhoodSize, Eval & _eval) :
|
|
||||||
moGPUEval<Neighbor> (_neighborhoodSize), eval(_eval) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute fitness for all solution neighbors in device
|
|
||||||
* @param _sol the solution that generate the neighborhood to evaluate parallely
|
|
||||||
* @param _cpySolution Launch kernel with local copy option of solution in each thread
|
|
||||||
* @param _withCalibration an automatic configuration of kernel to launch( NB_THREAD BY BLOCK & NB_BLOCK BY KERNEL ),default (1)
|
|
||||||
*/
|
|
||||||
|
|
||||||
void neighborhoodEval(EOT & _sol, bool _cpySolution, bool _withCalibration) {
|
|
||||||
if (!_cpySolution) {
|
|
||||||
unsigned size = _sol.size();
|
|
||||||
if (!mutex) {
|
|
||||||
//Allocate the space for solution in the global memory of device
|
|
||||||
cudaMalloc((void**) &device_solution.vect, size * sizeof(T));
|
|
||||||
if (_withCalibration)
|
|
||||||
calibration(_sol);
|
|
||||||
mutex = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get Current solution fitness
|
|
||||||
Fitness fitness = _sol.fitness();
|
|
||||||
|
|
||||||
//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
|
|
||||||
moGPUKernelEvalByModif<T,Fitness,Eval><<<NEW_kernel_Dim,NEW_BLOCK_SIZE>>>(eval,device_solution.vect,device_FitnessArray,fitness,neighborhoodSize);
|
|
||||||
|
|
||||||
//Copy the result from device to host
|
|
||||||
cudaMemcpy(host_FitnessArray, device_FitnessArray, neighborhoodSize
|
|
||||||
* sizeof(Fitness), cudaMemcpyDeviceToHost);
|
|
||||||
} else
|
|
||||||
cout << "It's evaluation by Modif set cpySolution to false"
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute the best combination of number of block by grid and number of thread within block
|
|
||||||
* @param _sol the solution that generate the neighborhood to evaluate parallely
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual void calibration(EOT & _sol) {
|
|
||||||
|
|
||||||
unsigned size = _sol.size();
|
|
||||||
Fitness fitness = _sol.fitness();
|
|
||||||
unsigned NB_THREAD[6] = { 16, 32, 64, 128, 256, 512 };
|
|
||||||
double mean_time[7] = { 0, 0, 0, 0, 0, 0 };
|
|
||||||
unsigned i = 0;
|
|
||||||
double best_time = RAND_MAX;
|
|
||||||
unsigned tmp_kernel_Dim;
|
|
||||||
#ifndef BLOCK_SIZE
|
|
||||||
|
|
||||||
do {
|
|
||||||
tmp_kernel_Dim = neighborhoodSize / NB_THREAD[i]
|
|
||||||
+ ((neighborhoodSize % NB_THREAD[i] == 0) ? 0 : 1);
|
|
||||||
for (unsigned k = 0; k < 5; k++) {
|
|
||||||
cudaMemcpy(device_solution.vect, _sol.vect, size * sizeof(T),
|
|
||||||
cudaMemcpyHostToDevice);
|
|
||||||
moGPUTimer timer;
|
|
||||||
timer.start();
|
|
||||||
moGPUKernelEvalByModif<T,Fitness,Eval><<<tmp_kernel_Dim,NB_THREAD[i]>>>(eval,device_solution.vect,device_FitnessArray,fitness,neighborhoodSize);
|
|
||||||
timer.stop();
|
|
||||||
mean_time[i] += (timer.getTime());
|
|
||||||
}
|
|
||||||
if (best_time >= (mean_time[i] / 5)) {
|
|
||||||
best_time = mean_time[i] / 5;
|
|
||||||
NEW_BLOCK_SIZE = NB_THREAD[i];
|
|
||||||
NEW_kernel_Dim = tmp_kernel_Dim;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
} while (i < 6);
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
tmp_kernel_Dim =NEW_kernel_Dim;
|
|
||||||
for (unsigned k = 0; k < 5; k++) {
|
|
||||||
cudaMemcpy(device_solution.vect, _sol.vect, size * sizeof(T),
|
|
||||||
cudaMemcpyHostToDevice);
|
|
||||||
moGPUTimer timer;
|
|
||||||
timer.start();
|
|
||||||
moGPUKernelEvalByModif<T,Fitness,Eval><<<tmp_kernel_Dim,BLOCK_SIZE>>>(eval,device_solution.vect,device_FitnessArray,fitness,neighborhoodSize);
|
|
||||||
timer.stop();
|
|
||||||
mean_time[6] += (timer.getTime());
|
|
||||||
}
|
|
||||||
if (best_time >= (mean_time[6] / 5))
|
|
||||||
best_time = mean_time[6] / 5;
|
|
||||||
do {
|
|
||||||
tmp_kernel_Dim = neighborhoodSize / NB_THREAD[i]
|
|
||||||
+ ((neighborhoodSize % NB_THREAD[i] == 0) ? 0 : 1);
|
|
||||||
for (unsigned k = 0; k < 5; k++) {
|
|
||||||
cudaMemcpy(device_solution.vect, _sol.vect, size * sizeof(T),
|
|
||||||
cudaMemcpyHostToDevice);
|
|
||||||
moGPUTimer timer;
|
|
||||||
timer.start();
|
|
||||||
moGPUKernelEvalByModif<T,Fitness,Eval><<<tmp_kernel_Dim,NB_THREAD[i]>>>(eval,device_solution.vect,device_FitnessArray,fitness,neighborhoodSize);
|
|
||||||
timer.stop();
|
|
||||||
mean_time[i] += (timer.getTime());
|
|
||||||
}
|
|
||||||
if (best_time >= (mean_time[i] / 5)) {
|
|
||||||
best_time = mean_time[i] / 5;
|
|
||||||
NEW_BLOCK_SIZE = NB_THREAD[i];
|
|
||||||
NEW_kernel_Dim = tmp_kernel_Dim;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}while (i < 6);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
Eval & eval;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
/*
|
|
||||||
<moGPUEvalFunc.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 __moGPUEvalFunc_H
|
|
||||||
#define __moGPUEvalFunc_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Abstract class for GPU evaluation of neighbor
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Neighbor>
|
|
||||||
class moGPUEvalFunc {
|
|
||||||
|
|
||||||
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
|
|
||||||
*/
|
|
||||||
|
|
||||||
moGPUEvalFunc() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destructor
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual ~moGPUEvalFunc() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*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 an array that contains a set of indexes corresponding to the current thread identifier neighbor
|
|
||||||
* the last element of this array contains neighborhood size
|
|
||||||
*/
|
|
||||||
|
|
||||||
virtual inline __host__ __device__ Fitness operator() (T * _solution,Fitness _fitness, unsigned int * _index) {
|
|
||||||
|
|
||||||
return _fitness;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
/*
|
|
||||||
<moGPUKernelEvalByCpy.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 __moGPUKernelEvalByCpy_H
|
|
||||||
#define __moGPUKernelEvalByCpy_H
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The kernel function called from the host and executed in device to compute all neighbors fitness at one time
|
|
||||||
* without mapping, each thread id compute one fitness by copying localy the solution
|
|
||||||
* @param _eval how to evaluate each neighbor
|
|
||||||
* @param _solution the representation of solution( vector of int,float....)
|
|
||||||
* @param _allFitness the array of Fitness to save all neighbors fitness
|
|
||||||
* @param _fitness the current solution fitness
|
|
||||||
* @param _neighborhoodsize the size of the neighborhood
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class T, class Fitness, class Eval>
|
|
||||||
|
|
||||||
__global__ void moGPUKernelEvalByCpy(Eval _eval, T * _solution, Fitness* _allFitness,
|
|
||||||
Fitness _fitness, unsigned _neighborhoodsize) {
|
|
||||||
|
|
||||||
// The thread identifier within a grid block's
|
|
||||||
int id = blockIdx.x * blockDim.x + threadIdx.x;
|
|
||||||
// array to save index to be changed
|
|
||||||
unsigned index[2];
|
|
||||||
T sol_tmp[SIZE];
|
|
||||||
// In this representation each id identify one and only one neighbor in neighborhood
|
|
||||||
if (id < _neighborhoodsize) {
|
|
||||||
for(unsigned i=0;i<SIZE;i++)
|
|
||||||
sol_tmp[i]=_solution[i];
|
|
||||||
//Change the id'th element of solution
|
|
||||||
index[0]=id;
|
|
||||||
index[1]=_neighborhoodsize;
|
|
||||||
//Compute fitness for id'th neighbor
|
|
||||||
_allFitness[id] = _eval(sol_tmp,_fitness,index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue