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
// CacheSmth.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
#include <chrono> | |
#include <iostream> | |
struct Timer | |
{ | |
Timer() |
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
const int N_VECTORS = 1<<20; | |
const int VECTOR_COMPONENTS = 512; | |
const int KBlockSize = 256; | |
__global__ | |
void calculateDistances(const float v[VECTOR_COMPONENTS], float *vectors, float *distances) | |
{ | |
int vectorIndex = threadIdx.x + threadIdx.y * KBlockSize; | |
if (vectorIndex < N_VECTORS) { | |
float *vector = vectors + vectorIndex * VECTOR_COMPONENTS; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> | |
<Type Name="Vectormath::Aos::Vector3"> | |
<DisplayString>({mVec128.m128_f32[0]}, {mVec128.m128_f32[1]}, {mVec128.m128_f32[2]})</DisplayString> | |
<Expand> | |
<Item Name="[x]">mVec128.m128_f32[0]</Item> | |
<Item Name="[y]">mVec128.m128_f32[1]</Item> | |
<Item Name="[z]">mVec128.m128_f32[2]</Item> | |
</Expand> |
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
// Start with 20 civ and 8 mil factories | |
val civ_fact_init = 20 | |
val mil_fact_init = 8 | |
// Simulate for 2 years | |
val time = 356 * 2 | |
// Consts of factories in work-days, one civ produces 1 work per day | |
val mil_fact_cost = 720 | |
// Civ is twice the mil |
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
#define VERSION 1.0.0.0 | |
#define XSTR(x) #x | |
#define STR(x) XSTR(x) | |
#define _VERSION _L(STR(VERSION)) | |
_VERSION |
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 System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Globalization; | |
using System.Linq; | |
using System.Text; | |
namespace PrecedenceClimbing | |
{ | |
internal enum TokenType |
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
// Vectormath https://github.com/erwincoumans/sce_vectormath | |
class Ray | |
{ | |
public: | |
Ray(); | |
public: | |
Vectormath::Aos::Vector3 m_pos; | |
Vectormath::Aos::Vector3 m_dir; | |
Vectormath::Aos::Vector3 m_invDir; // 1.0f / m_dir per elem | |
float m_min; |
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 <beagle/GA.hpp> | |
#include <vector> | |
#include <stdio.h> | |
using namespace std; | |
using namespace Beagle; | |
class MaxFctFloatEvalOp : public EvaluationOp { | |
public: | |
typedef Beagle::AllocatorT<MaxFctFloatEvalOp, EvaluationOp::Alloc> Alloc; |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <papi.h> | |
#define NUM_EVENTS 4 | |
void matmul(const double *A, const double *B, | |
double *C, int m, int n, int p) | |
{ | |
int i, j, k; |
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 <QDebug> | |
#include "recentlyopenedmodel.h" | |
RecentlyOpenedModel::RecentlyOpenedModel(QObject *parent) : | |
QSortFilterProxyModel(parent), maxItemsCount(INT_MAX) | |
{ | |
setDynamicSortFilter(true); | |
} | |
int RecentlyOpenedModel::maxItems() const |
NewerOlder