core/operation: fixed inference algorithm
test/cluda/cluda_basics: added a test for temporary allocations