a5kin / xentica

GPU-accelerated engine for multi-dimensional cellular automata

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Direct assignment of Variable fails

a5kin opened this issue · comments

When directly assigning Variable to main state:

def absorb(self):
    new_val = core.IntegerVariable()
    self.main.state = new_val

it shows CUDA compiler error:

kernel.cu(174): error: expected an expression

The workaround for this case is:

def absorb(self):
    new_val = core.IntegerVariable()
    self.main.state = new_val + 0

Howewer, it also don't work as expected, see details in bug #34.

It is now possible to assign Variable subclasses directly to state properties.

Reason: code class variable was empty for Variable instances. It is overridden with a getter returning variable name. Also, a dummy setter is added to prevent changing of necessary code.