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

Sinh & cosh numpy_intrinsic functions implemented #1002

Merged
merged 5 commits into from Aug 30, 2022

Conversation

Madhav2310
Copy link
Contributor

No description provided.

@Madhav2310 Madhav2310 changed the title Sinh & cosh numpy_intrinsic functions Sinh & cosh numpy_intrinsic functions implemented Aug 20, 2022
@Madhav2310
Copy link
Contributor Author

@czgdp1807 could you please help me with this error?

for j in range(size2):
for k in range(size3):
for l in range(size4):
assert abs( ((sinh(array[i, j, k, l])%3) +2)/2 - result[i, j, k, l]) <= eps
Copy link
Collaborator

Choose a reason for hiding this comment

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

@certik Builtin % in LPython doesn't work on arrays by default because it is implemented as a function and not a binop. So the question is which approach to follow,

  1. To make _mod function defined in lpython_builtin.py vectorised;
  2. Define Mod as binop and then use builder->CreateSRem in LLVM backend. Note that not all backends might support modulus operation on types other than integers.
  3. Define mod and then make it vectorisable.

I think 3rd approach is a good one and complies with Python and NumPy standards. What do you say @certik?

@czgdp1807 czgdp1807 mentioned this pull request Aug 24, 2022
@czgdp1807 czgdp1807 assigned czgdp1807 and unassigned czgdp1807 Aug 26, 2022
@czgdp1807 czgdp1807 force-pushed the sinh_&_cosh_functions branch 4 times, most recently from 4132dc8 to 7757d59 Compare August 29, 2022 06:59
Copy link
Collaborator

@czgdp1807 czgdp1807 left a comment

Choose a reason for hiding this comment

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

@certik This is ready to merge.

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

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

I think this is good, thanks!

czgdp1807 and others added 5 commits August 30, 2022 11:22
Co-authored-by: Madhav2310 <madhav.mittal.mat19@itbhu.ac.in>
Co-authored-by: Madhav2310 <madhav.mittal.mat19@itbhu.ac.in>
Co-authored-by: Madhav2310 <madhav.mittal.mat19@itbhu.ac.in>
Co-authored-by: Madhav2310 <madhav.mittal.mat19@itbhu.ac.in>
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.

None yet

3 participants