-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
how to implement a new routine from the host side? #565
Comments
I'm not sure what you want to achieve here:
|
Not for now, maybe in the coming days.
That's a good point. Instead of jumping into a complex routine, it's often better to start with simpler tasks.
Exactly as I initially thought. Here's what I did.
|
Looks good indeed. One thing to note is that CLBlast is quite complex, and there are different versions of GEMM that might run, see also here. One thing you can do for your tests is compile CLBlast with |
Thanks, it worked like charm! But I got curious and decided to extend it like this. (this is a small part of the code) #if PRECISION == 3232 || PRECISION == 6464
#if ACTV == 0 // none
#define Activation(value) value.x = value.x; value.y = value.y
#elif ACTV == 1 // tanh
#define Activation(value) value.x = tanh(value.x); value.y = tanh(value.y)
#endif #if ACTV == 0 // none
#define Activation(value) value
#elif ACTV == 1 // tanh
#define Activation(value) tanh(value);
#endif
|
Good to hear. Do you mean something like this? |
So, this is fine, but it only counts for one activation for the whole program, right? I want to call
|
Ah, OK. So in that case you'll want to add a new parameter to the Alternatively you can create an entirely new routine for when ACTV should be 1 and then you can use a define such as |
That sounds wonderful! I will check this out and keep you updated. |
I comprehend kernel code; however, I find host side code challenging to understand.(fine with C, however, I lack proficiency in C++.)
I just want to throw in an activation function for the CLBlastgemm function. I have noticed that it seems impossible to perform the activation function in Gemm. An example would be the sigmoid function.
The text was updated successfully, but these errors were encountered: