-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added Matrix Multiplication #3
base: master
Are you sure you want to change the base?
Conversation
examples/CMakeLists.txt
Outdated
@@ -2,6 +2,7 @@ set(GPGPU_GLES_EXAMPLES | |||
array_add_float | |||
fir_conv_float | |||
array_add_fixed16 | |||
mult_mat_int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not floats? ints make little sense here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have changed the entire operation on ints to that on floats
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so change the name to float please :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, done.
shaders/mult_mat_int.fs
Outdated
float i = vTexCoord.s; | ||
float j = vTexCoord.t; | ||
float result = 0.0; | ||
for (float k = 0.0; k < 4.0; ++k) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why 4? why k is a float
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To reduce the value of k to lie between 0 to 1, we are dividing it by 4. This is to make sure that the coordinates of the texture element we are multiplying lies in the range 0 to 1 in the texture coordinate system.
Foe texture2D function, the second parameter is vec2 which contains floats as its elements. This is the reason for k being a floating point value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @JDuchniewicz any update on merging this inclusion of matrix multiplication to the upstream!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, sorry got bogged down by other work. I still do not understand why 4.0 and if 4.0 is necessary (I presume the matrix size?). If this is indeed the matrix size, it should be configurable as a uniform and not hard-coded. Please change that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Jakub, yes its for size.
So, we are testing for a generalized notation and will update soon, can we use something like the const kspan for indicating this 4.0 as its tested for this size.
In this PR, we have added support for Matrix Multiplication and made the required changes in the relevant directories.
We have obtained the correct results and have attached the screenshot for the same in the description.