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
#include <CL/sycl.hpp> | |
#include <iostream> | |
#include <stdio.h> | |
void run_kernel(const sycl::device &syclDevice) { | |
constexpr int numThreads = 512; | |
try { | |
sycl::queue queue = sycl::queue(syclDevice); | |
sycl::buffer<int, 1> buffer(numThreads); | |
queue |
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
project(HipSyclTest) | |
cmake_minimum_required(VERSION 3.0) | |
set(HIPSYCL_SYCLCC_EXTRA_ARGS -DCOMMON_DEFINE=1) | |
set(HIPSYCL_SYCLCC_EXTRA_ARGS_DEVICE_ONLY -DGPU_DEFINE=1 -ffast-math) | |
find_package(hipsycl REQUIRED) | |
add_executable(HipSyclTest main.cpp module_cpu.cpp module_gpu.cpp) | |
add_sycl_to_target(TARGET HipSyclTest SOURCES module_gpu.cpp) |
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
#include "nvToolsExt.h" | |
#include <iostream> | |
#include <sycl/sycl.hpp> | |
#include <vector> | |
template <int N> class Kernel; | |
constexpr int size = 8; | |
template <int N> void run_kernel(sycl::queue &queue, int *ptr) { |
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
#include <iostream> | |
#include <vector> | |
#include "vkFFT.h" | |
const float inputdata[500] = { | |
-3.5, 6.3, 1.2, 0.3, 1.1, -5.7, 5.8, -1.9, -6.3, -1.4, 7.4, 2.4, | |
-9.9, -7.2, 5.4, 6.1, -1.9, -7.6, 1.4, -3.5, 0.7, 5.6, -4.2, -1.1, | |
-4.4, -6.3, -7.2, 4.6, -3.0, -0.9, 7.2, 2.5, -3.6, 6.1, -3.2, -2.1, | |
6.5, -0.4, -9.0, 2.3, 8.4, 4.0, -5.2, -9.0, 4.7, -3.7, -2.0, -9.5, |
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
import numpy as np | |
def Kittler(im, out): | |
""" | |
The reimplementation of Kittler-Illingworth Thresholding algorithm by Bob Pepin | |
Works on 8-bit images only | |
Original Matlab code: https://www.mathworks.com/matlabcentral/fileexchange/45685-kittler-illingworth-thresholding | |
Paper: Kittler, J. & Illingworth, J. Minimum error thresholding. Pattern Recognit. 19, 41–47 (1986). | |
""" | |
h,g = np.histogram(im.ravel(),256,[0,256]) |
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
#include <cstdio> | |
#define FARM_NB_BITS_IN_VEC 128 | |
#include "farm_sve.h" | |
int main() | |
{ | |
svfloat32_t a, b, c; | |
svbool_t m; | |
for (int i = 0; i < FARM_NB_BITS_IN_VEC / 32; i++) | |
{ |
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
#include <sycl/sycl.hpp> | |
#if BUILD_ONEDPL | |
#define ONEDPL_USE_DPCPP_BACKEND 1 | |
#include <oneapi/dpl/algorithm> | |
#include <oneapi/dpl/async> | |
#include <oneapi/dpl/execution> | |
#endif | |
template <int workGroupSize, int nElements_> struct ExclusivePrefixSumGlobal { |
OlderNewer