Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 46 additions & 46 deletions dependency.json
Original file line number Diff line number Diff line change
@@ -1,109 +1,109 @@
[
{
"lib": "blas",
"lib": "blas",
"dependsOn": [
"hpc"
]
},
},
{
"lib": "codec",
"lib": "codec",
"dependsOn": [
"utils",
"database",
"utils",
"database",
"quantitative_finance"
]
},
},
{
"lib": "data_analytics",
"lib": "data_analytics",
"dependsOn": [
"utils",
"data_compression",
"security",
"graph",
"utils",
"data_compression",
"security",
"graph",
"database"
]
},
},
{
"lib": "data_compression",
"lib": "data_compression",
"dependsOn": [
"security"
]
},
},
{
"lib": "data_mover",
"lib": "data_mover",
"dependsOn": [
"utils"
]
},
},
{
"lib": "database",
"lib": "database",
"dependsOn": [
"utils"
]
},
},
{
"lib": "dsp",
"lib": "dsp",
"dependsOn": [
"utils",
"utils",
"data_mover"
]
},
},
{
"lib": "graph",
"lib": "graph",
"dependsOn": [
"utils",
"database",
"utils",
"database",
"quantitative_finance"
]
},
},
{
"lib": "hpc",
"lib": "hpc",
"dependsOn": [
"blas",
"blas",
"sparse"
]
},
},
{
"lib": "motor_control",
"lib": "motor_control",
"dependsOn": []
},
},
{
"lib": "quantitative_finance",
"lib": "quantitative_finance",
"dependsOn": [
"utils",
"utils",
"solver"
]
},
},
{
"lib": "security",
"lib": "security",
"dependsOn": [
"utils"
]
},
},
{
"lib": "solver",
"lib": "solver",
"dependsOn": [
"utils",
"utils",
"dsp"
]
},
},
{
"lib": "sparse",
"lib": "sparse",
"dependsOn": [
"blas",
"blas",
"hpc"
]
},
},
{
"lib": "ultrasound",
"lib": "ultrasound",
"dependsOn": []
},
},
{
"lib": "utils",
"lib": "utils",
"dependsOn": []
},
},
{
"lib": "vision",
"lib": "vision",
"dependsOn": []
}
]
2 changes: 1 addition & 1 deletion dsp/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@Library('pipeline-library')_
VitisLibPipeline ( libname:'xf_dsp',
upstream_dependencies:'xf_utils_hw,next,../utils; xf_data_mover,next,../data_mover; dsplib_internal_scripts,main,../dsplib_internal_scripts')
upstream_dependencies:'xf_utils_hw,main,../utils; xf_data_mover,main,../data_mover; dsplib_internal_scripts,main,../dsplib_internal_scripts')
5 changes: 3 additions & 2 deletions dsp/L1/include/aie/fir_tdm_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#ifndef _DSPLIB_FIR_TDM_TRAITS_HPP_
#define _DSPLIB_FIR_TDM_TRAITS_HPP_

#include "mac_lanes_defs.hpp"

/*
TDM FIR traits.
This file contains sets of overloaded, templatized and specialized templatized functions which
Expand Down Expand Up @@ -46,7 +48,6 @@ INLINE_DECL constexpr unsigned int fnFirRangeAsym() {
// TP_FL - FIR Length, TP_CL - Cascade Length, TP_KP - Kernel Position
// make sure there's no runt filters ( lengths < 4)
// make Stream architectures rounded to fnStreamFirRangeRound and only last in the chain possibly odd
// TODO: make Window architectures rounded to fnNumColumnsTdm
return fnFirRange<TP_FL, TP_CL, TP_KP, (1)>();
}
template <unsigned int TP_FL, unsigned int TP_CL, int TP_KP, typename TT_DATA, typename TT_COEFF, unsigned int TP_API>
Expand All @@ -66,7 +67,7 @@ INLINE_DECL constexpr unsigned int fnFirRangeOffsetAsym() {
// function to return the number of lanes for a type combo, for a given IO API type
template <typename TT_DATA, typename TT_COEFF>
INLINE_DECL constexpr unsigned int fnNumLanesTdm() {
return fnNumLanes<TT_DATA, TT_COEFF>();
return fnMacLanes<TT_DATA, TT_COEFF>();
};

// function to return the number of samples in an output vector for a type combo
Expand Down
195 changes: 195 additions & 0 deletions dsp/L1/include/aie/mac_lanes_defs.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
/*
* Copyright (C) 2019-2022, Xilinx, Inc.
* Copyright (C) 2022-2025, Advanced Micro Devices, Inc.
*
* 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

#ifndef _DSPLIB_MAC_LANES_DEFS_HPP_
#define _DSPLIB_MAC_LANES_DEFS_HPP_

/* This file exists to hold utility functions for kernels in general, not specific
to one library element. Also, the functions in this file do not use vector types
or intrinsics so are fit for use by aiecompiler and kernel constructors.
*/

#include <stdio.h>
#include <adf.h>
#include "device_defs.h"
#include "fir_params_defaults.hpp"

using namespace adf;

namespace xf {
namespace dsp {
namespace aie {

#if (__AIE_ARCH__ == 20)
// for io buffer cases
template <typename TT_DATA, typename TT_COEFF>
INLINE_DECL constexpr unsigned int fnMacLanes() {
return 16;
};
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint16, cint32>() {
return 16; // 8 - API min native length is 8, 16 lanes offers better performance.
}; //
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint32, int16>() {
return 8;
}; //
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint32, int32>() {
return 8;
}; //
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint32, cint16>() {
return 8;
}; //
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint32, cint32>() {
return 16;
}; //
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<float, float>() {
return 16;
};
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<bfloat16, bfloat16>() {
return 16;
};

#elif (__AIE_ARCH__ == 21) || (__AIE_ARCH__ == 22)
// 32 x 4 for all cases that use 64-bit accs.
// 16, 32 x 1 for float cases.
// 32, 64 x 1 for bfloat16 cases.
template <typename TT_DATA, typename TT_COEFF>
INLINE_DECL constexpr unsigned int fnMacLanes() {
return 16;
};
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<int16, int16>() {
return 32; // 32 x 4
}; //
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<int16, int32>() {
return 32; // 32 x 1
}; //
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<int32, int16>() {
return 32; // 32 x 1
}; //
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<int32, int32>() {
return 32; // 32 x 1
}; //
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint16, int16>() {
return 32; // 32 x 1
}; //
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint32, int16>() {
return 16; // 32 x 1
}; //
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint32, int32>() {
return 16; // 32 x 1
}; //
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<float, float>() {
#if (__AIE_ARCH__ == 21)
return 32;
#endif
#if (__AIE_ARCH__ == 22)
return 16;
#endif
};
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<bfloat16, bfloat16>() {
return 16;
};

#else // #if (__AIE_ARCH__ == 10)

template <typename TT_DATA, typename TT_COEFF>
INLINE_DECL constexpr unsigned int fnMacLanes() {
return 0;
};
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<int16, int16>() {
return 16;
}; // 16x2
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint16, int16>() {
return 8;
}; // 8x2
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint16, cint16>() {
return 8;
}; // 8x1
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<int32, int16>() {
return 8;
}; // 8x2
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<int32, int32>() {
return 8;
}; // 8x1
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint32, int16>() {
return 4;
}; // 4x2
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint32, cint16>() {
return 4;
}; // 4x1
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint32, int32>() {
return 4;
}; // 4x1
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint32, cint32>() {
return 2;
}; // 2x1
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<int16, int32>() {
return 8;
}; // 8x2
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint16, int32>() {
return 4;
}; // 4x2
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cint16, cint32>() {
return 4;
}; // 4x1
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<float, float>() {
return 8;
};
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cfloat, float>() {
return 4;
};
template <>
INLINE_DECL constexpr unsigned int fnMacLanes<cfloat, cfloat>() {
return 4;
};

#endif
}
}
}

#endif // _DSPLIB_MAC_LANES_DEFS_HPP_
Loading