         int cholesky__(LaunchContext *context, NDArray *input, NDArray *output, bool inplace) {
             if (!inplace)
                 output->assign(input);
-            defaultContext = context;
             std::unique_ptr<NDArray> tempOutput(output->dup());
             cusolverDnHandle_t handle = nullptr;
             auto n = input->sizeAt(-1);

namespace nd4j {
namespace ops {
namespace helpers {
    nd4j::LaunchContext* defaultContext = nd4j::LaunchContext::defaultContext();

//    template <typename T>
//    static __device__ void swapRows_(T* matrix, Nd4jLong* shape, int theFirst, int theSecond, Nd4jLong N) {
//        if (theFirst != theSecond) {

                dtype = DataType::FLOAT32;

            auto matrix = NDArrayFactory::create(input->ordering(), {n, n}, dtype,
                                                 LaunchContext::defaultContext()); //, block.getWorkspace());
            auto det = NDArrayFactory::create<T>(1);
            auto stream = context->getCudaStream();
            NDArray::prepareSpecialUse({output}, {input});
