Notice to GitKraken users: A vulnerability has been found in the SSH key generation of GitKraken versions 7.6.0 to 8.0.0 (https://www.gitkraken.com/blog/weak-ssh-key-fix). If you use GitKraken and have generated a SSH key using one of these versions, please remove it both from your local workstation and from your LRZ GitLab profile.

21.10.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit b77f179e authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Remove (never used and taken care of) OpenCL support and KissCL library from CAMPVis.

parent 287bdc91
......@@ -17,7 +17,6 @@ OPTION(CAMPVIS_BUILD_APPLICATION "Build CAMPVis Application"
OPTION(CAMPVIS_BUILD_CORE "Build CAMPVis Core" ON)
OPTION(CAMPVIS_BUILD_MODULES "Build CAMPVis Modules" ON)
OPTION(CAMPVIS_BUILD_LIB_TGT "Build TGT Library" ON)
OPTION(CAMPVIS_BUILD_LIB_KISSCL "Build KissCL Library" OFF)
OPTION(CAMPVIS_BUILD_DOXYGEN "Build Doxygen Documentation" OFF)
OPTION(CAMPVIS_DEPLOY_SHADERS "Deploy Shader files to binary directory" OFF)
......@@ -41,11 +40,6 @@ IF(CAMPVIS_BUILD_LIB_TGT)
ADD_SUBDIRECTORY(ext/tgt)
ENDIF()
IF(CAMPVIS_BUILD_LIB_KISSCL)
LIST(APPEND CampvisGlobalDefinitions "-DHAS_KISSCL")
ADD_SUBDIRECTORY(ext/kisscl)
ENDIF()
IF(CAMPVIS_BUILD_CORE)
ADD_SUBDIRECTORY(core)
ENDIF()
......
......@@ -34,10 +34,6 @@
#include "tgt/qt/qtcontextmanager.h"
#include "tbb/compat/thread"
#ifdef HAS_KISSCL
#include "kisscl/clruntime.h"
#endif
#include "application/campvispainter.h"
#include "application/gui/mainwindow.h"
#include "core/tools/opengljobprocessor.h"
......@@ -51,12 +47,11 @@ namespace campvis {
const std::string CampVisApplication::loggerCat_ = "CAMPVis.application.CampVisApplication";
CampVisApplication::CampVisApplication(int& argc, char** argv, bool useOpenCL)
CampVisApplication::CampVisApplication(int& argc, char** argv)
: QApplication(argc, argv)
, _localContext(0)
, _mainWindow(0)
, _initialized(false)
, _useOpenCL(useOpenCL)
, _argc(argc)
, _argv(argv)
{
......@@ -124,13 +119,7 @@ namespace campvis {
}
QuadRenderer::init();
#ifdef HAS_KISSCL
if (_useOpenCL) {
kisscl::CLRuntime::init();
}
#endif
if (_argc > 0) {
// ugly hack
std::string basePath(_argv[0]);
......@@ -148,22 +137,6 @@ namespace campvis {
ShdrMgr.addPath(sourcePath);
ShdrMgr.addPath(sourcePath + "/core/glsl");
}
#endif
#ifdef HAS_KISSCL
if (_useOpenCL) {
CLRtm.addPath(basePath);
CLRtm.addPath(basePath + "/core/cl");
}
#ifdef CAMPVIS_SOURCE_DIR
{
std::string sourcePath = CAMPVIS_SOURCE_DIR;
CLRtm.addPath(sourcePath);
CLRtm.addPath(sourcePath + "/core/glsl");
}
#endif
#endif
}
......@@ -203,16 +176,8 @@ namespace campvis {
}
_mainWindow->deinit();
QuadRenderer::deinit();
#ifdef HAS_KISSCL
if (_useOpenCL) {
kisscl::CLRuntime::deinit();
}
#endif
// deinit OpenGL and tgt
tgt::deinitGL();
}
......
......@@ -65,9 +65,8 @@ namespace campvis {
* Creates a new CampVisApplication.
* \param argc number of passed arguments
* \param argv vector of arguments
* \param useOpenCL Flag, whether to use OpenCL (inits and deinits KissCL lib at the appropriate time).
*/
CampVisApplication(int& argc, char** argv, bool useOpenCL = true);
CampVisApplication(int& argc, char** argv);
/**
* Destructor, make sure to call deinit() first.
......@@ -144,9 +143,6 @@ namespace campvis {
/// Flag, whether CampVisApplication was correctly initialized
bool _initialized;
/// Flag, whether to use OpenCL (inits and deinits KissCL lib at the appropriate time).
bool _useOpenCL;
int _argc;
char** _argv;
......
IF(WIN32)
FIND_PATH(
OPENCL_SDK
NAMES CL/cl.h OpenCL/common/inc/CL/cl.h
DOC "Path to the OpenCL SDK (Nvidia GPU Computing / AMD APP SDK)"
)
IF(NOT EXISTS ${OPENCL_SDK})
MESSAGE(STATUS "OpenCL SDK (Nvidia GPU Computing / AMD APP SDK) not found! Please set Option 'OPENCL_SDK' if you need OpenCL!")
ENDIF()
FIND_PATH(
OPENCL_INCLUDE_DIR
NAMES CL/cl.h
PATHS ${OPENCL_SDK}
PATH_SUFFIXES include OpenCL/common/inc
)
IF(CAMPVIS_WIN32)
FIND_LIBRARY(
OPENCL_LIBRARY
NAMES OpenCL.lib
PATHS ${OPENCL_SDK}
PATH_SUFFIXES lib/Win32 OpenCL/common/lib/Win32
)
ELSEIF(CAMPVIS_WIN64)
FIND_LIBRARY(
OPENCL_LIBRARY
NAMES OpenCL.lib
PATHS ${OPENCL_SDK}
PATH_SUFFIXES lib/x64 OpenCL/common/lib/x64
)
ENDIF()
ELSEIF(UNIX)
FIND_PATH(
OPENCL_INCLUDE_DIR
NAMES CL/cl.h
PATHS ${OPENCL_INCLUDE_DIR}
${OPENCL_DIR}/include
${OPENCL_DIR}/OpenCL/common/inc
$ENV{OPENCL_INCLUDE_DIR}
$ENV{OPENCL_DIR}/include
$ENV{OPENCL_DIR}/OpenCL/common/inc
/usr/local/cuda/include
/usr/local/include
/usr/include
)
FIND_LIBRARY(
OPENCL_LIBRARY
NAMES OpenCL
PATHS ${OPENCL_LIBRARY_DIR}
${OPENCL_DIR}/lib
${OPENCL_DIR}/lib/x86
$ENV{OPENCL_LIBRARY_DIR}
$ENV{OPENCL_DIR}/lib
$ENV{OPENCL_DIR}/lib/x86
/usr/local/lib64
/usr/local/lib
/usr/lib64
/usr/lib
)
ENDIF()
IF(OPENCL_INCLUDE_DIR AND OPENCL_LIBRARY)
SET(OPENCL_FOUND TRUE)
MARK_AS_ADVANCED(OPENCL_INCLUDE_DIR OPENCL_LIBRARY)
ELSE()
SET(OPENCL_FOUND FALSE)
MESSAGE(STATUS "OpenCL library not found (OPENCL_INCLUDE_DIR and/or OPENCL_LIBRARY missing)!")
MARK_AS_ADVANCED(CLEAR OPENCL_INCLUDE_DIR OPENCL_LIBRARY)
ENDIF()
......@@ -196,20 +196,6 @@ IF(EXISTS "${CampvisHome}/ext/eigen/Eigen/Eigen")
ELSE()
MESSAGE(WARNING "Did not find Eigen - Eigen library must be placed in ext/eigen/!")
ENDIF()
# detect libraries
MESSAGE(STATUS "--------------------------------------------------------------------------------")
MESSAGE(STATUS "Detecting Optional External Libraries:")
# OpenCL
FIND_PACKAGE(CL)
IF (OPENCL_FOUND)
MESSAGE(STATUS "* Found OpenCL")
LIST(APPEND CampvisGlobalIncludeDirs ${OPENCL_INCLUDE_DIR})
LIST(APPEND CampvisGlobalExternalLibs ${OPENCL_LIBRARY})
ELSE(OPENCL_FOUND)
MESSAGE(STATUS "* Did NOT find OpenCL!")
ENDIF(OPENCL_FOUND)
SET(CommonconfProcessed TRUE)
ENDIF(NOT CommonconfProcessed)
......@@ -42,16 +42,6 @@ FOREACH(CampvisModulesCoreHeader ${CampvisModulesCoreHeaders})
LIST(APPEND CampvisCoreHeaders ${ModHeaderFile})
ENDFOREACH()
#SET(CampvisCoreSources
# application/campvis.cpp
# application/campvispainter.cpp
# datastructures/
#)
#SET(CampvisCoreHeaders
# application/campvispainter.h
#)
ADD_LIBRARY(campvis-core
${CampvisCoreSources} ${CampvisCoreHeaders}
)
......
......@@ -40,7 +40,7 @@ namespace campvis {
/**
* Stores basic information about one (semantic) image of arbitrary dimension.
* Different representations (e.g. local memory, OpenGL texture, OpenCL buffer) are
* Different representations (e.g. local memory, OpenGL texture) are
* to be defined by inheritance.
*
* \todo
......
......@@ -311,44 +311,6 @@ namespace campvis {
return (_baseType == INT8) || (_baseType == INT16) || (_baseType == INT32);
}
#ifdef HAS_KISSCL
cl_channel_type WeaklyTypedPointer::getClChannelType() const {
switch (_baseType) {
case WeaklyTypedPointer::UINT8:
return CL_UNORM_INT8;
case WeaklyTypedPointer::INT8:
return CL_SNORM_INT8;
case WeaklyTypedPointer::UINT16:
return CL_UNORM_INT16;
case WeaklyTypedPointer::INT16:
return CL_SNORM_INT16;
case WeaklyTypedPointer::UINT32:
return CL_UNSIGNED_INT32;
case WeaklyTypedPointer::INT32:
return CL_SIGNED_INT32;
case WeaklyTypedPointer::FLOAT:
return CL_FLOAT;
default:
tgtAssert(false, "Should not reach this - wrong base data type!");
return CL_SIGNED_INT8;
}
}
cl_channel_order WeaklyTypedPointer::getClChannelOrder() const {
switch (_numChannels) {
case 1:
return CL_INTENSITY;
case 2:
return CL_RA;
case 4:
return CL_RGBA;
default:
LERROR("Unsupported number of channels.");
return CL_A;
}
}
#endif
#ifdef CAMPVIS_HAS_MODULE_DEVIL
ILenum WeaklyTypedPointer::getIlFormat() const {
switch (_numChannels) {
......
......@@ -31,10 +31,6 @@
#include "tgt/tgt_gl.h"
#include "tgt/types.h"
#ifdef HAS_KISSCL
#include "kisscl/kisscl.h"
#endif
#ifdef CAMPVIS_HAS_MODULE_DEVIL
#include <IL/il.h>
#include <IL/ilu.h>
......@@ -135,11 +131,6 @@ namespace campvis {
ILenum getIlDataType() const;
#endif
#ifdef HAS_KISSCL
cl_channel_type getClChannelType() const;
cl_channel_order getClChannelOrder() const;
#endif
BaseType _baseType; ///< Base data type of the pointer
size_t _numChannels; ///< Number of channels, must be in [1, 4]!
......
This diff is collapsed.
################################################################################
# Project file for the kisscl library
################################################################################
PROJECT(kisscl)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
INCLUDE(../../cmake/commonconf.cmake)
MESSAGE(STATUS "Configuring kisscl Library")
# headers
FILE(GLOB KISSCL_HEADERS *.h CL/*.hpp)
# sources
FILE(GLOB KISSCL_SOURCES *.cpp)
################################################################################
# define library target
################################################################################
ADD_LIBRARY(kisscl ${KISSCL_SOURCES} ${KISSCL_HEADERS})
ADD_DEFINITIONS(${CampvisGlobalDefinitions})
IF(CAMPVIS_SHARED_LIBS AND MSVC)
ADD_DEFINITIONS("-DKISSCL_BUILD_DLL")
ENDIF()
INCLUDE_DIRECTORIES(${CampvisGlobalIncludeDirs})
TARGET_LINK_LIBRARIES(kisscl ${CampvisGlobalExternalLibs})
################################################################################
# deployment
################################################################################
IF(CAMPVIS_ADD_INSTALL_TARGET)
INSTALL(TARGETS kisscl
RUNTIME DESTINATION .
)
ENDIF()
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
// ================================================================================================
//
// This file is part of the KissCL, an OpenCL C++ wrapper following the KISS principle.
//
// Copyright (C) 2012, all rights reserved,
// Christian Schulte zu Berge (software@cszb.net)
//
// Redistribution and use in source and binary forms, with or without modification, are permitted
// provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, this list of
// conditions and the following disclaimer in the documentation and/or other materials provided
// with the distribution.
// * The names of its contributors may not be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// ================================================================================================
#include "clruntime.h"
#include "tgt/logmanager.h"
namespace kisscl {
const std::string CLRuntime::loggerCat_ = "kisscl.CLRuntime";
CLRuntime::CLRuntime()
: tgt::ResourceManager<Program>(false)
, _commandQueueProperties(0)
{
initPlatforms();
}
CLRuntime::~CLRuntime() {
// delete all command queues
for (std::map< std::pair<Context*, Device*>, CommandQueue*>::iterator it = _commandQueues.begin(); it != _commandQueues.end(); ++it)
delete it->second;
// delete all platforms and with it all devices
for (std::vector<Platform*>::iterator it = _platforms.begin(); it != _platforms.end(); ++it)
delete *it;
}
void CLRuntime::initPlatforms() {
// gather OpenCL platforms and create wrapper objects
cl_uint numPlatforms;
LCL_ERROR(clGetPlatformIDs(0, 0, &numPlatforms));
LINFO("Number of platformIds: " << numPlatforms);
cl_platform_id* platformIds = new cl_platform_id[numPlatforms];
LCL_ERROR(clGetPlatformIDs(numPlatforms, platformIds, 0));
for(cl_uint i=0; i<numPlatforms; ++i) {
_platforms.push_back(new Platform(platformIds[i]));
}
delete[] platformIds;
// sort devices into shortcut lists
for (std::vector<Platform*>::const_iterator pit = _platforms.begin(); pit != _platforms.end(); ++pit) {
for (std::vector<Device*>::const_iterator dit = (*pit)->getDevices().begin(); dit != (*pit)->getDevices().end(); ++dit) {
// check for CPU device type
if ((*dit)->getDeviceType() & CL_DEVICE_TYPE_CPU)
_cpuDevices.push_back(*dit);
// check for GPU device type
if ((*dit)->getDeviceType() & CL_DEVICE_TYPE_GPU)
_gpuDevices.push_back(*dit);
}
}
}
const std::vector<Device*>& CLRuntime::getCPUDevices() const {
return _cpuDevices;
}
const std::vector<Device*>& CLRuntime::getGPUDevices() const {
return _gpuDevices;
}
Context* CLRuntime::createGlSharingContext(const std::vector<ContextProperty>& additionalProperties /*= std::vector<ContextProperty>()*/) const {
Context* toReturn = 0;
std::vector<ContextProperty> properties = Context::generateGlSharingProperties();
properties.insert(properties.end(), additionalProperties.begin(), additionalProperties.end());
for (std::vector<Device*>::const_iterator it = _gpuDevices.begin(); it != _gpuDevices.end(); ++it) {
toReturn = new Context(*it, properties);
if (toReturn->isValid())
return toReturn;
// else
delete toReturn;
toReturn = 0;
}
for (std::vector<Device*>::const_iterator it = _cpuDevices.begin(); it != _cpuDevices.end(); ++it) {
toReturn = new Context(*it, properties);
if (toReturn->isValid())
return toReturn;