Skip to content

Conversation

@matthiasdiener
Copy link
Collaborator

@matthiasdiener matthiasdiener commented Sep 7, 2022

@inducer
Copy link
Owner

inducer commented Sep 9, 2022

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
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,
Copy link
Collaborator Author

@matthiasdiener matthiasdiener Sep 12, 2022

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
Collaborator Author

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
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
Collaborator Author

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 ?

@matthiasdiener matthiasdiener changed the title LoopyPyOpenCLTarget: pass through limit_arg_size_nbytes LoopyPyOpenCLTarget: pass through loopy. PyOpenCLTarget Sep 12, 2022
@matthiasdiener matthiasdiener marked this pull request as ready for review September 12, 2022 23:58
@matthiasdiener matthiasdiener changed the title LoopyPyOpenCLTarget: pass through loopy. PyOpenCLTarget LoopyPyOpenCLTarget: pass through loopy.PyOpenCLTarget Sep 13, 2022
@matthiasdiener
Copy link
Collaborator Author

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
Collaborator Author

I think this PR can be closed right?

@inducer inducer closed this Oct 21, 2022
@inducer
Copy link
Owner

inducer commented Oct 21, 2022

Yep.

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

4 participants