Skip to content

add NumpyArrayContext - #235

Closed
matthiasdiener wants to merge 20 commits into
inducer:mainfrom
matthiasdiener:numpy-rebased2
Closed

add NumpyArrayContext#235
matthiasdiener wants to merge 20 commits into
inducer:mainfrom
matthiasdiener:numpy-rebased2

Conversation

@matthiasdiener

@matthiasdienermatthiasdiener commented Jun 20, 2023

Copy link
Copy Markdown
Collaborator

Continuation of #93, #190.

Please squash

kaushikcfdand others added 12 commits September 1, 2022 13:54
Passing both 'bcast_numpy_array' and '_bcast_actx_array_types' was
ill-defined. For example, in the case of an ArrayContext whose thawed
array type is np.ndarray the specification would contradict between
broadcasting the argument numpy_array to return an object array *OR*
peforming the operation with every leaf array.
Consider the example below,
(
- 'Foo: ArrayContainer' whose arithmetic routines are
generated by `with_container_arithmetic(bcast_numpy=True,
_bcast_actx_array_types=True)`
- 'actx: ArrayContextT' for whom `np.ndarray` is a valid thawed array
type.
)
Foo(DOFArray(actx, [38*actx.ones(3, np.float64)])) + np.array([3, 4, 5])
could be either of:
- array([Foo(DOFArray([array([41, 41, 41])])),
Foo(DOFArray([array([42, 42, 42])])),
Foo(DOFArray([array([43, 43, 43])]))]), OR,
- Foo(DOFArray(actx, array([41, 42, 43])))
@matthiasdienermatthiasdiener changed the title NumpyArrayContextadd NumpyArrayContextJun 20, 2023
@matthiasdiener

Copy link
Copy Markdown
CollaboratorAuthor

I think this is ready for review. With a few small changes to the mirgecom example drivers, I could get them to run with the NumpyArrayContext in this PR.

@matthiasdiener

Copy link
Copy Markdown
CollaboratorAuthor

I'm not sure what the status regarding bcast_numpy_array is (see #95), but otherwise this seems ready for review.

@inducerinducer mentioned this pull request Aug 1, 2024
1 task
@matthiasdiener
matthiasdiener deleted the numpy-rebased2 branch September 6, 2024 22:31
@matthiasdiener
matthiasdiener restored the numpy-rebased2 branch September 6, 2024 22:31
@matthiasdiener
matthiasdiener deleted the numpy-rebased2 branch September 6, 2024 22:31
Sign up for freeto 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

@matthiasdiener@kaushikcfd