Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add support for OpenCL 1.1 C and C++ API
By default OpenCL is configured for NVIDIA CUDA. <PKG>/include and
<PKG>/lib64 are symlinks, which can me modified to point to
alternative implementation.

`opencl' and `opencl-cpp' are optional toolfiles and must be loaded
explicitly.

Signed-off-by: David Abdurachmanov <David.Abdurachmanov@cern.ch>
  • Loading branch information
David Abdurachmanov authored and David Abdurachmanov committed Mar 6, 2014
1 parent 7ff712e commit b1e480b
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmssw-tool-conf.spec
@@ -1,4 +1,4 @@
### RPM cms cmssw-tool-conf 30.0
### RPM cms cmssw-tool-conf 31.0
## NOCOMPILER
# with cmsBuild, change the above version only when a new
# tool is added
Expand Down Expand Up @@ -121,6 +121,8 @@ Requires: yaml-cpp-toolfile
Requires: fastjet-contrib-toolfile
Requires: cuda-toolfile
Requires: rivet2-toolfile
Requires: opencl-toolfile
Requires: opencl-cpp-toolfile

# Only for Linux platform.
%if %islinux
Expand Down Expand Up @@ -148,7 +150,7 @@ Requires: igprof-toolfile
%endif
%endif

%define skipreqtools jcompiler lhapdfwrapfull lhapdffull icc-cxxcompiler icc-ccompiler icc-f77compiler boost_serialization boost_iostreams cuda rivet2
%define skipreqtools jcompiler lhapdfwrapfull lhapdffull icc-cxxcompiler icc-ccompiler icc-f77compiler boost_serialization boost_iostreams cuda rivet2 opencl opencl-cpp

## IMPORT scramv1-tool-conf

25 changes: 25 additions & 0 deletions opencl-cpp-toolfile.spec
@@ -0,0 +1,25 @@
### RPM external opencl-cpp-toolfile 1.0

Requires: opencl-cpp

%prep
# NOP

%build
# NOP

%install

mkdir -p %{i}/etc/scram.d
cat << \EOF_TOOLFILE >%{i}/etc/scram.d/opencl-cpp.xml
<tool name="opencl-cpp" version="@TOOL_VERSION@">
<info url="http://www.khronos.org/registry/cl/"/>
<client>
<environment name="OPENCL_CPP_BASE" default="@TOOL_ROOT@"/>
<environment name="INCLUDE" default="$OPENCL_CPP_BASE/include"/>
</client>
<use name="opencl"/>
</tool>
EOF_TOOLFILE

## IMPORT scram-tools-post
16 changes: 16 additions & 0 deletions opencl-cpp.spec
@@ -0,0 +1,16 @@
### RPM external opencl-cpp 1.1
## NOCOMPILER

Source0: http://www.khronos.org/registry/cl/api/%{realversion}/cl.hpp

Requires: opencl

%prep
# NOP

%build
# NOP

%install
mkdir -p %{i}/include/CL
cp %{SOURCE0} %{i}/include/CL
26 changes: 26 additions & 0 deletions opencl-toolfile.spec
@@ -0,0 +1,26 @@
### RPM external opencl-toolfile 1.0

Requires: opencl

%prep
# NOP

%build
# NOP

%install

mkdir -p %{i}/etc/scram.d
cat << \EOF_TOOLFILE >%{i}/etc/scram.d/opencl.xml
<tool name="opencl" version="@TOOL_VERSION@">
<info url="https://www.khronos.org/opencl/"/>
<lib name="OpenCL"/>
<client>
<environment name="OPENCL_BASE" default="@TOOL_ROOT@"/>
<environment name="LIBDIR" default="$OPENCL_BASE/lib64"/>
<environment name="INCLUDE" default="$OPENCL_BASE/include"/>
</client>
</tool>
EOF_TOOLFILE

## IMPORT scram-tools-post
15 changes: 15 additions & 0 deletions opencl.spec
@@ -0,0 +1,15 @@
### RPM external opencl 1.1
## NOCOMPILER

%prep
# NOP

%build
# NOP

%install
# NOP

%post
ln -s /usr/lib64/nvidia ${RPM_INSTALL_PREFIX}/%{pkgrel}/lib64
ln -s /usr/local/cuda/include ${RPM_INSTALL_PREFIX}/%{pkgrel}/include

0 comments on commit b1e480b

Please sign in to comment.