Allow passing, returning, storing function pointers #461

Open
opened 2024-07-17 16:13:08 +08:00 by mwojcik · 1 comment
Member

This would be the first step towards #430 and #431.

e.g.

@nac3
class X(EnvExperiment):
  core: KernelInvariant[Core]
  fn: KernelInvariant[function(?)]

  def build(self):
     self.setattr_device("core")
     self.fn = self.core.precompile(self.function)
   
  @kernel
  def function(self):
     pass
This would be the first step towards #430 and #431. e.g. ```python @nac3 class X(EnvExperiment): core: KernelInvariant[Core] fn: KernelInvariant[function(?)] def build(self): self.setattr_device("core") self.fn = self.core.precompile(self.function) @kernel def function(self): pass ```
Owner

Well that's only required if fn is a KernelInvariant. For a host-only value I think it can be done with the current nac3 features.

Well that's only required if ``fn`` is a KernelInvariant. For a host-only value I think it can be done with the current nac3 features.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#461
No description provided.