This file contains hidden or 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 <hip/hip_runtime.h> | |
#include <iostream> | |
#include <chrono> | |
#include <hip/hip_fp16.h> | |
#include "utils.hpp" | |
#define N (2047 * 1024 * 1024) // MB | |
#define THREADS_PER_BLOCK 256 | |
__global__ void read_kernel(const int* __restrict__ data, long long* __restrict__ sum_out, size_t count) { | |
size_t idx = threadIdx.x + blockIdx.x * blockDim.x; |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# | |
# Dumb script to dump (some) of bcache status | |
# Copyright 2013 Darrick J. Wong. All rights reserved. | |
# | |
# This file is part of Bcache. Bcache is free software: you can | |
# redistribute it and/or modify it under the terms of the GNU General Public | |
# License as published by the Free Software Foundation, version 2. | |
# | |
# This program is distributed in the hope that it will be useful, but WITHOUT |
This file contains hidden or 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
#!/bin/bash | |
# Exit immediately if a command exits with a non-zero status | |
set -e | |
# Function to install ROS Noetic | |
install_ros() { | |
echo "Setting up sources.list for ROS Noetic" | |
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' |
This file contains hidden or 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
#!/bin/bash | |
# Exit immediately if a command exits with a non-zero status | |
set -e | |
# Install ROS Noetic Kobuki core packages | |
echo "Installing ROS Noetic Kobuki core packages" | |
sudo apt-get install -y ros-noetic-kobuki-core | |
# Install additional dependencies |
This file contains hidden or 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
#!/bin/bash | |
# Exit immediately if a command exits with a non-zero status | |
set -e | |
# Setup sources.list | |
echo "Setting up sources.list" | |
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' | |
# Setup your keys |
This file contains hidden or 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
/* | |
AVX implementation of sin, cos, sincos, exp and log | |
Based on "sse_mathfun.h", by Julien Pommier | |
http://gruntthepeon.free.fr/ssemath/ | |
Copyright (C) 2012 Giovanni Garberoglio | |
Interdisciplinary Laboratory for Computational Science (LISC) | |
Fondazione Bruno Kessler and University of Trento | |
via Sommarive, 18 |
This file contains hidden or 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
class Solution { | |
public: | |
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) { | |
if(nums1.size() == 0 || nums2.size() == 0 || (nums1.size() > 1 && *nums1.begin() == *nums1.rbegin()) ||(nums2.size() > 1 && *nums2.begin() == *nums2.rbegin())){ | |
vector<int> &ref = (nums1.size() > 0 ? nums1 : nums2); | |
if(nums1.size() > 0 && nums2.size() > 0){ | |
if (*nums1.begin() == *nums1.rbegin()){ | |
ref = nums2; |
This file contains hidden or 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
#!/bin/bash | |
apt -y install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | |
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" | |
apt update && apt -y install docker-ce docker-compose |
This file contains hidden or 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
contract AbstractVault { | |
address[] public authorizedUsers; | |
address public owner; | |
address public withdrawObserver; | |
address public additionalAuthorizedContract; | |
address public proposedAAA; | |
uint public lastUpdated; | |
bool[] public votes; | |
address [] public observerHistory; | |
modifier onlyAuthorized() { |
This file contains hidden or 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
import android.support.annotation.NonNull; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.io.PrintStream; | |
import java.io.PrintWriter; | |
import java.io.UnsupportedEncodingException; | |
import java.io.Writer; |
NewerOlder