New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clSPARSE does not build with OpenCL 2.0 on Debian #162

Open
ghisvail opened this Issue Oct 14, 2015 · 24 comments

Comments

Projects
None yet
3 participants
@ghisvail
Contributor

ghisvail commented Oct 14, 2015

Using the latest v0.6.2.0 tag, clSPARSE fails to build on Debian testing / unstable with the following error message:

clsparse-0.6.2.0/src/library/include/clSPARSE-private.hpp:31:21: fatal error: CL/cl.hpp: No such file or directory

Despite explicitly passing -DBUILD_CLVERSION=2.0 to CMake.

@kknox

This comment has been minimized.

Show comment
Hide comment
@kknox

kknox Oct 14, 2015

Member

We have soft plans to switch the library internals to boost.compute, which will remove references to cl.hpp (see #138). There is no ETA on this though, we only have a proof-of-concept at this point.

Member

kknox commented Oct 14, 2015

We have soft plans to switch the library internals to boost.compute, which will remove references to cl.hpp (see #138). There is no ETA on this though, we only have a proof-of-concept at this point.

@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Oct 14, 2015

Contributor

Alright I will hold on then.

Contributor

ghisvail commented Oct 14, 2015

Alright I will hold on then.

@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Apr 21, 2016

Contributor

Any news on this?

Contributor

ghisvail commented Apr 21, 2016

Any news on this?

@kknox

This comment has been minimized.

Show comment
Hide comment
@kknox

kknox Apr 22, 2016

Member

The momentum to convert the internals to boost.compute has stopped; we don't have the resources at this time. However, I am working on getting approval to check-in cl.hpp pushed through.

Member

kknox commented Apr 22, 2016

The momentum to convert the internals to boost.compute has stopped; we don't have the resources at this time. However, I am working on getting approval to check-in cl.hpp pushed through.

@pavanky pavanky referenced this issue Jun 27, 2016

Merged

Replace cl.hpp with cl2.hpp #187

2 of 2 tasks complete
@pavanky

This comment has been minimized.

Show comment
Hide comment
@pavanky

pavanky Jun 28, 2016

Collaborator

@ghisvail can you check if clsparse compiles on debian with #187 ? You may need to run cmake with -DUSE_SYSTEM_CL2HPP=ON.

Collaborator

pavanky commented Jun 28, 2016

@ghisvail can you check if clsparse compiles on debian with #187 ? You may need to run cmake with -DUSE_SYSTEM_CL2HPP=ON.

@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Jun 30, 2016

Contributor

@pavanky I'll try to find some time to look at this by the end of the week. Cheers for the heads-up.

Contributor

ghisvail commented Jun 30, 2016

@pavanky I'll try to find some time to look at this by the end of the week. Cheers for the heads-up.

@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Jul 2, 2016

Contributor

I refreshed the packaging with 9677ec3, but cannot get the build to succeed. This is the cmake command run by the package build process:

cmake ../src -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DBUILD_BENCHMARKS=OFF -DBUILD_CLVERSION=2.0 -DBUILD_TESTS=OFF -DSUFFIX_LIB=/x86_64-linux-gnu -DUSE_SYSTEM_CL2HPP=ON

and the build log output:

make[1]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
/usr/bin/cmake -H"/<<PKGBUILDDIR>>/src" -B"/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu" --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles" "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/progress.marks"
make -f CMakeFiles/Makefile2 all
make[2]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make -f library/CMakeFiles/clSPARSE.dir/build.make library/CMakeFiles/clSPARSE.dir/depend
make[3]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
[  2%] Generating ../include/kernels/source-provider.cpp
cd "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/library" && /usr/bin/cmake -DCL_DIR="/<<PKGBUILDDIR>>/src/library/kernels" -DOUTPUT="/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/include/kernels/source-provider.cpp" -P /<<PKGBUILDDIR>>/src/cmake/cl2cpp_raw.cmake
-- running cl2cpp_raw
SpGEMM_EM_kernels
SpGEMM_ESC_0_1_kernels
SpGEMM_ESC_2heap_kernels
SpGEMM_ESC_bitonic_kernels
SpGEMM_computeNnzCt_kernels
SpGEMM_copyCt2C_kernels
atomic_reduce
blas1
control
conversion_utils
csrmm_adaptive
csrmm_general
csrmv_adaptive
csrmv_general
dot
elementwise_transform
matrix_utils
reduce
reduce_by_key
scan
sort_by_key_common
sort_by_key_int
sort_by_key_uint
cd "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu" && /usr/bin/cmake -E cmake_depends "Unix Makefiles" "/<<PKGBUILDDIR>>/src" "/<<PKGBUILDDIR>>/src/library" "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu" "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/library" "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/library/CMakeFiles/clSPARSE.dir/DependInfo.cmake" --color=
Scanning dependencies of target clSPARSE
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make -f library/CMakeFiles/clSPARSE.dir/build.make library/CMakeFiles/clSPARSE.dir/build
make[3]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
[  5%] Building CXX object library/CMakeFiles/clSPARSE.dir/clsparse-init.cpp.o
cd "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/library" && /usr/bin/c++   -DBUILD_CLVERSION=200 -DCLSPARSE_INDEX_SIZEOF=4 -DclSPARSE_EXPORTS -I"/<<PKGBUILDDIR>>/src/library" -I"/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/library" -I"/<<PKGBUILDDIR>>/src/include" -I"/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/include" -I"/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/clsparseTimer"  -m64 -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -Wdate-time -D_FORTIFY_SOURCE=2  -fPIC -fvisibility=hidden -fvisibility-inlines-hidden   -std=c++11 -pedantic -o CMakeFiles/clSPARSE.dir/clsparse-init.cpp.o -c "/<<PKGBUILDDIR>>/src/library/clsparse-init.cpp"
In file included from /<<PKGBUILDDIR>>/src/library/include/clSPARSE-private.hpp:26:0,
                 from /<<PKGBUILDDIR>>/src/library/clsparse-init.cpp:21:
/<<PKGBUILDDIR>>/src/include/clSPARSE.h:39:2: error: #error clSPARSE does not yet implement OpenCL 2.0 interfaces
 #error clSPARSE does not yet implement OpenCL 2.0 interfaces
  ^
In file included from /<<PKGBUILDDIR>>/src/library/include/clSPARSE-private.hpp:36:0,
                 from /<<PKGBUILDDIR>>/src/library/clsparse-init.cpp:21:
/<<PKGBUILDDIR>>/src/library/include/clSPARSE-2x.hpp: In member function 'void clsparseCsrMatrixPrivate::clear()':
/<<PKGBUILDDIR>>/src/library/include/clSPARSE-2x.hpp:181:46: error: 'rowBlocks' was not declared in this scope
         values = col_indices = row_pointer = rowBlocks = nullptr;
                                              ^
/<<PKGBUILDDIR>>/src/library/include/clSPARSE-2x.hpp:182:9: error: 'rowBlockSize' was not declared in this scope
         rowBlockSize = 0;
         ^
/<<PKGBUILDDIR>>/src/library/clsparse-init.cpp: At global scope:
/<<PKGBUILDDIR>>/src/library/clsparse-init.cpp:71:2: warning: extra ';' [-Wpedantic]
 };
  ^
/<<PKGBUILDDIR>>/src/library/clsparse-init.cpp:80:2: warning: extra ';' [-Wpedantic]
 };
  ^
/<<PKGBUILDDIR>>/src/library/clsparse-init.cpp:89:2: warning: extra ';' [-Wpedantic]
 };
  ^
/<<PKGBUILDDIR>>/src/library/clsparse-init.cpp:98:2: warning: extra ';' [-Wpedantic]
 };
  ^
library/CMakeFiles/clSPARSE.dir/build.make:69: recipe for target 'library/CMakeFiles/clSPARSE.dir/clsparse-init.cpp.o' failed
make[3]: *** [library/CMakeFiles/clSPARSE.dir/clsparse-init.cpp.o] Error 1
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
CMakeFiles/Makefile2:88: recipe for target 'library/CMakeFiles/clSPARSE.dir/all' failed
make[2]: *** [library/CMakeFiles/clSPARSE.dir/all] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
Makefile:152: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
Contributor

ghisvail commented Jul 2, 2016

I refreshed the packaging with 9677ec3, but cannot get the build to succeed. This is the cmake command run by the package build process:

cmake ../src -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DBUILD_BENCHMARKS=OFF -DBUILD_CLVERSION=2.0 -DBUILD_TESTS=OFF -DSUFFIX_LIB=/x86_64-linux-gnu -DUSE_SYSTEM_CL2HPP=ON

and the build log output:

make[1]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
/usr/bin/cmake -H"/<<PKGBUILDDIR>>/src" -B"/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu" --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles" "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/progress.marks"
make -f CMakeFiles/Makefile2 all
make[2]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make -f library/CMakeFiles/clSPARSE.dir/build.make library/CMakeFiles/clSPARSE.dir/depend
make[3]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
[  2%] Generating ../include/kernels/source-provider.cpp
cd "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/library" && /usr/bin/cmake -DCL_DIR="/<<PKGBUILDDIR>>/src/library/kernels" -DOUTPUT="/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/include/kernels/source-provider.cpp" -P /<<PKGBUILDDIR>>/src/cmake/cl2cpp_raw.cmake
-- running cl2cpp_raw
SpGEMM_EM_kernels
SpGEMM_ESC_0_1_kernels
SpGEMM_ESC_2heap_kernels
SpGEMM_ESC_bitonic_kernels
SpGEMM_computeNnzCt_kernels
SpGEMM_copyCt2C_kernels
atomic_reduce
blas1
control
conversion_utils
csrmm_adaptive
csrmm_general
csrmv_adaptive
csrmv_general
dot
elementwise_transform
matrix_utils
reduce
reduce_by_key
scan
sort_by_key_common
sort_by_key_int
sort_by_key_uint
cd "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu" && /usr/bin/cmake -E cmake_depends "Unix Makefiles" "/<<PKGBUILDDIR>>/src" "/<<PKGBUILDDIR>>/src/library" "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu" "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/library" "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/library/CMakeFiles/clSPARSE.dir/DependInfo.cmake" --color=
Scanning dependencies of target clSPARSE
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make -f library/CMakeFiles/clSPARSE.dir/build.make library/CMakeFiles/clSPARSE.dir/build
make[3]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
[  5%] Building CXX object library/CMakeFiles/clSPARSE.dir/clsparse-init.cpp.o
cd "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/library" && /usr/bin/c++   -DBUILD_CLVERSION=200 -DCLSPARSE_INDEX_SIZEOF=4 -DclSPARSE_EXPORTS -I"/<<PKGBUILDDIR>>/src/library" -I"/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/library" -I"/<<PKGBUILDDIR>>/src/include" -I"/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/include" -I"/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/clsparseTimer"  -m64 -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -Wdate-time -D_FORTIFY_SOURCE=2  -fPIC -fvisibility=hidden -fvisibility-inlines-hidden   -std=c++11 -pedantic -o CMakeFiles/clSPARSE.dir/clsparse-init.cpp.o -c "/<<PKGBUILDDIR>>/src/library/clsparse-init.cpp"
In file included from /<<PKGBUILDDIR>>/src/library/include/clSPARSE-private.hpp:26:0,
                 from /<<PKGBUILDDIR>>/src/library/clsparse-init.cpp:21:
/<<PKGBUILDDIR>>/src/include/clSPARSE.h:39:2: error: #error clSPARSE does not yet implement OpenCL 2.0 interfaces
 #error clSPARSE does not yet implement OpenCL 2.0 interfaces
  ^
In file included from /<<PKGBUILDDIR>>/src/library/include/clSPARSE-private.hpp:36:0,
                 from /<<PKGBUILDDIR>>/src/library/clsparse-init.cpp:21:
/<<PKGBUILDDIR>>/src/library/include/clSPARSE-2x.hpp: In member function 'void clsparseCsrMatrixPrivate::clear()':
/<<PKGBUILDDIR>>/src/library/include/clSPARSE-2x.hpp:181:46: error: 'rowBlocks' was not declared in this scope
         values = col_indices = row_pointer = rowBlocks = nullptr;
                                              ^
/<<PKGBUILDDIR>>/src/library/include/clSPARSE-2x.hpp:182:9: error: 'rowBlockSize' was not declared in this scope
         rowBlockSize = 0;
         ^
/<<PKGBUILDDIR>>/src/library/clsparse-init.cpp: At global scope:
/<<PKGBUILDDIR>>/src/library/clsparse-init.cpp:71:2: warning: extra ';' [-Wpedantic]
 };
  ^
/<<PKGBUILDDIR>>/src/library/clsparse-init.cpp:80:2: warning: extra ';' [-Wpedantic]
 };
  ^
/<<PKGBUILDDIR>>/src/library/clsparse-init.cpp:89:2: warning: extra ';' [-Wpedantic]
 };
  ^
/<<PKGBUILDDIR>>/src/library/clsparse-init.cpp:98:2: warning: extra ';' [-Wpedantic]
 };
  ^
library/CMakeFiles/clSPARSE.dir/build.make:69: recipe for target 'library/CMakeFiles/clSPARSE.dir/clsparse-init.cpp.o' failed
make[3]: *** [library/CMakeFiles/clSPARSE.dir/clsparse-init.cpp.o] Error 1
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
CMakeFiles/Makefile2:88: recipe for target 'library/CMakeFiles/clSPARSE.dir/all' failed
make[2]: *** [library/CMakeFiles/clSPARSE.dir/all] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
Makefile:152: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
@pavanky

This comment has been minimized.

Show comment
Hide comment
@pavanky

pavanky Jul 2, 2016

Collaborator

@ghisvail can you remove explicitly passing BUILD_CLVERSION ?

Collaborator

pavanky commented Jul 2, 2016

@ghisvail can you remove explicitly passing BUILD_CLVERSION ?

@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Jul 5, 2016

Contributor

@pavanky same outcome

Contributor

ghisvail commented Jul 5, 2016

@pavanky same outcome

@pavanky

This comment has been minimized.

Show comment
Hide comment
@pavanky

pavanky Jul 5, 2016

Collaborator

@ghisvail I was able to compile the library with a minor patch after configuring with the following command on debian testing.

cmake ../src -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DBUILD_BENCHMARKS=OFF -DBUILD_TESTS=OFF -DSUFFIX_LIB=/x86_64-linux-gnu -DUSE_SYSTEM_CL2HPP=ON
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0bdec76..bf1940a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -18,6 +18,8 @@
 # PUBLIC keywords
 cmake_minimum_required( VERSION 2.8.12 )

+ADD_DEFINITIONS(-DCL_USE_DEPRECATED_OPENCL_1_2_APIS)
+
 if( CMAKE_GENERATOR MATCHES "NMake" )
        option( NMAKE_COMPILE_VERBOSE "Print VERBOSE compile/link msgs to the console" OFF )
        if( NMAKE_COMPILE_VERBOSE )
Collaborator

pavanky commented Jul 5, 2016

@ghisvail I was able to compile the library with a minor patch after configuring with the following command on debian testing.

cmake ../src -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DBUILD_BENCHMARKS=OFF -DBUILD_TESTS=OFF -DSUFFIX_LIB=/x86_64-linux-gnu -DUSE_SYSTEM_CL2HPP=ON
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0bdec76..bf1940a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -18,6 +18,8 @@
 # PUBLIC keywords
 cmake_minimum_required( VERSION 2.8.12 )

+ADD_DEFINITIONS(-DCL_USE_DEPRECATED_OPENCL_1_2_APIS)
+
 if( CMAKE_GENERATOR MATCHES "NMake" )
        option( NMAKE_COMPILE_VERBOSE "Print VERBOSE compile/link msgs to the console" OFF )
        if( NMAKE_COMPILE_VERBOSE )
@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Jul 5, 2016

Contributor

Thanks for looking at it. Then, it should be fine if we were able to compile, unless you want me to double-check ?

Contributor

ghisvail commented Jul 5, 2016

Thanks for looking at it. Then, it should be fine if we were able to compile, unless you want me to double-check ?

@pavanky

This comment has been minimized.

Show comment
Hide comment
@pavanky

pavanky Jul 5, 2016

Collaborator

@ghisvail I sent in this PR: #189 may be wait until it is resolved?

Can you also raise a debian bug to update the cl2.hpp header? Khronos moved the headers to a github repo now: https://github.com/KhronosGroup/OpenCL-CLHPP

The version available in debian testing is a bit buggy.

Collaborator

pavanky commented Jul 5, 2016

@ghisvail I sent in this PR: #189 may be wait until it is resolved?

Can you also raise a debian bug to update the cl2.hpp header? Khronos moved the headers to a github repo now: https://github.com/KhronosGroup/OpenCL-CLHPP

The version available in debian testing is a bit buggy.

@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Jul 5, 2016

Contributor

The version available in debian testing is a bit buggy.

Is the 2.0.9 release enough? Or do you need anything newer?

Contributor

ghisvail commented Jul 5, 2016

The version available in debian testing is a bit buggy.

Is the 2.0.9 release enough? Or do you need anything newer?

@pavanky

This comment has been minimized.

Show comment
Hide comment
@pavanky

pavanky Jul 5, 2016

Collaborator

@ghisvail This commit seems to be the issue: KhronosGroup/OpenCL-CLHPP@befe77b

It was made after the release of 2.0.9. May be you can ask upstream to make a new release?

Collaborator

pavanky commented Jul 5, 2016

@ghisvail This commit seems to be the issue: KhronosGroup/OpenCL-CLHPP@befe77b

It was made after the release of 2.0.9. May be you can ask upstream to make a new release?

@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Jul 5, 2016

Contributor

I have just sent the bug reports to the Debian maintainers of the OpenCL headers asking for an update. Meanwhile, I'll check with upstream whether they are happy to do a release. Worst case, this commit could be cherry-picked onto 2.0.9 I presume.

Contributor

ghisvail commented Jul 5, 2016

I have just sent the bug reports to the Debian maintainers of the OpenCL headers asking for an update. Meanwhile, I'll check with upstream whether they are happy to do a release. Worst case, this commit could be cherry-picked onto 2.0.9 I presume.

@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Aug 8, 2016

Contributor

@pavanky I saw your PR was merged, which means clSPARSE can now probably be built in Debian.

Any plans to tag a new release out soon ?

Contributor

ghisvail commented Aug 8, 2016

@pavanky I saw your PR was merged, which means clSPARSE can now probably be built in Debian.

Any plans to tag a new release out soon ?

@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Aug 10, 2016

Contributor

I can confirm that the current tip of develop can be successfully built on Debian. Closing.

Contributor

ghisvail commented Aug 10, 2016

I can confirm that the current tip of develop can be successfully built on Debian. Closing.

@ghisvail ghisvail closed this Aug 10, 2016

@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Aug 10, 2016

Contributor

My bad. OpenCL 1.2 builds fine, but OpenCL 2.0 still fails.

Contributor

ghisvail commented Aug 10, 2016

My bad. OpenCL 1.2 builds fine, but OpenCL 2.0 still fails.

@ghisvail ghisvail reopened this Aug 10, 2016

@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Aug 10, 2016

Contributor

You can get a build going with the following patch:

diff --git a/src/include/clSPARSE.h b/src/include/clSPARSE.h
index 0af7f5a..43e6bd5 100644
--- a/src/include/clSPARSE.h
+++ b/src/include/clSPARSE.h
@@ -36,7 +36,7 @@ extern "C" {
 #if( BUILD_CLVERSION < 200 )
 #include "clSPARSE-1x.h"
 #else
-#error clSPARSE does not yet implement OpenCL 2.0 interfaces
+//#error clSPARSE does not yet implement OpenCL 2.0 interfaces
 #include "clSPARSE-2x.h"
 #endif

diff --git a/src/library/include/clSPARSE-2x.hpp b/src/library/include/clSPARSE-2x.hpp
index 7a5f0aa..b3e79fe 100644
--- a/src/library/include/clSPARSE-2x.hpp
+++ b/src/library/include/clSPARSE-2x.hpp
@@ -178,8 +178,7 @@ public:
     void clear( )
     {
         num_rows = num_cols = num_nonzeros = 0;
-        values = col_indices = row_pointer = rowBlocks = nullptr;
-        rowBlockSize = 0;
+        values = col_indices = row_pointer = nullptr;
     }

     clsparseIdx_t nnz_per_row() const

and start a build with OpenCL 2.0, but it leads to more errors:

[ 22%] Building CXX object library/CMakeFiles/clSPARSE.dir/internal/data-types/csr-meta.cpp.o
In file included from /home/ghislain/debian/packages/clsparse/src/library/internal/clsparse-control.hpp:22:0,
                 from /home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:21:
/home/ghislain/debian/packages/clsparse/src/library/../clsparseTimer/clsparseTimer-device.hpp:75:45: warning: ignoring attributes on template argument ‘cl_uint {aka unsigned int}’ [-Wignored-attributes]
     typedef std::pair< std::string, cl_uint > idPair;
                                             ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp: In function ‘clsparseMetaSizeResult clsparseCsrMetaSize(clsparseCsrMatrix*, clsparseControl)’:
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:32:44: error: ‘matrix_meta’ does not name a type
         sizeResult.metaSize = static_cast< matrix_meta* >( pCsrMatx->meta )->rowBlockSize;
                                            ^~~~~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:32:55: error: expected ‘>’ before ‘*’ token
         sizeResult.metaSize = static_cast< matrix_meta* >( pCsrMatx->meta )->rowBlockSize;
                                                       ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:32:55: error: expected ‘(’ before ‘*’ token
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:32:57: error: expected primary-expression before ‘>’ token
         sizeResult.metaSize = static_cast< matrix_meta* >( pCsrMatx->meta )->rowBlockSize;
                                                         ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:32:76: error: ‘void*’ is not a pointer-to-object type
         sizeResult.metaSize = static_cast< matrix_meta* >( pCsrMatx->meta )->rowBlockSize;
                                                                            ^~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:32:90: error: expected ‘)’ before ‘;’ token
         sizeResult.metaSize = static_cast< matrix_meta* >( pCsrMatx->meta )->rowBlockSize;
                                                                                          ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:37:30: warning: ignoring attributes on template argument ‘clsparseIdx_t {aka unsigned int}’ [-Wignored-attributes]
     clMemRAII< clsparseIdx_t > rCsrrow_pointer( control->queue( ), pCsrMatx->row_pointer );
                              ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp: In function ‘clsparseStatus clsparseCsrMetaCreate(clsparseCsrMatrix*, clsparseControl)’:
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:56:30: warning: ignoring attributes on template argument ‘clsparseIdx_t {aka unsigned int}’ [-Wignored-attributes]
     clMemRAII< clsparseIdx_t > rCsrrow_pointer( control->queue( ), pCsrMatx->row_pointer );
                              ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:59:5: error: ‘matrix_meta’ was not declared in this scope
     matrix_meta* meta_ptr = nullptr;
     ^~~~~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:59:18: error: ‘meta_ptr’ was not declared in this scope
     matrix_meta* meta_ptr = nullptr;
                  ^~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:62:33: error: ‘matrix_meta’ does not name a type
         meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                 ^~~~~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:62:44: error: expected ‘>’ before ‘*’ token
         meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                            ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:62:44: error: expected ‘(’ before ‘*’ token
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:62:46: error: expected primary-expression before ‘>’ token
         meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                              ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:62:65: error: expected ‘)’ before ‘;’ token
         meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                                                 ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:63:16: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
         delete meta_ptr;
                ^~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:68:20: error: ‘matrix_meta’ does not name a type
     meta_ptr = new matrix_meta;
                    ^~~~~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:75:29: warning: ignoring attributes on template argument ‘cl_ulong {aka long unsigned int}’ [-Wignored-attributes]
         clMemRAII< cl_ulong > rRowBlocks( control->queue( ), meta_ptr->rowBlocks( ) );
                             ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp: In function ‘clsparseStatus clsparseCsrMetaDelete(clsparseCsrMatrix*)’:
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:5: error: ‘matrix_meta’ was not declared in this scope
     matrix_meta* meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
     ^~~~~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:18: error: ‘meta_ptr’ was not declared in this scope
     matrix_meta* meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                  ^~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:42: error: ‘matrix_meta’ does not name a type
     matrix_meta* meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                          ^~~~~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:53: error: expected ‘>’ before ‘*’ token
     matrix_meta* meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                                     ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:53: error: expected ‘(’ before ‘*’ token
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:55: error: expected primary-expression before ‘>’ token
     matrix_meta* meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                                       ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:74: error: expected ‘)’ before ‘;’ token
     matrix_meta* meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                                                          ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:96:12: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
     delete meta_ptr;
            ^~~~~~~~

Contributor

ghisvail commented Aug 10, 2016

You can get a build going with the following patch:

diff --git a/src/include/clSPARSE.h b/src/include/clSPARSE.h
index 0af7f5a..43e6bd5 100644
--- a/src/include/clSPARSE.h
+++ b/src/include/clSPARSE.h
@@ -36,7 +36,7 @@ extern "C" {
 #if( BUILD_CLVERSION < 200 )
 #include "clSPARSE-1x.h"
 #else
-#error clSPARSE does not yet implement OpenCL 2.0 interfaces
+//#error clSPARSE does not yet implement OpenCL 2.0 interfaces
 #include "clSPARSE-2x.h"
 #endif

diff --git a/src/library/include/clSPARSE-2x.hpp b/src/library/include/clSPARSE-2x.hpp
index 7a5f0aa..b3e79fe 100644
--- a/src/library/include/clSPARSE-2x.hpp
+++ b/src/library/include/clSPARSE-2x.hpp
@@ -178,8 +178,7 @@ public:
     void clear( )
     {
         num_rows = num_cols = num_nonzeros = 0;
-        values = col_indices = row_pointer = rowBlocks = nullptr;
-        rowBlockSize = 0;
+        values = col_indices = row_pointer = nullptr;
     }

     clsparseIdx_t nnz_per_row() const

and start a build with OpenCL 2.0, but it leads to more errors:

[ 22%] Building CXX object library/CMakeFiles/clSPARSE.dir/internal/data-types/csr-meta.cpp.o
In file included from /home/ghislain/debian/packages/clsparse/src/library/internal/clsparse-control.hpp:22:0,
                 from /home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:21:
/home/ghislain/debian/packages/clsparse/src/library/../clsparseTimer/clsparseTimer-device.hpp:75:45: warning: ignoring attributes on template argument ‘cl_uint {aka unsigned int}’ [-Wignored-attributes]
     typedef std::pair< std::string, cl_uint > idPair;
                                             ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp: In function ‘clsparseMetaSizeResult clsparseCsrMetaSize(clsparseCsrMatrix*, clsparseControl)’:
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:32:44: error: ‘matrix_meta’ does not name a type
         sizeResult.metaSize = static_cast< matrix_meta* >( pCsrMatx->meta )->rowBlockSize;
                                            ^~~~~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:32:55: error: expected ‘>’ before ‘*’ token
         sizeResult.metaSize = static_cast< matrix_meta* >( pCsrMatx->meta )->rowBlockSize;
                                                       ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:32:55: error: expected ‘(’ before ‘*’ token
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:32:57: error: expected primary-expression before ‘>’ token
         sizeResult.metaSize = static_cast< matrix_meta* >( pCsrMatx->meta )->rowBlockSize;
                                                         ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:32:76: error: ‘void*’ is not a pointer-to-object type
         sizeResult.metaSize = static_cast< matrix_meta* >( pCsrMatx->meta )->rowBlockSize;
                                                                            ^~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:32:90: error: expected ‘)’ before ‘;’ token
         sizeResult.metaSize = static_cast< matrix_meta* >( pCsrMatx->meta )->rowBlockSize;
                                                                                          ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:37:30: warning: ignoring attributes on template argument ‘clsparseIdx_t {aka unsigned int}’ [-Wignored-attributes]
     clMemRAII< clsparseIdx_t > rCsrrow_pointer( control->queue( ), pCsrMatx->row_pointer );
                              ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp: In function ‘clsparseStatus clsparseCsrMetaCreate(clsparseCsrMatrix*, clsparseControl)’:
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:56:30: warning: ignoring attributes on template argument ‘clsparseIdx_t {aka unsigned int}’ [-Wignored-attributes]
     clMemRAII< clsparseIdx_t > rCsrrow_pointer( control->queue( ), pCsrMatx->row_pointer );
                              ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:59:5: error: ‘matrix_meta’ was not declared in this scope
     matrix_meta* meta_ptr = nullptr;
     ^~~~~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:59:18: error: ‘meta_ptr’ was not declared in this scope
     matrix_meta* meta_ptr = nullptr;
                  ^~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:62:33: error: ‘matrix_meta’ does not name a type
         meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                 ^~~~~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:62:44: error: expected ‘>’ before ‘*’ token
         meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                            ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:62:44: error: expected ‘(’ before ‘*’ token
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:62:46: error: expected primary-expression before ‘>’ token
         meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                              ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:62:65: error: expected ‘)’ before ‘;’ token
         meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                                                 ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:63:16: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
         delete meta_ptr;
                ^~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:68:20: error: ‘matrix_meta’ does not name a type
     meta_ptr = new matrix_meta;
                    ^~~~~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:75:29: warning: ignoring attributes on template argument ‘cl_ulong {aka long unsigned int}’ [-Wignored-attributes]
         clMemRAII< cl_ulong > rRowBlocks( control->queue( ), meta_ptr->rowBlocks( ) );
                             ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp: In function ‘clsparseStatus clsparseCsrMetaDelete(clsparseCsrMatrix*)’:
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:5: error: ‘matrix_meta’ was not declared in this scope
     matrix_meta* meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
     ^~~~~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:18: error: ‘meta_ptr’ was not declared in this scope
     matrix_meta* meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                  ^~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:42: error: ‘matrix_meta’ does not name a type
     matrix_meta* meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                          ^~~~~~~~~~~
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:53: error: expected ‘>’ before ‘*’ token
     matrix_meta* meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                                     ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:53: error: expected ‘(’ before ‘*’ token
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:55: error: expected primary-expression before ‘>’ token
     matrix_meta* meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                                       ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:95:74: error: expected ‘)’ before ‘;’ token
     matrix_meta* meta_ptr = static_cast< matrix_meta* >( pCsrMatx->meta );
                                                                          ^
/home/ghislain/debian/packages/clsparse/src/library/internal/data-types/csr-meta.cpp:96:12: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
     delete meta_ptr;
            ^~~~~~~~

@pavanky

This comment has been minimized.

Show comment
Hide comment
@pavanky

pavanky Aug 10, 2016

Collaborator

You shouldn't have to change anything.. What is the error you are getting earlier ?

Collaborator

pavanky commented Aug 10, 2016

You shouldn't have to change anything.. What is the error you are getting earlier ?

@pavanky

This comment has been minimized.

Show comment
Hide comment
@pavanky

pavanky Aug 10, 2016

Collaborator

My bad. OpenCL 1.2 builds fine, but OpenCL 2.0 still fails.

If you mean cl2.hpp works fine with OpenCL 1.2 I don't see a problem with it. I don't think clSparse has been patched to work in OpenCL 2.0 only.

Why do you need to force it to use OpenCL 2.0 APIs ?

Collaborator

pavanky commented Aug 10, 2016

My bad. OpenCL 1.2 builds fine, but OpenCL 2.0 still fails.

If you mean cl2.hpp works fine with OpenCL 1.2 I don't see a problem with it. I don't think clSparse has been patched to work in OpenCL 2.0 only.

Why do you need to force it to use OpenCL 2.0 APIs ?

@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Aug 11, 2016

Contributor

If you mean cl2.hpp works fine with OpenCL 1.2 I don't see a problem with it.

Indeed it works. Will it be sufficient for the next release of ArrayFire then?

I don't think clSparse has been patched to work in OpenCL 2.0 only.

That's what I figured from the results of the build above. Seems that the OpenCL 2.0 path of the codebase has not been adapted to recent changes in the API (such as e92f41b).

Contributor

ghisvail commented Aug 11, 2016

If you mean cl2.hpp works fine with OpenCL 1.2 I don't see a problem with it.

Indeed it works. Will it be sufficient for the next release of ArrayFire then?

I don't think clSparse has been patched to work in OpenCL 2.0 only.

That's what I figured from the results of the build above. Seems that the OpenCL 2.0 path of the codebase has not been adapted to recent changes in the API (such as e92f41b).

@pavanky

This comment has been minimized.

Show comment
Hide comment
@pavanky

pavanky Aug 11, 2016

Collaborator

Indeed it works. Will it be sufficient for the next release of ArrayFire then?

ArrayFire also targets 1.2. Considering that OpenCL libraries are backwards compatible, I think that is a fair.

That's what I figured from the results of the build above. Seems that the OpenCL 2.0 path of the codebase has not been adapted to recent changes in the API

I don't think clSparse ever had an OpenCL 2.0 path. @kknox correct me if I am wrong here.

Collaborator

pavanky commented Aug 11, 2016

Indeed it works. Will it be sufficient for the next release of ArrayFire then?

ArrayFire also targets 1.2. Considering that OpenCL libraries are backwards compatible, I think that is a fair.

That's what I figured from the results of the build above. Seems that the OpenCL 2.0 path of the codebase has not been adapted to recent changes in the API

I don't think clSparse ever had an OpenCL 2.0 path. @kknox correct me if I am wrong here.

@ghisvail

This comment has been minimized.

Show comment
Hide comment
@ghisvail

ghisvail Aug 11, 2016

Contributor

ArrayFire also targets 1.2. Considering that OpenCL libraries are backwards compatible.

Then I'll stick with 1.2 for all clMath libraries to remain consistent with what AF supports.

I don't think clSparse ever had an OpenCL 2.0 path.

The official documentation suggests otherwise:

"OpenCL 2.0 support is not yet fully implemented; only the interfaces have been designed"

Contributor

ghisvail commented Aug 11, 2016

ArrayFire also targets 1.2. Considering that OpenCL libraries are backwards compatible.

Then I'll stick with 1.2 for all clMath libraries to remain consistent with what AF supports.

I don't think clSparse ever had an OpenCL 2.0 path.

The official documentation suggests otherwise:

"OpenCL 2.0 support is not yet fully implemented; only the interfaces have been designed"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment