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
{ | |
description = "C/C++ environment"; | |
inputs = { | |
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | |
utils.url = "github:numtide/flake-utils"; | |
}; | |
outputs = { self, nixpkgs, utils, ... }@inputs: | |
utils.lib.eachDefaultSystem ( |
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
use hidapi::{HidDevice, HidError}; | |
const PAYLOAD_SIZE: usize = 128; | |
// Factory-values for the VID and PID | |
const VID: u16 = 0x1a0d; | |
const PID: u16 = 0x15d8; | |
#[derive(Debug, thiserror::Error)] | |
pub enum Error { |
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
ERROR: Enzyme execution failed. | |
Enzyme compilation failed. | |
Current scope: | |
; Function Attrs: mustprogress willreturn | |
define internal fastcc void @preprocess_julia_sqrt_13911([2 x double]* noalias nocapture nofree noundef nonnull writeonly sret([2 x double]) align 8 dereferenceable(16) %0, [2 x double] addrspace(11)* nocapture noundef nonnull readonly align 8 dereferenceable(16) "enzymejl_parmtype"="132501377410576" "enzymejl_parmtype_ref"="1" %1) unnamed_addr #79 !dbg !9095 { | |
top: | |
%2 = call noalias nonnull dereferenceable(16) dereferenceable_or_null(16) i8* @malloc(i64 16), !enzyme_fromstack !5228 | |
%3 = bitcast i8* %2 to { double, i64 }*, !enzyme_caststack !68 | |
%4 = call {}*** @julia.get_pgcstack() #81 | |
%ptls_field93 = getelementptr inbounds {}**, {}*** %4, i64 2 |
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 <arpa/inet.h> | |
#include <errno.h> | |
#include <inttypes.h> | |
#include <netinet/in.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/socket.h> | |
const int UDP_PAYLOAD = 8200; |
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
use std::fs; | |
type FileDescriptor = usize; | |
type Entries = Vec<FileDescriptor>; | |
#[derive(Debug, Clone)] | |
enum FileKind { | |
RegularFile(usize), | |
Directory(Entries), | |
} |
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
using PkgTemplates | |
t = Template(; | |
user="kiranshila", | |
dir="~/Projects/Julia", | |
julia=v"1.8", | |
plugins=[ | |
License(;name="MIT"), | |
Git(;ssh=true,gpgsign=true), | |
CompatHelper(), |
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
# In external Julia libraries | |
struct KATCPClient end | |
struct TAPCPClient end | |
# In CasperFPGA.jl | |
abstract type AbstractCasperTransport end | |
struct KatcpTransport <: AbstractCasperTransport end | |
struct TapcpTransport <: AbstractCasperTransport end | |
AbstractCasperTransport(::Type{KATCPClient}) = KatcpTransport() |
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 <dada_def.h> | |
#include <dada_hdu.h> | |
#include <fcntl.h> | |
#include <ipcbuf.h> | |
#include <multilog.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/stat.h> | |
void print_arr(char *ptr, int len) { |
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
from click import BadParameter | |
from pyvisa import ResourceManager | |
from pyvisa.resources import MessageBasedResource | |
from enum import Enum | |
import numpy as np | |
import pandas as pd | |
# Enums for discrete value selections | |
class Bandwidth(Enum): |
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
use num_derive::{FromPrimitive, ToPrimitive}; | |
use num_traits::{FromPrimitive, ToPrimitive}; | |
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, FromPrimitive, ToPrimitive)] | |
#[allow(non_camel_case_types)] | |
#[repr(u16)] | |
enum SyntaxKind { | |
L_PAREN = 0, // '(' | |
R_PAREN, // ')' | |
ATOM, // '+', '15' |
NewerOlder