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 NDEBUG | |
#include <stdio.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include "solve.h" | |
#include "utils.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
// compile: g++ -O2 -g -Wall -fPIC -shared hook.cpp -o hook.so -ldl -L/usr/local/cuda-10.0/extras/cudnn-7.4.2/lib64 -lcudnn -lcublas -lcudart | |
#include <cassert> | |
#include <mutex> | |
#include <string> | |
#include <fstream> | |
#include <iostream> | |
#include <type_traits> | |
#include <unordered_map> |
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
/* | |
Original grammer: | |
EXPR -> FIRST_ITEM | EXPR '+' ITEM | EXPR '-' ITEM | |
ITEM -> VALUE | ITEM '*' VALUE | ITEM '/' VALUE | |
FIRST_ITEM -> FIRST_VALUE | FIRST_ITEM '*' VALUE | FIRST_ITEM '/' VALUE | |
VALUE -> number | '(' EXPR ')' | |
FIRST_VALUE -> VALUE | '-' VALUE | |
Modified grammer to be LL(1) | |
EXPR -> ITEM EXPRSUFFIX | '-' ITEM EXPRSUFFIX |
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 <cstdio> | |
#include <cstdlib> | |
#include <cassert> | |
#include <cuda_runtime.h> | |
#ifdef DUAL_GPU | |
#include <omp.h> | |
#endif | |
#ifndef NDEBUG | |
#define CHKERR(call) assert((call) == cudaSuccess) // no NDEBUG, so assert must be performed |
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
#ifndef DEBUG | |
#define NDEBUG | |
#endif | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cassert> | |
#include <algorithm> | |
#include <mpi.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
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class MY_Session extends CI_Session{ | |
private $sess_use_redis = TRUE; | |
private $redis = ''; | |
public function __construct($params = array()) { | |
//parent::__construct(); | |
$this->CI =& get_instance(); |