-
Notifications
You must be signed in to change notification settings - Fork 6
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
Update complex implementation and tests #25
Update complex implementation and tests #25
Conversation
I did not modify the synopsis yet. I'll change it when we are satisfied with these changes. |
1: remove const and ref keyword on value_type 2: better encapsulation (expose only what needs to be) 3: add missing enable_if to free functions
* implementation: namespace detail becomes namespace cplex::detail * test: use input instead of std_in for sycl::complex's function * test: fix typos in the free function's tests
did I forgot to merge this @jle-quel ? Sorry! |
I copied the updated header from this PR into gtensor and tried to build the testsuite, and it fails because of the introduction of the extra enable if template argument. Gtensor uses a templated alias type, and I tried applying this difff:
however it still fails. I don't understand why, but this might be the reason: https://stackoverflow.com/questions/24219357/default-template-arguments-for-the-c11-using-type-alias The build error I get:
Using this instead does not change the error:
I appreciate the simplification we get by using some template meta programming (gtensor uses it a lot too), but it unfortunately changes the public interface in ways that make it hard to use. It think type aliasing complex types is a pretty common need for middleware type libraries. Not clear to me what the solution is. |
Note that in that very long error messages, there are instances of both |
Something subtle is going on here. The error does not happen just from using a type alias in a different namespace. It almost seems like an Intel LLVM bug, because it's in a generated file. |
Ok so it's my understanding that the generated file is for the auto-generated kernel name, it's defining a KernelInfo for the Assign operation, and for some reason, it's leaving out a template param for some of the types. It does seem like a bug, but I am having trouble creating a simple reproducer. |
Found a suitable workaround for gtensor that allows me to keep the custom kernel names. I don't think I am motivated to understand why the failure was happening in the first place... in any case, I vote we go ahead and merge this. |
Thanks for the review @bd4 ! |
This PR updates the complex implementation as well as the tests.
From the POV of the complex's user, the interface does not change.
The modification made to the implementation are:
genfloat
is true, which removes the duplication of operatorsgenfloat
is true, which removes some boilerplate codevalue_type
The modifications made to the tests are: