amd / OpenCL-caffe

This is a Experimental version of OpenCL by AMD Research, we now recommend you to use The official BVLC Caffe OpenCL branch is over at Caffe branch now at https://github.com/BVLC/caffe/tree/opencl
Other
517 stars 152 forks source link

it support opencl1.1 device? #17

Open zif520 opened 8 years ago

zif520 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

zif520 commented 8 years ago

@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 commented 8 years ago

Sounds good. You have two approaches really:

To insert shims, what I would do is:

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 commented 8 years ago

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

psyhtest commented 8 years ago

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 commented 8 years ago

:-D

naibaf7 commented 8 years ago

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

psyhtest commented 8 years ago

@naibaf7 Yes, I'm using your port now - and it's much more promising! :+1: 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. :+1: 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 commented 8 years ago

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

which library is this?

psyhtest commented 8 years ago

@hughperkins https://github.com/CNugteren/CLBlast

hughperkins commented 8 years ago

Thanks!

soulslicer commented 6 years ago

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