Giter Site home page Giter Site logo

Comments (5)

zakk0610 avatar zakk0610 commented on July 1, 2024 2

Hi Roger,
Sorry , I forget to update examples to rvv 0.9 include removing vector c operator,
thanks for point out, I will update it soon.

sgemm example is translated from rvv spec example without loop unrolling, you can reference below diagram to understand the code.
example

Thanks.

from rvv-intrinsic-doc.

rofirrim avatar rofirrim commented on July 1, 2024

Hi @zakk0610,

thanks for the prompt answer. Definitely I was mistaken with the sgemm.

Kind regards,

from rvv-intrinsic-doc.

rofirrim avatar rofirrim commented on July 1, 2024

Hi @zakk0610,

some extra comments in the hope they're useful.

-void sgemm_golden() {
+void sgemm_golden(void) {
   for (size_t i = 0; i < MLEN; ++i)
     for (size_t j = 0; j < NLEN; ++j)
       for (size_t k = 0; k < KLEN; ++k)
-        c_array[i * NLEN + j] += a_array[i * KLEN + k] * b_array[j + k * NLEN];
+        golden_array[i * NLEN + j] += a_array[i * KLEN + k] * b_array[j + k * NLEN];
 }
 int main() {
   // golden
-  memcpy(golden_array, b_array, OUTPUT_LEN * sizeof(float));
-  sgemm_golden(MLEN, NLEN, KLEN, a_array, KLEN, b_array, NLEN, golden_array, NLEN);
+  sgemm_golden();
   // vector
-  memcpy(c_array, b_array, OUTPUT_LEN * sizeof(float));
   sgemm_vec(MLEN, NLEN, KLEN, a_array, KLEN, b_array, NLEN, c_array, NLEN);

With these changes (along with those of the load/store) this sgemm test passes in our emulator.

Thanks!

from rvv-intrinsic-doc.

zakk0610 avatar zakk0610 commented on July 1, 2024

Thanks @rofirrim!
I fixed them and they can also passed in spike simulator now.

from rvv-intrinsic-doc.

kito-cheng avatar kito-cheng commented on July 1, 2024

fa898df

from rvv-intrinsic-doc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.