-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* style * Emit disassembly code * Track lst file * Return lst * Fix error * Track .lst file * Flake 8 * Create AsmVLIWInstructions that returns assembly instructions and loops * Handle instructions better, need a better way to work with nested loops * Track nesting * Remove independent class * Add tests * Clear cache * Add asm pretty display * Add test for asmdisplay * Flake 8 * Change kernel to test * include kernel name * Chance assert condition * Display completed code * Fix check * Call method not property
- Loading branch information
1 parent
036a868
commit 544c36a
Showing
5 changed files
with
105 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2024 Advanced Micro Devices, Inc. | ||
# SPDX-License-Identifier: MIT | ||
|
||
import pytest | ||
from npu.lib import Plus1, PlusN, RgbaRtpThres | ||
from npu.build.kernelbuilder import KernelObjectBuilder | ||
|
||
|
||
KernelObjectBuilder.clear_cache() | ||
|
||
|
||
def test_asm_kernel_built(): | ||
"""Test if a built kernel returns a string of text""" | ||
|
||
kernelobj = Plus1() | ||
kernelobj.build() | ||
kernelobj.asmdisplay() | ||
assert kernelobj.asm | ||
|
||
|
||
def test_asm_kernel_notbuilt_asm(): | ||
"""Test if a non built kernel returns RuntimeError when calling asm""" | ||
|
||
kernelobj = PlusN() | ||
with pytest.raises(RuntimeError) as excinfo: | ||
_ = kernelobj.asm | ||
|
||
assert 'is not built (compiled)' in str(excinfo.value) | ||
|
||
|
||
def test_asm_kernel_notbuilt_asmdisplay(): | ||
"""Test if a non built kernel returns RuntimeError when calling asmdisplay""" | ||
|
||
kernelobj = RgbaRtpThres() | ||
with pytest.raises(RuntimeError) as excinfo: | ||
_ = kernelobj.asmdisplay() | ||
|
||
assert 'is not built (compiled)' in str(excinfo.value) |