Skip to content

Instantly share code, notes, and snippets.

View MathiasMagnus's full-sized avatar

Nagy-Egri Máté Ferenc MathiasMagnus

View GitHub Profile
@MathiasMagnus
MathiasMagnus / Microsoft.PowerShell_profile.ps1
Created April 12, 2024 08:54
My roaming PowerShell profile
if($IsWindows)
{
function vs
{
if (!(Get-Module -Name Microsoft.VisualStudio.DevShell))
{
$InstallPath = Get-CimInstance MSFT_VSInstance -Namespace root/cimv2/vs | `
Sort-Object -Property InstallDate | `
Select-Object -First 1 -ExpandProperty InstallLocation
Import-Module "$InstallPath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
@MathiasMagnus
MathiasMagnus / 001-remove-hardcoded-builder-path.patch
Created February 13, 2024 14:54
Patch HIP SDK 5.7 for use with CMake
diff --git a/lib/cmake/hip-lang/hip-lang-targets.cmake b/lib/cmake/hip-lang/hip-lang-targets.cmake
index e46663b..63803d9 100644
--- a/lib/cmake/hip-lang/hip-lang-targets.cmake
+++ b/lib/cmake/hip-lang/hip-lang-targets.cmake
@@ -41,8 +41,14 @@ unset(_targetsNotDefined)
unset(_expectedTargets)
-# The installation prefix configured by this project.
-set(_IMPORT_PREFIX "C:/constructicon/builds/gfx/two/23.30/drivers/compute/install/native/Release/x64/hip")
@MathiasMagnus
MathiasMagnus / 001-fix-format-overrides.patch
Created February 12, 2024 21:30
Fix GCC13's libstdc++ `format` header for compilation with Clang
diff --git a/c++/13/format b/c++/13/format
index 9d5981e..9a3896b 100644
--- a/c++/13/format
+++ b/c++/13/format
@@ -3553,14 +3553,14 @@ namespace __format
using iterator = typename _Scanner<_CharT>::iterator;
- void
+ constexpr void
@MathiasMagnus
MathiasMagnus / Main.cpp
Created September 11, 2023 16:49
Compiler detection
#include <string_view>
namespace compiler {
#if defined(_MSC_VER) && !defined(__clang__)
inline constexpr std::string_view name{"MSVC"};
#elif defined(__GNUC__) && !defined(__clang__)
inline constexpr std::string_view name{"GCC"};
#elif defined(SYCL_LANGUAGE_VERSION) && defined (__INTEL_LLVM_COMPILER)
inline constexpr std::string_view name{"DPC++"};
#elif defined(__NVCC__)
@MathiasMagnus
MathiasMagnus / GenerateVisualC++ConfigurePresets.cmake
Created February 16, 2023 18:03
Script extracting the environment of BuildTasks from MSBuilt PlatformToolsets in CMakePresets.json format
# Example invocation: cmake
# -D PRESET_NAME=developer-command-prompt-clangcl-x64
# -D PRESET_FILE=Toolchain-ClangCL-MakefileGenerators.json
# -D GENERATOR="Visual Studio 17 2022"
# -D PLATFORM=x64
# -D TOOLSET=ClangCL
# -D INSTANCE=C:\Kellekek\Microsoft\VisualStudio\2022\BuildTools
# -P .\GenerateVisualC++ConfigurePresets.cmake
cmake_minimum_required(VERSION 3.0)
@MathiasMagnus
MathiasMagnus / windows-servercore2019-base.Dockerfile
Created June 10, 2022 04:20
Images used in OpenCL ecosystem building
# escape=`
# Use the latest Windows Server Core image with .NET Framework 4.8.
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ENV IMAGE_BUILDTOOLS_DIR="C:\Tools\Microsoft\VisualStudio\2022\BuildTools" `
IMAGE_CMAKE_PREFIX="C:\Tools\Kitware\CMake" `
IMAGE_GIT_PREFIX="C:\Tools" `
IMAGE_GIT_VER="2.35.1" `
@MathiasMagnus
MathiasMagnus / install.sh
Created January 18, 2022 15:47
Build GROMACS with hipSYCL built against LLVM in ROCm
# All this works in rocm-terminal:latest (tested with current 4.5)
# wget a reasonably new CMake, because I won't be using old CMake versions unless absolutely necessary
export CMAKE_VER="3.21.2"
export CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-Linux-x86_64.tar.gz
sudo apt update
sudo apt install wget tar apt-transport-https software-properties-common -y
wget -c $CMAKE_URL -O - | tar -xz
mv cmake-* .local
export PATH=/home/rocm-user/.local/bin/:${PATH}
@MathiasMagnus
MathiasMagnus / basic-rocprof.txt
Created November 28, 2021 12:32
Basic configuration for rocprofiler
pmc: VALUInsts SALUInsts VALUUtilization VALUBusy SALUBusy L2CacheHit MemUnitBusy
@MathiasMagnus
MathiasMagnus / AppxManifest.xml
Created November 13, 2020 14:54
Toy manifest for CMake as an MSIX package (Desktop Bridge)
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4" xmlns:uap6="http://schemas.microsoft.com/appx/manifest/uap/windows10/6" xmlns:uap7="http://schemas.microsoft.com/appx/manifest/uap/windows10/7" xmlns:uap8="http://schemas.microsoft.com/appx/manifest/uap/windows10/8" xmlns:uap10="http://schemas.microsoft.com/appx/manifest/uap/windows10/10" xmlns:mobile="http://schemas.microsoft.com/appx/manifest/mobile/windows10" xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" xmlns:desktop2="http://schemas.microsoft.com/appx/manifest/desktop/windows10/2" xmlns:desktop6="http://schem
@MathiasMagnus
MathiasMagnus / Find-Articles.ps1
Created December 12, 2019 10:01
Google Scholar search hit count
2015..2019 | % { ((iwr ("https://scholar.google.com/scholar?q=clBLAS&hl=en&as_sdt=0%2C5&as_ylo=$_&as_yhi="+($_+1))).RawContent) -cmatch "About ([0-9]+) results" | Out-Null; $Matches[1] }