Skip to content
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

it support opencl1.1 device? #17

Open
zif520 opened this issue Dec 16, 2015 · 15 comments
Open

it support opencl1.1 device? #17

zif520 opened this issue Dec 16, 2015 · 15 comments

Comments

@zif520
Copy link

zif520 commented Dec 16, 2015

i want to use zhe opencl caffe in android ,but only support opencl 1.1,can i use it but only chang little function?

@gujunli
Copy link
Contributor

gujunli commented Dec 17, 2015

hmm this is an interesting question. we did not try in OpenCL1.1, the first step will be figuring out what has been new OpenCL1.2 vs 1.1, and removed the new functions of 1.2

@hughperkins
Copy link

in case it's useful, I know that clBLAS 2.4 worked ok in 1.1, back in the days when NVIDIA only supported 1.1

1.1 is quite old now, and recent Adrenos support not just 1.2 but 2.0 https://en.wikipedia.org/wiki/Adreno

@zif520
Copy link
Author

zif520 commented Dec 29, 2015

thanks for all ,
i found most of mali GPU only supply opencl 1.1 ,i also refer to https://github.com/naibaf7/caffe to do it ,perhaps i will complete it some days ,but there is some problems now.

@hughperkins
Copy link

Sounds cool. Just out of curiosity, which 1.2 functions are being used?

@zif520
Copy link
Author

zif520 commented Jan 5, 2016

@hughperkins
we only use opencl 1.1 ,and now it is worked ok with ViennaCL ,but there are a little slow,so i want to try clblas now. my telephone is mate8 mali T880

@hughperkins
Copy link

Sounds good. You have two approaches really:

  • insert shims in between clblas et al and opencl (this is what I would do)
  • modify clblas et al (this sounds... harder, but hard to say without checking first)

To insert shims, what I would do is:

  • download/build clew https://github.com/hughperkins/clew This is like a thin layer in between clblas etc, and opencl. perfect for adding shims
  • give clew library to clblas etc. Tell clblas it is the opencl library. It will believe you :-)
  • stub out appropriate opencl 1.2 function calls in clew, so that they are implemented using 1.1 functions and / or custom opencl kernels

I would think you wouldnt want to directly modify the clew library, but create a new library (call it opencl-1.2-on-1.1 for example), which will stub out the clew methods, ie by overwriting the function pointers eg at https://github.com/hughperkins/clew/blob/master/src/clew.c#L112 )

@zif520
Copy link
Author

zif520 commented Jan 5, 2016

@hughperkins
thanks for your illustration.: ) , i will try it !

@psyhtest
Copy link

I was able to compile OpenCL-caffe with clBLAS 2.4 (and openBLAS 0.2.17). But what really stopped me in my tracks was this:

// src/caffe/device.cpp
 namespace caffe {
 #ifndef CPU_ONLY
 string buildOption = "-x clc++ ";

and then this:

// src/caffe/ocl/util.cl
#pragma OPENCL EXTENSION cl_amd_printf : enable

template <class T>
__kernel void OCL_memset(__global T* buffer, const T value, const int size, const int buf_offset) {

C'mon, using templates with OpenCL 1.x?

@hughperkins
Copy link

:-D

@naibaf7
Copy link

naibaf7 commented Mar 27, 2016

@psyhtest
Here this one has OpenCL 1.1 support: https://github.com/BVLC/caffe/tree/opencl

@psyhtest
Copy link

@naibaf7 Yes, I'm using your port now - and it's much more promising! 👍 I hope to provide you some contributions in due course.

@zif520 I used to lead the OpenCL compiler team for the ARM Mali GPUs, so I'm always happy to see people using Mali. 👍 I do not, however, think you can get good performance with clBLAS. I plan to connect another BLAS library that can be tuned for embedded GPUs.

@hughperkins
Copy link

I plan to connect another BLAS library that can be tuned for embedded GPUs.

which library is this?

@psyhtest
Copy link

@hughperkins
Copy link

Thanks!

@soulslicer
Copy link

So what version of OpenCL does this actually support? Does it support 1.2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants