Skip to content

Instantly share code, notes, and snippets.

View andfoy's full-sized avatar

Edgar Andrés Margffoy Tuay andfoy

View GitHub Profile
scipy._lib._ccallback.LowLevelCallable
scipy._lib._disjoint_set.DisjointSet
scipy._lib._docscrape.FunctionDoc
scipy._lib._docscrape.Parameter
scipy._lib._threadsafety.ReentrancyLock
scipy._lib._uarray._backend.Dispatchable
scipy._lib._util.MapWrapper
scipy._lib._util._FunctionWrapper
scipy._lib._util._RichResult
scipy.cluster._hierarchy.Heap
scipy._lib._ccallback.LowLevelCallable
scipy._lib._disjoint_set.DisjointSet
scipy._lib._docscrape.FunctionDoc
scipy._lib._docscrape.Parameter
scipy._lib._threadsafety.ReentrancyLock
scipy._lib._uarray._backend.Dispatchable
scipy._lib._util.MapWrapper
scipy._lib._util._FunctionWrapper
scipy._lib._util._RichResult
scipy.cluster._hierarchy.Heap
@andfoy
andfoy / debug.cpp
Created January 27, 2024 01:06
Compare CUDA values from C++ and CuPy in Python using IPC
// This assumes the following CUDA array wrapping interface
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
////////////////////////////////////////////////////////////////// DevVector //
template< typename T >
class DevVector
{
(cupy-dev) C:\Users\Edgar A Margffoy\cupy>pytest -x -v tests\cupyx_tests\scipy_tests\signal_tests\test_ltisys.py::TestPlacePoles::test_real_2
================================================= test session starts =================================================
platform win32 -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0 -- C:\Users\Edgar A Margffoy\miniforge3\envs\cupy-dev\python.exe
cachedir: .pytest_cache
rootdir: C:\Users\Edgar A Margffoy\cupy
configfile: setup.cfg
collected 1 item
tests/cupyx_tests/scipy_tests/signal_tests/test_ltisys.py::TestPlacePoles::test_real_2
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB set_trace (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
import math
import tqdm
import cupy as cp
import numpy as np
from cupy import testing
from cupyx.profiler import benchmark
import inspect
from inspect import Signature, Parameter
from typing import Tuple, List, Set, Dict
from types import ModuleType
from html import escape
import numpy as np
import scipy as sc
import cupyx.scipy as cp
import inspect
from inspect import Signature, Parameter
from typing import Tuple, List, Set, Dict
from types import ModuleType
from html import escape
import numpy as np
import scipy as sc
import cupy as cp
@andfoy
andfoy / cupy_random_broadcast.py
Created September 9, 2022 01:47
CuPy random distributions broadcasting support
import numpy as np
import cupy as cp
import inspect
import random
distributions = {}
random_members = dir(cp.random)
for mem_name in random_members:
mem = getattr(cp.random, mem_name)
if not callable(mem):
(bld) macmini@192 qt-feedstock % python build-locally.py
valid configs are {'linux_64_', 'osx_arm64_', 'osx_64_', 'win_64_', 'linux_aarch64_'}
config not selected, please choose from the following:
1. linux_64_
2. linux_aarch64_
3. osx_64_
4. osx_arm64_
5. win_64_
import os
import unittest
import sys
import torch
import torchvision
from PIL import Image
from torchvision.io.image import read_png, decode_png, read_jpeg, decode_jpeg
import numpy as np