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

Added Matrix Multiplication #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Komal0103
Copy link

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.

mat_mult

examples/mult_mat_int/mult_mat_int.c Outdated Show resolved Hide resolved
@@ -2,6 +2,7 @@ set(GPGPU_GLES_EXAMPLES
array_add_float
fir_conv_float
array_add_fixed16
mult_mat_int
Copy link
Owner

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

Copy link
Author

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

Copy link
Owner

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 :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, done.

float i = vTexCoord.s;
float j = vTexCoord.t;
float result = 0.0;
for (float k = 0.0; k < 4.0; ++k)
Copy link
Owner

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?

Copy link
Author

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.

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!?

Copy link
Owner

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.

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.

src/gpgpu_gles.c Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

3 participants