Skip to content

Instantly share code, notes, and snippets.

View kaushikcfd's full-sized avatar

Kaushik Kulkarni kaushikcfd

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file has been truncated, but you can view the full file.
import loopy as lp
import numpy as np
from pymbolic.primitives import *
apply_inv_vandermonde_knl_knl = lp.make_function(
[
"[nelements] -> { [iel] : 0 <= iel < nelements }",
"[n_from_dofs] -> { [idof] : 0 <= idof < n_from_dofs }",
"[n_from_dofs] -> { [jdof] : 0 <= jdof < n_from_dofs }",
This file has been truncated, but you can view the full file.
#define lid(N) ((int) get_local_id(N))
#define gid(N) ((int) get_group_id(N))
#if __OPENCL_C_VERSION__ < 120
#pragma OPENCL EXTENSION cl_khr_fp64: enable
#endif
static void apply_inv_vandermonde_knl(int const n_from_dofs, int const nelements, __global double const *__restrict__ nodal_coeffs, __global double *__restrict__ result, __global double const *__restrict__ vdm_inv);
static void face_mass(__global double const *__restrict__ jac_surf, __global double const *__restrict__ mat, int const nelements, int const nface_nodes, int const nfaces, int const nvol_nodes, __global double *__restrict__ result, __global double const *__restrict__ vec);
static void resample_by_picking(__global double const *__restrict__ ary, int const nelements_vec, int const n_from_nodes, __global long const *__restrict__ from_element_indices, int const n_to_nodes, int const nelements, __global int const *__restrict__ pick_list, __global double *__restrict__ result);
static void resample_by_picking_0(__global double const *__restrict__
Program: startup/nozzle.py
333.143 gridify meshmode/array_context.py:1051
├─ 324.009 _collective_transform loopy/program.py:678
│ ├─ 211.336 split_iname loopy/transform/iname.py:333
│ │ └─ 211.215 _split_iname_backend loopy/transform/iname.py:219
│ │ ├─ 85.291 map_kernel loopy/symbolic.py:1256
│ │ │ ├─ 36.294 <listcomp> loopy/symbolic.py:1257
│ │ │ │ ├─ 20.779 with_transformed_expressions loopy/kernel/instruction.py:935
│ │ │ │ │ └─ 19.817 <lambda> loopy/symbolic.py:1264
This file has been truncated, but you can view the full file.
#define lid(N) ((int) get_local_id(N))
#define gid(N) ((int) get_group_id(N))
#if __OPENCL_C_VERSION__ < 120
#pragma OPENCL EXTENSION cl_khr_fp64: enable
#endif
static void elwise_linear(__global double const *__restrict__ mat, int const nelements, __global double *__restrict__ result, __global double const *__restrict__ vec);
static void rsmpl_pck_and_rsmpl_pck_and_rsmpl_pck_and_rsmpl_pck_3(__global double *__restrict__ result, __global double const *__restrict__ ary_0, int const nelements_result, int const nelements_vec_0, __global long const *__restrict__ from_element_indices_0, int const nelements_0, __global int const *__restrict__ pick_list_0, __global long const *__restrict__ to_element_indices_0, __global double const *__restrict__ ary_1, int const nelements_vec_1, __global long const *__restrict__ from_element_indices_1, int const nelements_1, __global int const *__restrict__ pick_list_1, __global long const *__restrict__ to_element_indices_1, __global double const *__restrict__ ary_2, int const nel
This file has been truncated, but you can view the full file.
import loopy as lp
import numpy as np
from pymbolic.primitives import *
kernel = lp.make_kernel(
[
"[ntgt_boxes] -> { [itgt_box_outer, itgt_box_inner] : itgt_box_inner >= 0 and -16itgt_box_outer <= itgt_box_inner <= 15 and itgt_box_inner < ntgt_boxes - 16itgt_box_outer }",
"[isrc_start, isrc_stop] -> { [isrc_box] : isrc_start <= isrc_box < isrc_stop }",
"{ [idim, idim_0, idim_1] : 0 <= idim <= 2 and 0 <= idim_0 <= 2 and 0 <= idim_1 <= 2 }",
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kaushikcfd
kaushikcfd / common.py
Created December 2, 2020 00:04
Producer Consumer
RATE = 1
FILENAME = "data.log"
MAX_STEPS = 1000
import pytato as pt
import numpy as np
import pyopencl as cl
import loopy as lp
from time import time
def stress_test():
cl_ctx = cl.create_some_context()
queue = cl.CommandQueue(cl_ctx)
from html.parser import HTMLParser
import requests
import re
import json
import itertools
import islpy as isl
def dense_grid_to_aij(dense_vector):
aij = {}