Skip to content

Hypergeometric2F1#4943

Open
pbrubeck wants to merge 9 commits intomainfrom
pbrubeck/hypergeometric
Open

Hypergeometric2F1#4943
pbrubeck wants to merge 9 commits intomainfrom
pbrubeck/hypergeometric

Conversation

@pbrubeck
Copy link
Contributor

@pbrubeck pbrubeck commented Mar 4, 2026

Description

Enables codegen for ufl.hyp2f1

Depends on inducer/loopy#986 FEniCS/ufl#468

_cflags = ("-fPIC", "-Wall", "-std=gnu11")
_cxxflags = ("-fPIC", "-Wall")
_ldflags = ("-shared",)
_ldflags = ("-shared", "-lgsl", "-lgslcblas")
Copy link
Contributor Author

@pbrubeck pbrubeck Mar 5, 2026

Choose a reason for hiding this comment

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

@connorjward what does -shared mean? This is obviously not the correct way to add libraries, please correct me.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think -shared means to make an .so instead of a .a file.

Regardless I think you maybe want to add this here: https://github.com/firedrakeproject/firedrake/blob/main/pyop2/global_kernel.py#L399. It might be nice to make this optional though since I don't know if we can be confident that all platforms will have this library available. However doing that would involve passing information from TSFC to PyOP2 which might be a little involved.

_cflags = ("-fPIC", "-Wall", "-std=gnu11")
_cxxflags = ("-fPIC", "-Wall")
_ldflags = ("-shared",)
_ldflags = ("-shared", "-lgsl", "-lgslcblas")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think -shared means to make an .so instead of a .a file.

Regardless I think you maybe want to add this here: https://github.com/firedrakeproject/firedrake/blob/main/pyop2/global_kernel.py#L399. It might be nice to make this optional though since I don't know if we can be confident that all platforms will have this library available. However doing that would involve passing information from TSFC to PyOP2 which might be a little involved.

@pbrubeck pbrubeck force-pushed the pbrubeck/hypergeometric branch from 360f315 to d69227a Compare March 5, 2026 10:39

expressions = [((1/3, 1/2, 1), Constant(0.9999) * x),
((1/2, 1/2, 1), Constant(0.9999) * sqrt(x**2+y**2)),
((-1/2, 1/2, 1), Constant(0.4999) * sqrt(x*x + y*y))]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This case is giving a different result for arguments >= 0.5 when compared to scipy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe this is relevant scipy/scipy#8054

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.

2 participants