Giter VIP home page Giter VIP logo

fpga_sort's Introduction

FPGA Sort

FPGA Sort is a sorting library for FPGA implementation. This has a hardware engine in RTL to perform the sorting process and call it a library from the OpenCL kernel code. The engine is built by combining the following three hardware sorting algorithms: the sorting network, high-bandwidth merge sorter tree, and virtual merge sorter tree.

fpga_sort.png

License

This product is licensed under the Apache License, Version 2.0.

How to use

  1. cd eval
  2. Prepare a Makefile like the following
# Compiler
NVCC := nvcc

# Compilation flags
NVCCFLAGS               := -O3 -arch=sm_70 -g -std=c++11 -Xcompiler -Wall -Xcompiler -Wextra -Xcompiler -fopenmp
NVCC_NONSUPPORTED_FLAGS := -Wl,--no-as-needed

# Target
TARGET := eval_fpga_sort.exe
AOCX   := intel_fpga_sort.aocx

# Files
SRCS := main.cu
LIBS := cuda rt

# Settings of the OpenCL kernel code compilation
CL_KERNEL              := intel_fpga_sort.cl
CL_XML                 := fpga_sort.xml
CL_OBJ                 := fpga_sort.aoco
CL_LIB                 := fpga_sort.aoclib
OFFLINE_COMPILER       := aoc
OFFLINE_COMPILER_FLAGS := -report -g -v
# if you use a10pl4_dd4gb_gx115_m512, change to -board=a10pl4_dd4gb_gx115_m512
TARGETED_FPGA_BOARD    := p520_max_sg280h

# Make it all!
all: Makefile $(SRCS) $(CL_KERNEL) $(AOCX) compile

compile:
	$(NVCC) $(NVCCFLAGS) -Xcompiler -fPIC $(shell aocl compile-config) -DCL_TARGET_OPENCL_VERSION=200 $(SRCS) $(filter-out $(NVCC_NONSUPPORTED_FLAGS),$(shell aocl link-config)) $(foreach L,$(LIBS),-l$L) -o $(TARGET)

$(AOCX):
	$(OFFLINE_COMPILER) -board=$(TARGETED_FPGA_BOARD) -c $(CL_XML) -o $(CL_OBJ)
	aocl library create -o $(CL_LIB) $(CL_OBJ)
	aoc -board=$(TARGETED_FPGA_BOARD) $(OFFLINE_COMPILER_FLAGS) -I./ -l$(CL_LIB) $(CL_KERNEL) -o $(AOCX)

run:
	env OMP_NUM_THREADS=14 numactl --cpunodebind=1 --localalloc ./$(TARGET) $(AOCX) 10

emulate:compile
	$(OFFLINE_COMPILER) -board=$(TARGETED_FPGA_BOARD) -c $(CL_XML) -o $(CL_OBJ)
	aocl library create -o $(CL_LIB) $(CL_OBJ)
	$(OFFLINE_COMPILER) -DUSE_EMULATOR -march=emulator -legacy-emulator -board=$(TARGETED_FPGA_BOARD) $(OFFLINE_COMPILER_FLAGS) -I./ -l$(CL_LIB) $(CL_KERNEL) -o $(AOCX)
	env CL_CONTEXT_EMULATOR_DEVICE_INTELFPGA=1 OMP_NUM_THREADS=14 numactl --cpunodebind=1 --localalloc ./$(TARGET) $(AOCX) 10

config:
	env ACL_PCIE_USE_JTAG_PROGRAMMING=1 aocl program acl0 $(AOCX)

.PHONY: clean
clean:
	rm -rf $(TARGET) $(CL_OBJ) $(CL_LIB) .emu_models intel_fpga_sort.aoco intel_fpga_sort.aocr reprogram_temp.sof
  1. Compile the kernel code, host code, and run the application.

Grants

Grants-in-Aid for Scientific Research-KAKENHI- "Early-Career Scientists" by Japan Society for the Promotion of Science.

URL: https://kaken.nii.ac.jp/en/grant/KAKENHI-PROJECT-19K20276/

Publications

fpga_sort's People

Contributors

monotone-rk avatar

Stargazers

puellacoco avatar  avatar Ryuta Suzuki avatar  avatar

Watchers

 avatar

Forkers

r-sakamoto

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.