Skip to content

Commit

Permalink
Julia RISCV (#18)
Browse files Browse the repository at this point in the history
* refactor (julia): riscv asm gen, compute_root

* add (julia): gen asm, header

* refactor: halide runtime

* add: rutime object
  • Loading branch information
IgorErin authored Feb 7, 2024
1 parent 8742f24 commit 0ced7ec
Show file tree
Hide file tree
Showing 6 changed files with 475 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
cd build
rm ${{ github.workspace }}/aot/*
./perf_algo --gtest_filter=*halide*
mv *.h *.s ${{ github.workspace }}/aot
mv *.h *.s halide_runtime.o ${{ github.workspace }}/aot
- name: Build for RISC-V
run: |
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ file(GLOB SOURCES src/*.cpp)
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "riscv64")
file(GLOB ASM aot/*.s)
list(APPEND SOURCES ${ASM})
list(APPEND SOURCES aot/halide_runtime.o)
endif()

add_library(algos SHARED ${SOURCES})
Expand Down
56 changes: 56 additions & 0 deletions aot/halide_julia_rv.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#ifndef HALIDE__halide_julia_rv_h
#define HALIDE__halide_julia_rv_h
#include <stdint.h>

// Forward declarations of the types used in the interface
// to the Halide pipeline.
//
// For the definitions of these structs, include HalideRuntime.h

// Halide's representation of a multi-dimensional array.
// Halide::Runtime::Buffer is a more user-friendly wrapper
// around this. Its declaration is in HalideBuffer.h
struct halide_buffer_t;

// Metadata describing the arguments to the generated function.
// Used to construct calls to the _argv version of the function.
struct halide_filter_metadata_t;

#ifndef HALIDE_MUST_USE_RESULT
#ifdef __has_attribute
#if __has_attribute(nodiscard)
#define HALIDE_MUST_USE_RESULT [[nodiscard]]
#elif __has_attribute(warn_unused_result)
#define HALIDE_MUST_USE_RESULT __attribute__((warn_unused_result))
#else
#define HALIDE_MUST_USE_RESULT
#endif
#else
#define HALIDE_MUST_USE_RESULT
#endif
#endif

#ifndef HALIDE_FUNCTION_ATTRS
#define HALIDE_FUNCTION_ATTRS
#endif



#ifdef __cplusplus
extern "C" {
#endif

HALIDE_FUNCTION_ATTRS
int halide_julia_rv(struct halide_buffer_t *_f0_buffer);

HALIDE_FUNCTION_ATTRS
int halide_julia_rv_argv(void **args);

HALIDE_FUNCTION_ATTRS
const struct halide_filter_metadata_t *halide_julia_rv_metadata();

#ifdef __cplusplus
} // extern "C"
#endif

#endif
Loading

0 comments on commit 0ced7ec

Please sign in to comment.