Skip to content

LoopyPyOpenCLTarget: pass through loopy.PyOpenCLTarget - #359

Closed
matthiasdiener wants to merge 3 commits into
mainfrom
limit_arg_size
Closed

LoopyPyOpenCLTarget: pass through loopy.PyOpenCLTarget#359
matthiasdiener wants to merge 3 commits into
mainfrom
limit_arg_size

Conversation

@matthiasdiener

@matthiasdienermatthiasdiener commented Sep 7, 2022

Copy link
Copy Markdown
Contributor

@inducer

Copy link
Copy Markdown
Owner

Not sure I love this. In general, we could just set the target on the generated loopy translation unit after it has been generated. This would make pytato's logic entirely independent of the details of loopy target selection, which seems nicer. @kaushikcfd, would you agree?

@kaushikcfd

Copy link
Copy Markdown
Collaborator

This would make pytato's logic entirely independent of the details of loopy target selection, which seems nice

I agree, I think the principled way to do this is not leaking any details about the loopy kernel execution to generate_loopy.

"""

def __init__(self, device: Optional["pyopencl.Device"] = None):
def __init__(self, device: Optional["pyopencl.Device"] = None,

@matthiasdienermatthiasdienerSep 12, 2022

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Create a new constructor arg that accepts an lp.PyOpenCLTarget()

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Is 2942fbf what you had in mind @inducer?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Sorry to be sending you around in circles, but I just realized we don't even need any pytato changes. We can simply subclass LoopyPyOpenCLTarget in the array context and override get_loopy_target there.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

What do you think of inducer/arraycontext@2768fee ?

@matthiasdienermatthiasdiener changed the title LoopyPyOpenCLTarget: pass through limit_arg_size_nbytesLoopyPyOpenCLTarget: pass through loopy. PyOpenCLTargetSep 12, 2022
@matthiasdiener
matthiasdiener marked this pull request as ready for review September 12, 2022 23:58
@matthiasdienermatthiasdiener changed the title LoopyPyOpenCLTarget: pass through loopy. PyOpenCLTargetLoopyPyOpenCLTarget: pass through loopy.PyOpenCLTargetSep 13, 2022
@matthiasdiener

Copy link
Copy Markdown
ContributorAuthor

Testing this together with inducer/arraycontext#189 appears to work as expected, and avoids the test failures seen in illinois-ceesd/mirgecom#746

@matthiasdiener
matthiasdiener marked this pull request as draft September 13, 2022 15:52
@matthiasdiener

Copy link
Copy Markdown
ContributorAuthor

I think this PR can be closed right?

@inducerinducer closed this Oct 21, 2022
@inducer

Copy link
Copy Markdown
Owner

Yep.

@inducer
inducer deleted the limit_arg_size branch October 21, 2022 20:27
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.

3 participants

@matthiasdiener@inducer@kaushikcfd