-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add the `FloatImmediate` `AbstractType` - Define fp64, fp32, fp16, and bf16 - Add float binding for the Adder in the Generic platform - Add a FloatAdder test to the CI for Siracusa and Generic platforms - Extend `testType.py` with float tests - LIMITATION: Current LLVM compiler does not support bfp16 and fp16, these types are commented in the library header --------- Co-authored-by: alberto <alberto.dequino@unibo.it> Co-authored-by: Victor Jung <jungvi@iis.ee.ethz.ch>
- Loading branch information
1 parent
4097c33
commit 7f33810
Showing
21 changed files
with
344 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# ---------------------------------------------------------------------- | ||
# | ||
# File: FloatAddTemplate.py | ||
# | ||
# Last edited: 13.11.2024 | ||
# | ||
# Copyright (C) 2021, ETH Zurich and University of Bologna. | ||
# | ||
# Authors: | ||
# - Francesco Conti, UNIBO | ||
# - Alberto Dequino, UNIBO | ||
# | ||
# ---------------------------------------------------------------------- | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# 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 | ||
# | ||
# 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. | ||
|
||
from typing import Dict, List, Tuple | ||
|
||
from Deeploy.DeeployTypes import NetworkContext, NodeTemplate, OperatorRepresentation | ||
|
||
|
||
class _FloatAddTemplate(NodeTemplate): | ||
|
||
def alignToContext(self, ctxt: NetworkContext, | ||
operatorRepresentation: OperatorRepresentation) -> Tuple[NetworkContext, Dict, List[str]]: | ||
|
||
data_in_1 = ctxt.lookup(operatorRepresentation['data_in_1']) | ||
data_in_2 = ctxt.lookup(operatorRepresentation['data_in_2']) | ||
data_out = ctxt.lookup(operatorRepresentation['data_out']) | ||
|
||
return ctxt, operatorRepresentation, [] | ||
|
||
|
||
referenceTemplate = _FloatAddTemplate(""" | ||
// Add (Name: ${nodeName}, Op: ${nodeOp}) | ||
BEGIN_SINGLE_CORE | ||
for (uint32_t i=0;i<${size};i++){ | ||
${data_out}[i] = ${data_in_1}[i] + ${data_in_2}[i]; | ||
} | ||
END_SINGLE_CORE | ||
""") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.