 #include <thrust/device_ptr.h>
 #include <thrust/execution_policy.h>
 #include <thrust/sort.h>
+#include "gpu-ops.cuh"
 
 namespace cnn {
 namespace gpu {

  cudaMemcpy(&ods, gpu_ods, sizeof(float), cudaMemcpyDeviceToHost);
  cudaFree(gpu_ods);
  accBinaryExprKernel<<<tb.first, tb.second>>>(n, fx, dEdf, dEdx, FSoftmaxBackward(-ods));
}

void logsoftmax_backward(int n, const float* fx, const float* dEdf, float* dEdx) 

{
    thrust::device_ptr<float> src_ptr = thrust::device_pointer_cast((float*)x);
    thrust::device_ptr<float> tgt_ptr = thrust::device_pointer_cast(y);
    // Y <- X + Y
    thrust::transform(src_ptr, src_ptr + n, tgt_ptr, tgt_ptr, thrust::plus<float>());
}

void set_to_value_of(int n, float* x0, float val)
{
    thrust::device_ptr<float> dev_ptr = thrust::device_pointer_cast(x0);
    thrust::fill(thrust::device, dev_ptr, dev_ptr + n, val);
