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
object reduce_vs_fold { | |
println("Welcome to Eclipse Scala worksheet") //> Welcome to Eclipse Scala worksheet | |
def time[A](f: => A) = { | |
val now = System.nanoTime | |
val result = f | |
val micros = (System.nanoTime - now) / 1000.0 | |
println("%12.4f micro seconds".format(micros)) | |
result | |
} //> time: [A](f: => A)A |
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
import copy | |
class HaloEnumerator(object): | |
""" | |
Enumerates all points of n-dimensional matrix described by shape that are on the exterior of the matrix | |
where the exterior thickness is described by halo, halo must be the same size as shape. | |
Currently halos have only one value for each dimension though it perhaps should be built to accommodate | |
a separate value for low indices and high indices | |
""" |
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
// See LICENSE for license details. | |
package simple.example | |
import chisel3._ | |
import chisel3.iotesters.{PeekPokeTester, runPeekPokeTester, Backend} | |
import chisel3.util.{Cat, Fill} | |
import org.scalatest.{Matchers, FlatSpec} | |
class Padable(val numBits: Int, val radixPoint: Int) extends Bundle { |
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
// <file: control.c> | |
#include <stdio.h> | |
#include <time.h> | |
#ifdef __APPLE__ | |
#include <OpenCL/opencl.h> | |
#else | |
#include <CL/cl.h> | |
#endif | |
int control(cl_command_queue queue, cl_kernel kernel_0, cl_mem out, cl_mem mesh) { |
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
// <file: control.c> | |
#include <stdio.h> | |
#include <time.h> | |
#ifdef __APPLE__ | |
#include <OpenCL/opencl.h> | |
#else | |
#include <CL/cl.h> | |
#endif | |
int control(cl_command_queue queue, cl_kernel kernel_0, cl_mem out, cl_mem mesh) { |
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
// <file: kernel_0.cl> | |
#pragma OPENCL EXTENSION cl_khr_fp64 : enable | |
#define encode514_514_514(x0, x1, x2) (264196 * (long) (x0) + 514 * (long) (x1) + 1 * (long) (x2)) | |
#define encode514_514(x0, x1) (514 * (long) (x0) + 1 * (long) (x1)) | |
#define encode10_18(x0, x1) (18 * (long) (x0) + 1 * (long) (x1)) | |
__kernel void kernel_0(__global double* out, __global double* mesh) { | |
size_t tile_id_1 = get_group_id(0); | |
size_t tile_id_2 = get_group_id(1); | |
size_t packed_global_id_1 = get_global_id(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
// <file: kernel_0.cl> | |
#pragma OPENCL EXTENSION cl_khr_fp64 : enable | |
#define encode514_514_514(x0, x1, x2) (264196 * (long) (x0) + 514 * (long) (x1) + 1 * (long) (x2)) | |
#define encode514_514(x0, x1) (514 * (long) (x0) + 1 * (long) (x1)) | |
#define encode10_18(x0, x1) (18 * (long) (x0) + 1 * (long) (x1)) | |
__kernel void kernel_0(__global double* out, __global double* mesh) { | |
__local double local_buf_0[180]; | |
__local double local_buf_1[180]; | |
__local double local_buf_2[180]; |
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
class MyBundle extends Bundle { | |
val x = Bool() | |
val y = UInt(8.W) | |
val z = Bool() | |
} | |
object MyBundle { | |
/** | |
* initialize x and y but not z, | |
* @return |
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
// See LICENSE for license details. | |
package examples | |
/** | |
* verilator and interpreter have inconsistent behavior around reset. | |
*/ | |
import java.io.File |
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
package hardwaresort | |
import chisel3._ | |
import chisel3.experimental.FixedPoint | |
import chisel3.internal.firrtl.KnownBinaryPoint | |
import chisel3.iotesters.PeekPokeTester | |
import chisel3.util.log2Ceil | |
//scalastyle:off magic.number | |
/** |
OlderNewer