/**
 * Copyright (c) 2018-19, NVIDIA CORPORATION.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include "opg/matrix/data.hpp"
#include "opg/matrix/part_descriptor.hpp"
#include <raft/linalg/cublas_wrappers.h>
#include <raft/linalg/cusolver_wrappers.h>
#include <raft/comms/comms.hpp>
#include <raft/handle.hpp>

namespace MLCommon {
namespace LinAlg {
namespace opg {

/**
 * @brief performs MNMG Least squares calculation.
 */
void svdEig(const raft::handle_t &handle, const std::vector<Matrix::Data<float>*> &A,
		const Matrix::PartDescriptor& ADesc,
		std::vector<Matrix::Data<float>*> &U, float *S, float *V,
		cudaStream_t *streams,
		int n_streams);

void svdEig(const raft::handle_t &handle, const std::vector<Matrix::Data<double>*> &A,
		const Matrix::PartDescriptor& ADesc,
		std::vector<Matrix::Data<double>*> &U, double *S, double *V,
		cudaStream_t *streams,
		int n_streams);
/** @} */

} // end namespace opg
} // end namespace LinAlg
} // end namespace MLCommon
