- Download WSL2 Kernel
- run
wsl --set-default-version 2
in windows command line, so that all future WSL machine will use WSL2.
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
// Place this script in Assets > Editor | |
public class DisablingBitcodeiOS | |
{ | |
[PostProcessBuild( 1000 )] | |
public static void PostProcessBuildAttribute( BuildTarget target, string pathToBuildProject ) | |
{ | |
if(target == BuildTarget.iOS) | |
{ | |
string projectPath = PBXProject.GetPBXProjectPath(pathToBuildProject); |
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
// credit: https://stackoverflow.com/a/56334648 | |
#include <queue> | |
#include <deque> | |
#include <iostream> | |
template <typename T, int MaxLen, typename Container=std::deque<T>> | |
class FixedQueue : public std::queue<T, Container> { | |
public: | |
void push(const T& value) { | |
if (this->size() == MaxLen) { |
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
struct random_access_iterator { | |
using difference_type = std::ptrdiff_t; | |
using value_type = ?; | |
using pointer = value_type*; | |
using reference = value_type&; | |
using iterator_category = std::random_access_iterator_tag; | |
random_access_iterator(); | |
random_access_iterator(const random_access_iterator& rhs); | |
random_access_iterator(random_access_iterator&& rhs); |
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 <cudnn.h> | |
#include <cuda.h> | |
#include <iostream> | |
#include <chrono> | |
#include <thread> | |
int main(int argc, char const *argv[]) { | |
// cuda initialization via cudaMalloc | |
size_t limit = 0; |
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
//Example 2. Application Using C and CUBLAS: 0-based indexing | |
//----------------------------------------------------------- | |
// to compile: nvcc filename.cpp -lcublas -std=c++11 | |
#include <iostream> | |
#include <chrono> | |
#include <thread> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <cuda_runtime.h> |
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
/* This program uses the host CURAND API to generate 100 | |
* pseudorandom floats. | |
* | |
* Code taken verbatim from CURAND library documentation. | |
*/ | |
#include <iostream> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <cuda.h> | |
#include <curand.h> |
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
# Authors: Kyle Kastner | |
# License: BSD 3-clause | |
import theano.tensor as T | |
import numpy as np | |
import theano | |
class rmsprop(object): | |
""" | |
RMSProp with nesterov momentum and gradient rescaling |
NewerOlder