repo_name stringclasses 10
values | file_path stringlengths 29 222 | content stringlengths 24 926k | extention stringclasses 5
values |
|---|---|---|---|
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/sub-group/sub-group-6.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
template <typename T>
auto get_multi_ptr(T *raw_ptr) {
auto multi_ptr =... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/sub-group/sub-group-sizes.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
int main(void) {
sycl::queue q{sycl::gpu_selector_v};
std::cout << "D... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/sub-group/sub-group-3.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
int main() {
sycl::queue q{sycl::gpu_selector_v,
sycl::... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/sub-group/sub-group-1.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
int main() {
sycl::queue q{sycl::gpu_selector_v};
std::cout << "Devic... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/sub-group/sub-group-2.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
int main() {
sycl::queue q{sycl::gpu_selector_v,
sycl::... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/sub-group/sub-group-7.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
template <typename T>
auto get_multi_ptr(T *raw_ptr) {
auto multi_ptr =... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/sub-group/transpose.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <iomanip>
#include <iostream>
#include <vector>
#include <CL/sycl.hpp>
constexpr size_t N = 16;
typedef un... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/sub-group/sub-group-8.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
int main() {
sycl::queue q{sycl::gpu_selector_v,
sycl::... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/sub-group/sub-group-5.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
int main() {
sycl::queue q{sycl::gpu_selector_v,
sycl::... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/sub-group/sg-max-size.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <algorithm>
#include <chrono>
#include <cmath>
#include <iostream>
#include <random>
#include <vector>
#inc... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/atomics/global_atomics_ref.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
int main() {
constexpr int N = 256 * 256;
constexpr int M = 512;
int... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/atomics/test_atomic.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include "align.hpp"
#include <CL/sycl.hpp>
#include <array>
#include <chrono>
#include <iostream>
template <typenam... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/atomics/atomics.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <chrono>
#include <iostream>
#include <string>
#include <unistd.h>
#include <vector>
... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/atomics/local_atomics_ref.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
int main() {
constexpr int N = 256 * 256;
constexpr int M = 512;
con... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/atomics/align.hpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#ifndef __ALIGN
#define __ALIGN 1
#include <CL/sycl.hpp>
#include <array>
#include <chrono>
#include <iostream>
enu... | hpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/registers/histogram256-int.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
#include <random>
#include <vector>
int main() {
constexpr int N = 4096... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/registers/block-load-store.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
template <typename T>
auto get_multi_ptr(T *raw_ptr) {
auto multi_ptr =... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/registers/histogram256-int-shared-private.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
#include <random>
#include <vector>
int main() {
constexpr int N = 4096... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/registers/non-block-load-store.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
int main() {
sycl::queue q{sycl::gpu_selector_v,
sycl::... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/registers/histogram32-int.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
#include <random>
#include <vector>
int main() {
constexpr int N = 4096... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/registers/histogram32-long.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
#include <random>
#include <vector>
int main() {
constexpr size_t N = 4... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/registers/histogram32-int-volatile.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
#include <random>
#include <vector>
int main() {
constexpr int N = 4096... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/MPI/01_omp_mpich/omp_mpich.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <mpi.h>
#include <stdlib.h>
#include <stdio.h>
#include <cmath>
#include <omp.h>
#defin... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/22_mkl_dispatch/dgemm_example_03.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
// Snippet begin
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <omp.h>
#inclu... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/22_mkl_dispatch/dgemm_batch_example_02.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
/*******************************************************************************
* Copyright 2019... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/22_mkl_dispatch/dgemm_example_01.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
// Snippet begin
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <omp.h>
#inclu... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/22_mkl_dispatch/dgemm_example_02.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
// Snippet begin
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <omp.h>
#inclu... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/22_mkl_dispatch/dgemm_dispatch_c.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
// Snippet begin
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <omp.h>
#inclu... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/22_mkl_dispatch/dgemm_batch_example_01.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
// Snippet begin
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <omp.h>
#inclu... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/22_mkl_dispatch/dgemm_target_variant_dispatch_c.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
// Snippet begin
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <omp.h>
#inclu... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/22_mkl_dispatch/common/common.h | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#ifndef _OPENMP_COMMON_H_
#define _OPENMP_COMMON_H_
#define MAX(a,b) ((a) > (b)) ? (a) : (b)
s... | h |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/23_omp_work_group/test_omp_work_group.cpp | //==============================================================
// Copyright © 203 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <omp.h>
double * make_array(int n, double value) {
double* array = ... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/24_device_ptr_addr_clauses/c_use_device_ptr_01.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <omp.h>
#d... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/24_device_ptr_addr_clauses/c_is_device_ptr_01.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <omp.h>
#d... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/00_omp_thread_num/test_omp_thread_num_1.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <omp.h>
void foo() {
#pragma omp target teams distribute parallel... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/00_omp_thread_num/test_omp_thread_num_2.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <omp.h>
void foo() {
#pragma omp target teams distribute parallel... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/00_omp_thread_num/test_omp_thread_num_3.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <omp.h>
void foo() {
#pragma omp target teams distribute parallel... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/21_omp_target_alloc/test_target_map.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <omp.h>
#d... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/21_omp_target_alloc/test_target_map2.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <omp.h>
#d... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/21_omp_target_alloc/test_omp_target_memcpy.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <omp.h>
#d... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/21_omp_target_alloc/test_omp_target_alloc_shared.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <omp.h>
#p... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/21_omp_target_alloc/test_omp_target_alloc_host.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <omp.h>
#p... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/21_omp_target_alloc/test_omp_target_alloc_device.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <omp.h>
#d... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/21_omp_target_alloc/test_omp_target_alloc.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <omp.h>
#d... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/04_target_nowait/test_target_nowait.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
/*
* This test is taken from OpenMP API 5.0.1 Examples (June 2020)
* https://www.openmp.org/wp-... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/04_target_nowait/test_target_no_nowait.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
/*
* This test is taken from OpenMP API 5.0.1 Examples (June 2020)
* https://www.openmp.org/wp-... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/09_invariant_computations/test_loop_invariant.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/09_invariant_computations/test_no_loop_invariant.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/07_loop_bounds/test_loop_bounds_fp.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/07_loop_bounds/test_loop_bounds_nofp_nomap.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/07_loop_bounds/test_loop_bounds_map.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/26_omp_prefetch/c_simd/nbody_c_simd.cpp | #include <chrono>
#include <math.h>
#include <omp.h>
#include <stdio.h>
#define CACHE_CLEAN_SIZE 100000000
#define ITERATIONS 100
#define ARRAYLEN1 4096
#define ARRAYLEN2 32768
#define VECLEN 16
// snippet-begin
#define WORKGROUP_SIZE 1024
#define PREFETCH_HINT 4 // 4 = prefetch to L1 and L3; 2 = prefetch to L3
#defi... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/26_omp_prefetch/c/nbody_c.cpp | #include <math.h>
#include <omp.h>
#include <stdio.h>
#define CACHE_CLEAN_SIZE 100000000
#define ITERATIONS 100
#define ARRAYLEN1 4096
#define ARRAYLEN2 32768
// snippet-begin
#define WORKGROUP_SIZE 1024
#define PREFETCH_HINT 4 // 4 = prefetch to L1 and L3; 2 = prefetch to L3
#define TILE_SIZE 64
void nbody_1d_gpu(f... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/05_scalars_fp/test_scalars_nofp_nomap.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/05_scalars_fp/test_scalars_fp.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/05_scalars_fp/test_scalars_map.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/10_map/test_map_to_or_from.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/10_map/test_map_tofrom.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/06_scalars_private/test_scalars_private.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/06_scalars_private/test_scalars.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/06_scalars_private/test_scalars_private_2.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/11_device_alloc/test_declare_target.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/11_device_alloc/test_map_to.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/11_device_alloc/test_map_alloc.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/11_device_alloc/test_target_alloc.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/03_target_enter_exit_data/test_no_target_enter_exit_data.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/03_target_enter_exit_data/test_target_enter_exit_data.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/08_num_teams/test_num_teams.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/08_num_teams/test_no_num_teams.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/01_collapse/test_collapse_3levels.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/01_collapse/test_no_collapse.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
// Snippet begin
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#inc... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/01_collapse/test_collapse_2levels.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/01_collapse/test_collapse_4levels.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/22_mkl_pad/dgemm_pad_c_01.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
// Snippet begin
#include "mkl.h"
#include "mkl_omp_offload.h"
#include <float.h>
#include <math.... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/02_teams_distribute/test_teams_distribute.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/OpenMP/02_teams_distribute/test_no_teams_distribute.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <omp.h>
#de... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/kernels/launch.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
const int iters = 10000;
class Timer {
public:
Timer() : start_(std::chrono::steady_clock::... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/kernels/profiling-api.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
class Timer {
public:
Timer() : start_(std::chrono::steady_clock::now()) {}
double Elaps... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/conditionals/convolution-global-conditionals-min-max.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
#include <random>
#include <vector>
int main() {
constexpr size_t N = 8... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/conditionals/convolution-global-conditionals.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
#include <random>
#include <vector>
int main() {
constexpr size_t N = 8... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/multiple-queue-submission/multi-queue-heavy-kernel.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <array>
#include <chrono>
#include <iostream>
// Array type and data size for this e... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/multiple-queue-submission/multi-queue-light-kernel.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <array>
#include <chrono>
#include <iostream>
// Array type and data size for this e... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/01_memory_order/memory_order.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
#include <CL/sycl.hpp>
#include <chrono>
#include <iostream>
#include <string>
#include <unistd.h... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/13_openmp_explicit_subdevice/openmp_explicit_subdevice.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <assert.h>
#include <iostream>
#include <omp.h>
#include <stdint.h>
#ifndef NUM_SUBDEVICES
#define NUM_SUBDE... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/04_multi_tile_subdevices/multi_tile_subdevices.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// Snippet begin
try {
vector<device> SubDevices = ...;
auto C = context(SubDevices);
for (auto &D : SubDevices... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/14_explicit_subsubdevice/ccs.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
using namespace sycl;
int main() {
sycl::device d(sycl::gpu_selector_v);... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/11_openmp_root_device/openmp_root_device.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// Snippet begin
int root_id = omp_get_default_device();
#pragma omp target teams distribute parallel for device(roo... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/12_openmp_multi_roots/openmp_multi_roots.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// Snippet begin
Int num_devices = omp_get_num_devices();
#pragma omp parallel for
for (int root_id = 0; root_id < n... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/08_openmp_usm/openmp_usm.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
// Snippet begin
if (exists(“#pragma omp requires unified_shared_memory”)) {
if (LIBOMPTARGET... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/07_explicit_subdevice/explicit_subdevice.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// clang-format off
// Copyright (C) 2020 Intel Corporation
// SPDX-License-Identifier: MIT
#include <CL/sycl.hpp>
#... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/05_multi_tile_root/multi_tile_root.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// Snippet begin
try {
// The queue is attached to the root-device, driver distributes to
// sub - devices, if an... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/03_single_tile_subdevices/single_tile_subdevices.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// Snippet begin
try {
vector<device> SubDevices = ...;
for (auto &D : SubDevices) {
// Each queue is in its ... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/10_openmp_subdevice/openmp_subdevice.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// Snippet begin
#define DEVKIND 0 // TILE
int root_id = omp_get_default_device();
#pragma omp parallel for
for (in... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/02_create_subdevices/create_subdevices.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// Snippet begin
try {
vector<device> SubDevices = RootDevice.create_sub_devices<
cl::sycl::info::partition_p... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/06_multi_roots/multi_roots.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// Snippet begin
try {
auto P = platform(gpu_selector{});
auto RootDevices = P.get_devices();
auto C = context(... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/explicit-scaling/09_openmp_subsubdevice/openmp_subsubdevice.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
// Snippet begin
#define DEVKIND 1 // C-Slice
int root_id = omp_get_default_device();
#pragma omp parallel for
for ... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/multiple-devices/overlap.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <array>
#include <chrono>
#include <iostream>
// Array type and data size for this e... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/usm/utils.hpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <chrono>
class timer {
public:
timer() : start_(std::chrono::steady_clock::now()) {}
double elapsed() ... | hpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/usm/usm-buffer.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <iomanip>
#include <CL/sycl.hpp>
#include "utils.hpp"
const int data_size = 10000000;
const int time_step... | cpp |
oneAPI-samples | data/projects/oneAPI-samples/Publications/GPU-Opt-Guide/slm/convolution-slm-cache.cpp | //==============================================================
// Copyright © 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
#include <iostream>
#include <random>
#include <vector>
int main() {
constexpr size_t N = 8... | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.