Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/cuda/src/lib/include/diderot/base.h
ViewVC logotype

View of /branches/cuda/src/lib/include/diderot/base.h

Parent Directory Parent Directory | Revision Log Revision Log

Revision 5628 - (download) (as text) (annotate)
Tue Sep 7 16:23:43 2021 UTC (2 months, 3 weeks ago) by adrianlehmann
File size: 1885 byte(s)
Fix various copy semantics
/*! \file base.h
 * \author John Reppy

 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 * COPYRIGHT (c) 2016 The University of Chicago
 * All rights reserved.

#define HD __host__ __device__

#include "config.h"
// teem headers
#include <teem/air.h>
#include <teem/biff.h>
#include <teem/nrrd.h>

// C library headers
#include <cmath>
#include <cstring>
#include <cassert>

// C++ std library headers
#include <string>
#include <fstream>
#include <ostream>
#include <iostream>
#include <iomanip>

namespace diderot {

enum strand_status {
    kActive = 0,            //!< a currently running strand
    kNew = 1,               //!< a newly created, but not yet active, strand
    kStabilize,             //!< a strand that will be stable at the end of
    //!< the current step
    kStable,                //!< a stable strand
    kDie,                   //!< a dying strand
    kDead                   //!< a dead strand

// standard vector types
template <typename REAL> using real2 = REAL[2];
template <typename REAL> using real3 = REAL[3];

// standard matrix types
template <typename REAL> using mat2x2 = REAL[4];
template <typename REAL> using mat3x3 = REAL[9];
template <typename REAL> using mat4x4 = REAL[16];

namespace __details {

struct nrrd_type_info {
    bool isFloat;
    unsigned int sizeb;
    const char *name;

extern struct nrrd_type_info nrrd_type_info[nrrdTypeLast];

} // namespace __details

} // namespace diderot

// cach-line size (default Xeon has 64-byte lines)
#define CACHE_LINE_SIZE         64

// cache-line alignment
#define CACHE_ALIGN     __attribute__((aligned(CACHE_LINE_SIZE)))

// disable inlining for a function
#define NO_INLINE       __attribute__((noinline))

#endif // !_DIDEROT_BASE_HXX_

ViewVC Help
Powered by ViewVC 1.0.0