50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#if !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)
|
|
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
// WARNING: this is a legacy fp16 fbgemm implementation and will soon be
|
|
// upgraded to match with new fbgemm interface.
|
|
|
|
#include <cpuinfo.h>
|
|
|
|
#include "fbgemm/FbgemmFPCommon.h"
|
|
#include "fbgemm/FbgemmPackMatrixB.h"
|
|
#include "fbgemm/Utils.h"
|
|
|
|
namespace fbgemm {
|
|
template <>
|
|
struct TypeConverter<float> {
|
|
float operator()(float src) const {
|
|
return src;
|
|
}
|
|
};
|
|
|
|
using GemmParamsFP32 = GemmParams<float>;
|
|
using PackedGemmMatrixFP32 = PackedGemmMatrixB<float>;
|
|
|
|
extern template void cblas_gemm_compute(
|
|
const matrix_op_t transa,
|
|
const int m,
|
|
const float* A,
|
|
const PackedGemmMatrixFP32& Bp,
|
|
const float beta,
|
|
float* C,
|
|
int thread_id,
|
|
int num_threads);
|
|
|
|
template <>
|
|
const isa_descriptor<float>& getIsaHandlers(inst_set_t isa);
|
|
|
|
} // namespace fbgemm
|
|
|
|
#else
|
|
#error "This file should not be included when either TORCH_STABLE_ONLY or TORCH_TARGET_VERSION is defined."
|
|
#endif // !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)
|