livoxG1: Add OpenCl kernels for collation
This commit is contained in:
@@ -37,12 +37,23 @@ if(ENABLE_STIMBUFFAPI_livoxGen1)
|
|||||||
message(STATUS "Found OpenCL using pkg-config")
|
message(STATUS "Found OpenCL using pkg-config")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Enable assembly language
|
||||||
|
enable_language(ASM)
|
||||||
|
|
||||||
add_library(livoxGen1 SHARED
|
add_library(livoxGen1 SHARED
|
||||||
livoxGen1.cpp
|
livoxGen1.cpp
|
||||||
stagingBuffer.cpp
|
stagingBuffer.cpp
|
||||||
pcloudStimulusBuffer.cpp
|
pcloudStimulusBuffer.cpp
|
||||||
ioUringAssemblyEngine.cpp
|
ioUringAssemblyEngine.cpp
|
||||||
openClCollatingAndMeshingEngine.cpp
|
openClCollatingAndMeshingEngine.cpp
|
||||||
|
openClKernels.cl.S
|
||||||
|
)
|
||||||
|
|
||||||
|
# Set assembler working directory so .incbin can find the .cl file
|
||||||
|
# Also declare dependency on collateDgrams.cl
|
||||||
|
set_source_files_properties(openClKernels.cl.S PROPERTIES
|
||||||
|
COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/collateDgrams.cl"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(livoxGen1 PUBLIC
|
target_include_directories(livoxGen1 PUBLIC
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
__kernel void collate(__global uchar* assembly, __global uchar* collation) {
|
||||||
|
// Placeholder kernel - will be replaced with actual collation logic
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
.section .rodata
|
||||||
|
.global collateKernelStart
|
||||||
|
.global collateKernelEnd
|
||||||
|
.global collateKernelNBytes
|
||||||
|
.type collateKernelStart, @object
|
||||||
|
.type collateKernelEnd, @object
|
||||||
|
.type collateKernelNBytes, @object
|
||||||
|
|
||||||
|
collateKernelStart:
|
||||||
|
.incbin "collateDgrams.cl"
|
||||||
|
collateKernelEnd:
|
||||||
|
|
||||||
|
.section .data
|
||||||
|
collateKernelNBytes:
|
||||||
|
.quad collateKernelEnd - collateKernelStart
|
||||||
|
|
||||||
|
.section .note.GNU-stack,"",@progbits
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#ifndef _LIVOX_GEN1_OPENCL_KERNELS_H
|
||||||
|
#define _LIVOX_GEN1_OPENCL_KERNELS_H
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
namespace smo {
|
||||||
|
namespace stim_buff {
|
||||||
|
|
||||||
|
// External symbols for collate kernel
|
||||||
|
extern const char collateKernelStart[];
|
||||||
|
extern const char collateKernelEnd[];
|
||||||
|
extern const size_t collateKernelNBytes;
|
||||||
|
|
||||||
|
} // namespace stim_buff
|
||||||
|
} // namespace smo
|
||||||
|
|
||||||
|
#endif // _LIVOX_GEN1_OPENCL_KERNELS_H
|
||||||
Reference in New Issue
Block a user