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

Flexible BLAS and LAPACK interface #11

Open
zanellia opened this issue May 22, 2020 · 0 comments
Open

Flexible BLAS and LAPACK interface #11

zanellia opened this issue May 22, 2020 · 0 comments

Comments

@zanellia
Copy link
Owner

zanellia commented May 22, 2020

The current interface to BLAS and LAPACK routines should be made more flexible, in the sense that different levels of granularity should be accessible though the same method without adding unnecessary complexity to simple calls. Below is a draft signature for gemm suggested by @giaf:

gemm(A[1:2,1:2], B.T, C[3:4,1:2], D=None, alpha=1.0, beta=1.0) ,

where A, B, C and D can also be transposed through e.g. A.T and views are possible too, for example:

gemm(A[1:2,1:2], B.T, C[3:4,1:2], D, beta=2.0).

This is easily implementable in Python, but will require some work in prometeo's parser. In particular in the argument inspection here

for arg in args:
)

we'd need to do something like this:

nargs = len(args)

# extract keyword arguments
...

# check expression in views (if any) using https://github.com/zanellia/prometeo/blob/f45a6347ea524164cc812fad80c9db1f4f94e17f/prometeo/cgen/code_gen_c.py#L244

# extract and unparse views of matrix arguments (if any)
first_index = astu.unparse(node.targets[0].slice.value.elts[0]).strip('\n')
second_index = astu.unparse(node.targets[0].slice.value.elts[1]).strip('\n')

# check for transposition (look if arg has an attribute an if it is 'T')

# pass this info to a generic `process_arg()` method
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

No branches or pull requests

1 participant