Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ra1u's full-sized avatar
💻
Focusing

Luka Rahne ra1u

💻
Focusing
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
void TransformIn(const size_t batch_size, const float *input,
const size_t channels, float *output)
{
static const size_t Par = 16;
float x[Par][kWinogradAlpha][kWinogradAlpha];
float T1[Par][kWinogradAlpha][kWinogradAlpha];
for (size_t batch_index = 0; batch_index < batch_size; batch_index++) {
const float *input_batch =
input + batch_index * kWidth * kHeight * channels;
uniform const size_t kWidth = 8;
uniform const size_t kHeight = 8;
uniform const size_t kSquares = kWidth * kHeight;
uniform const size_t kWtiles = 4; //(kWidth + 1) / 2;
uniform const size_t kTiles = kWtiles * kWtiles; // 16
uniform const size_t kWinogradAlpha = 4;
uniform const size_t kWinogradTile = kWinogradAlpha * kWinogradAlpha;
{-# language DeriveFunctor #-}
import Data.Map as DM
import Prelude as P
data Tree v a = Node (Tree v a) a (Tree v a) | Leaf v deriving (Functor)
instance (Show v,Show a) => Show (Tree v a) where
show (Leaf x) = show x
show (Node left x right) = "(" ++ show left ++ " " ++ show x ++
import qualified CLaSH.Prelude as C
import Control.Monad.Trans.State.Lazy
import Control.Monad.Reader
import Control.Monad.Fix
import Prelude
import System.IO.Unsafe
import Control.Monad.IO.Class
#include <string>
#include <iostream>
#include "caf/all.hpp"
#include <vector>
using namespace caf;
actor_system_config g_cfg;
actor_system g_system{g_cfg};
/*
* event_based_actor version
* it works super slow
*/
#include <string>
#include <iostream>
#include "caf/all.hpp"
using std::endl;
using std::string;
@ra1u
ra1u / sphninix
Last active September 27, 2016 14:17
.. function:: level1
.. code-block:: python
def f1():
.. function:: level2
.. code-block:: python
module Test where
import CLaSH.Prelude
ram_data :: Vec 5 (BitVector 3)
ram_data = 0b000
:> 0b011
:> 0b101
:> 0b110
:> 0b111
import Control.Monad.Trans.State.Lazy
import Control.Monad
import Control.Monad.Reader
evalT :: (Monad m) => (b -> m a) -> b -> ([a] -> [b]) -> m [b]
evalT mf def f = r where
am = r >>= traverse mf -- :: m [a]
bm = fmap f am -- :: m [b]
r = fmap (def:) bm -- :: m [b]