oneapi-src / oneMKL

oneAPI Math Kernel Library (oneMKL) Interfaces
Apache License 2.0
588 stars 148 forks source link

[BLAS] Wrong namespace usage in BLAS Documentation #489

Open AD2605 opened 1 month ago

AD2605 commented 1 month ago

Summary

Hi All,

As I get started with oneMKL, I am trying to get a minimal GEMM example up and running, following the [Dense Linear Algebra] link under Developer Reference section in the README.

However, I suppose there is an non-existent namespace being mentioned in the GEMM Docs.

In the above page, the transpose enum seems to be mentioned under the onemkl namespace, but I suppose it is actually under the oneapi::mkl namespace ?

Even the GEMM tests seem to use the same.

I can see the usage of the onemkl namespace throughout the BLAS documentation, Level 1,2 and 3.

Am I correct in my understanding that it is a non-updated documentation or am I possibly missing some include which essentially declares the onemkl namespace ?

Thanks

hjabird commented 1 month ago

It looks to me like you're right in that the specification has errors.

The transpose should be in the omeapi::mkl namespace as documented here:

oneMKL BLAS and LAPACK for Data Parallel C++ (DPC++) introduces several new enumeration data types, which are type-safe versions of the traditional Fortran characters in BLAS and LAPACK. They are declared in types.hpp, which is included automatically when you include mkl.hpp. Like all oneMKL DPC++ functionality, they belong to the namespace oneapi::mkl.

However, I think this is a specification issue, not a oneMKL interface library issue. It might be better to open an issue here.

EDIT: I got confused between the oneAPI specification and the documentation for this project. It looks like the oneAPI specification has the same issue here. However, it still looks like everything should be in the oneapi::mkl namespace (here).

AD2605 commented 1 month ago

Thanks for the quick response !

So from what I understand, it's both a spec as well as a documentation issue correct, and a similar Issue must be raised on the oneapi-spec Repo as well ?

hjabird commented 1 month ago

It looks like this already has an issue for the oneAPI spec https://github.com/uxlfoundation/oneAPI-spec/issues/534 and a PR https://github.com/uxlfoundation/oneAPI-spec/pull/535.

hjabird commented 1 month ago

@mmeterel, @andrewtbarker we think it makes more sense to direct users to the oneAPI/oneMKL specification instead of duplicating the documentation here. I think the solution to this is to:

What do you think?

andrewtbarker commented 1 month ago

@hjabird I tend to agree with you. The only concern I have is that the implementation here might not be perfectly in line with the oneAPI specification at all times, and ideally we would have a way to document discrepancies, but I agree that maintaining two sets of docs does not really make sense.