Skip to content

Commit

Permalink
Update year in copyright
Browse files Browse the repository at this point in the history
Change "Copyright (C) 2023-2024" to "Copyright (C) 2023-2025"
  • Loading branch information
CongMa13 committed Jan 7, 2025
1 parent 4b77266 commit 9578600
Show file tree
Hide file tree
Showing 253 changed files with 404 additions and 393 deletions.
2 changes: 1 addition & 1 deletion cmake/FindSphinx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# MIT License
#
# Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# MIT License
#
# Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion library/include/hiptensor/hiptensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion library/include/hiptensor/hiptensor_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion library/include/hiptensor/internal/hiptensor_utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion library/include/hiptensor/internal/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion library/src/contraction/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# MIT License
#
# Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion library/src/contraction/contraction_cpu_reference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion library/src/contraction/contraction_cpu_reference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion library/src/contraction/contraction_cpu_reference_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
68 changes: 34 additions & 34 deletions library/src/contraction/contraction_meta_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -34,8 +34,8 @@
#include <element_wise_operation.hpp>

// hiptensor includes
#include "device/device_element_wise_operation_complex.hpp"
#include "data_types.hpp"
#include "device/device_element_wise_operation_complex.hpp"
#include "meta_traits.hpp"

#define MaxNumDimsM 6
Expand All @@ -56,22 +56,22 @@ namespace hiptensor
typename BElementwiseOperation,
typename CDEElementwiseOperation,
typename ComputeDataType>
struct MetaTraits<ck::tensor_operation::device::DeviceContractionMultipleD<
NumDimsM,
NumDimsN,
NumDimsK,
ADataType,
BDataType,
ck::Tuple<DsDataType>,
EDataType,
AElementwiseOperation,
BElementwiseOperation,
CDEElementwiseOperation,
ComputeDataType>,
std::enable_if_t<(std::is_same_v<CDEElementwiseOperation,
ck::tensor_operation::element_wise::Bilinear>) ||
(std::is_same_v<CDEElementwiseOperation,
ck::tensor_operation::element_wise::BilinearComplex>)>>
struct MetaTraits<
ck::tensor_operation::device::DeviceContractionMultipleD<NumDimsM,
NumDimsN,
NumDimsK,
ADataType,
BDataType,
ck::Tuple<DsDataType>,
EDataType,
AElementwiseOperation,
BElementwiseOperation,
CDEElementwiseOperation,
ComputeDataType>,
std::enable_if_t<
(std::is_same_v<CDEElementwiseOperation, ck::tensor_operation::element_wise::Bilinear>)
|| (std::is_same_v<CDEElementwiseOperation,
ck::tensor_operation::element_wise::BilinearComplex>)>>
{
constexpr static ck::index_t DimsM = NumDimsM;
constexpr static ck::index_t DimsN = NumDimsN;
Expand Down Expand Up @@ -111,22 +111,22 @@ namespace hiptensor
typename BElementwiseOperation,
typename CDEElementwiseOperation,
typename ComputeDataType>
struct MetaTraits<ck::tensor_operation::device::DeviceContractionMultipleD<
NumDimsM,
NumDimsN,
NumDimsK,
ADataType,
BDataType,
ck::Tuple<>,
EDataType,
AElementwiseOperation,
BElementwiseOperation,
CDEElementwiseOperation,
ComputeDataType>,
std::enable_if_t<(std::is_same_v<CDEElementwiseOperation,
ck::tensor_operation::element_wise::Scale>) ||
(std::is_same_v<CDEElementwiseOperation,
ck::tensor_operation::element_wise::ScaleComplex>)>>
struct MetaTraits<
ck::tensor_operation::device::DeviceContractionMultipleD<NumDimsM,
NumDimsN,
NumDimsK,
ADataType,
BDataType,
ck::Tuple<>,
EDataType,
AElementwiseOperation,
BElementwiseOperation,
CDEElementwiseOperation,
ComputeDataType>,
std::enable_if_t<
(std::is_same_v<CDEElementwiseOperation, ck::tensor_operation::element_wise::Scale>)
|| (std::is_same_v<CDEElementwiseOperation,
ck::tensor_operation::element_wise::ScaleComplex>)>>
{
constexpr static ck::index_t DimsM = NumDimsM;
constexpr static ck::index_t DimsN = NumDimsN;
Expand Down
68 changes: 34 additions & 34 deletions library/src/contraction/contraction_pack_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -38,33 +38,32 @@ namespace hiptensor
*
*/
template <typename DataType>
__global__ void mfma(DataType* mE_real, DataType* mE_imag, DataType* mD_real, DataType* mD_imag,
HIP_vector_type<DataType, 2> *mE_grid, HIP_vector_type<double, 2> alpha,
HIP_vector_type<double, 2> beta, int length)
__global__ void mfma(DataType* mE_real,
DataType* mE_imag,
DataType* mD_real,
DataType* mD_imag,
HIP_vector_type<DataType, 2>* mE_grid,
HIP_vector_type<double, 2> alpha,
HIP_vector_type<double, 2> beta,
int length)
{
int idx = threadIdx.x + blockIdx.x * blockDim.x;

if(idx < length)
{
if constexpr(std::is_same_v<DataType, float>)
{
mE_grid[idx] = hipCaddf(
hipCmulf(
make_hipFloatComplex(mE_real[idx], mE_imag[idx]),
hipComplexDoubleToFloat(alpha)),
hipCmulf(
make_hipFloatComplex(mD_real[idx], mD_imag[idx]),
hipComplexDoubleToFloat(beta)));
mE_grid[idx] = hipCaddf(hipCmulf(make_hipFloatComplex(mE_real[idx], mE_imag[idx]),
hipComplexDoubleToFloat(alpha)),
hipCmulf(make_hipFloatComplex(mD_real[idx], mD_imag[idx]),
hipComplexDoubleToFloat(beta)));
}
else if constexpr(std::is_same_v<DataType, double>)
{
mE_grid[idx] = hipCadd(hipCmul(
make_hipDoubleComplex(mE_real[idx], mE_imag[idx]),
alpha),
hipCmul(
make_hipDoubleComplex(mD_real[idx], mD_imag[idx]),
beta));
}
mE_grid[idx]
= hipCadd(hipCmul(make_hipDoubleComplex(mE_real[idx], mE_imag[idx]), alpha),
hipCmul(make_hipDoubleComplex(mD_real[idx], mD_imag[idx]), beta));
}
}
}

Expand All @@ -73,48 +72,49 @@ namespace hiptensor
*
*/
template <typename DataType>
__global__ void multiply(DataType* mE_real, DataType* mE_imag, HIP_vector_type<DataType, 2> *mE_grid,
HIP_vector_type<double, 2> alpha, int length)
__global__ void multiply(DataType* mE_real,
DataType* mE_imag,
HIP_vector_type<DataType, 2>* mE_grid,
HIP_vector_type<double, 2> alpha,
int length)
{
int idx = threadIdx.x + blockIdx.x * blockDim.x;

if(idx < length)
{
if constexpr(std::is_same_v<DataType, float>)
{
mE_grid[idx] = hipCmulf(
make_hipFloatComplex(mE_real[idx], mE_imag[idx]),
hipComplexDoubleToFloat(alpha));
mE_grid[idx] = hipCmulf(make_hipFloatComplex(mE_real[idx], mE_imag[idx]),
hipComplexDoubleToFloat(alpha));
}
else if constexpr(std::is_same_v<DataType, double>)
{
mE_grid[idx] = hipCmul(
make_hipDoubleComplex(mE_real[idx], mE_imag[idx]),
alpha);
}
mE_grid[idx] = hipCmul(make_hipDoubleComplex(mE_real[idx], mE_imag[idx]), alpha);
}
}
}

/**
* \brief This function unpacks structured data (hipFloatComplex / hipDoubleComplex)
* into non-structured data (float / double).
*/
template<typename InputType, typename OutputType>
__global__ void unpack(const InputType* in, OutputType* out_real, OutputType *out_img, int length)
template <typename InputType, typename OutputType>
__global__ void
unpack(const InputType* in, OutputType* out_real, OutputType* out_img, int length)
{
int idx = threadIdx.x + blockIdx.x * blockDim.x;

if(idx < length)
{
if constexpr(std::is_same_v<InputType,hipFloatComplex>)
if constexpr(std::is_same_v<InputType, hipFloatComplex>)
{
out_real[idx] = hipCrealf(in[idx]);
out_img[idx] = hipCimagf(in[idx]);
out_img[idx] = hipCimagf(in[idx]);
}
else if constexpr(std::is_same_v<InputType,hipDoubleComplex>)
else if constexpr(std::is_same_v<InputType, hipDoubleComplex>)
{
out_real[idx] = hipCreal(in[idx]);
out_img[idx] = hipCimag(in[idx]);
out_img[idx] = hipCimag(in[idx]);
}
}
}
Expand All @@ -127,7 +127,7 @@ namespace hiptensor
}
};

template<typename T>
template <typename T>
auto allocDevice(int64_t numElements)
{
T* data;
Expand Down
2 changes: 1 addition & 1 deletion library/src/contraction/contraction_selection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion library/src/contraction/contraction_solution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion library/src/contraction/contraction_solution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion library/src/contraction/contraction_solution_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 1 addition & 2 deletions library/src/contraction/contraction_solution_instances.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* MIT License
*
* Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -280,6 +280,5 @@ namespace hiptensor
ck::tensor_operation::element_wise::PassThrough,
ck::tensor_operation::element_wise::ScaleComplex,
hipDoubleComplex>());

}
} // namespace hiptensor
Loading

0 comments on commit 9578600

Please sign in to comment.