Node_ptr Array<T>::getNode() const { if (!node) { unsigned bytes = this->getDataDims().elements() * sizeof(T); BufferNode<T> *buf_node = new BufferNode<T>(data, bytes, offset, dims().get(), strides().get()); const_cast<Array<T> *>(this)->node = Node_ptr(reinterpret_cast<Node *>(buf_node)); } return node; }
Node_ptr ConditionalJumpNode::CreateFrom(Instruction_ptr i,/*{{{*/ Addr follower, Instruction_list::iterator begin, Instruction_list::iterator end) { ConditionalJump* jump = static_cast<ConditionalJump*>(i.get()); Expression_ptr destination = jump->Second(); Addr address; if (destination->IsType(Expression::GLOBAL)) { address = static_cast<GlobalVariable*>(destination.get())->Address(); } else { message("%p Error! Jump destination is not a GlobalVariable!\n", jump->Address()); address = INVALID_ADDR; } return Node_ptr( new ConditionalJumpNode(address, follower, begin, end) ); }/*}}}*/
Node_ptr bufferNodePtr() { return Node_ptr(reinterpret_cast<Node *>(new BufferNode<T>())); }
Array<T> createValueArray(const dim4 &dims, const T &value) { auto *node = new jit::ScalarNode<T>(value); return createNodeArray<T>(dims, Node_ptr(node)); }