|
|
@ -138,8 +138,9 @@ real evalBernstein(const xarray<real, N>& phi, const uvector<real, N>& x) |
|
|
|
class PowerTensor : public Primitive |
|
|
|
{ |
|
|
|
public: |
|
|
|
xarray<real, 3> tensor; |
|
|
|
SparkStack<real>* sparkStackPtr; |
|
|
|
xarray<real, 3> tensor; |
|
|
|
|
|
|
|
// SparkStack<real>* sparkStackPtr;
|
|
|
|
|
|
|
|
void print() override { std::cout << "Power" << std::endl; } |
|
|
|
|
|
|
@ -149,9 +150,10 @@ public: |
|
|
|
|
|
|
|
PowerTensor(uvector<int, 3> ext_) |
|
|
|
{ |
|
|
|
tensor.ext_ = ext_; |
|
|
|
tensor.data_ = nullptr; |
|
|
|
sparkStackPtr = algoim_spark_alloc_heap(real, tensor); |
|
|
|
tensor.ext_ = ext_; |
|
|
|
tensor.data_ = nullptr; |
|
|
|
algoim_spark_alloc(real, tensor); |
|
|
|
// sparkStackPtr = algoim_spark_alloc_heap(real, tensor);
|
|
|
|
xarrayInit(tensor); |
|
|
|
} |
|
|
|
|
|
|
@ -159,10 +161,10 @@ public: |
|
|
|
|
|
|
|
~PowerTensor() |
|
|
|
{ |
|
|
|
if (sparkStackPtr) { |
|
|
|
algoim_spark_release_heap(sparkStackPtr); |
|
|
|
sparkStackPtr = nullptr; |
|
|
|
} |
|
|
|
// if (sparkStackPtr) {
|
|
|
|
// algoim_spark_release_heap(sparkStackPtr);
|
|
|
|
// sparkStackPtr = nullptr;
|
|
|
|
// }
|
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|