Skip to content

Conversation

@szilveszteri
Copy link
Collaborator

Description

newKernel = PyKernel([])
newModule = mlir.Module.parse(asm = ctx.codes[0], context=newKernel.ctx)

#TODO: implement some clone mechanism

Choose a reason for hiding this comment

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

Python has already a deepcopy function in the copy module that works for any object. All you have to do is:
form copy import deepcopy
newKernel = deepcopy(kernel)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, the reason why deepcopy was not used, since it does not actually need a full clone of all the fields (the comment is misleading, so I've deleted it )
Since the pyKernel object contains a copy of the original compiled code (the original Quake IR) it would also make a full copy of that too, which is undesirable

Removed the comment actually

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.

3 participants