blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 7 100 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 260
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 11.4k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 80
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 8 9.86M | extension stringclasses 52
values | content stringlengths 8 9.86M | authors listlengths 1 1 | author stringlengths 0 119 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a97ad7d1fd4ce8da8027e166a17e62a2e43695d1 | 0d687dfd08842515405a40bef6a8d2720d9d669d | /arduinocode/xy-precision-z-dvddrive-geometron-coin/xy-precision-z-dvddrive-geometron-coin.ino | ff83404788ac6bb2fdbf6aff5bf60d95299369fc | [] | no_license | LafeLabs/trashrobot5 | 437bc63102294d3ef1da5d11ebee463e3269af71 | 4a05d54a38d9acddf8d18efb0422502e05485c53 | refs/heads/master | 2022-05-07T23:52:01.128144 | 2022-04-21T01:25:55 | 2022-04-21T01:25:55 | 221,334,408 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,348 | ino | char coin[] = "GGGGGGGGGGGGGGGEEEEHEEEEEADDDDGGBBBBBBHHHHFAAAAAAADDDHBBFCCCHBFDFDHHFAAAAAAHADDFDBBBBBEEECCCHHHHFFFHAFDDDHAAECCCGAAHADDHBFFFFFHHFAAAAAAAFFFDDDDAAAFFFBBBHFFFFFFFFFFFFFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGHFAAAAAAADDDHBBFCCCHBFDFDHHAAAAAHADDFDBBBBFCCCHHHHHFAAAAAAADDDHBBFCCCHHHBBFCCCHHHHHAAAAAHADDFDBBBBFCCCHHHHHEEEEEADDDDGGBBBBBBHHHEEEEEEEEEGGGGGGGGGGGGGGG";
//char coin[]= "hefgahefg";
int unit = 100;
int side = unit;
int controller = 0;
int delta = 16;
int AIN1 = 7;
int AIN2 = 8;
int PWMA = 9;
int dirPin1 = 2;
int stepPin1 = 3;
int enPin1 = 4;
int dirPin2 = 5;
int stepPin2 = 6;
int enPin2 = 10;
//there is a ladder of 9 10k resistors from 5v to ground, and the intermediate nodes all connect to buttons which connect to an analog pin which has a 1 megaohm pull down resistor
int value1 = 114;
int value2 = 2*114;
int value3 = 3*114;
int value4 = 4*114;
int value5 = 5*114;
int value6 = 6*114;
int value7 = 7*114;
int value8 = 8*114;
int button = 0; //0 means no press, 1 is start, 2 is stop, 3 is left, 4 is back 5 is forward, 6 is right, 7 is down 8 is up
int delayus = 500;//delayMicroseconds(delayus);
int z = 0;
int zdelay = 1500;// microseconds 1000 ms / 512 steps = 2 ms/step
boolean goBool = false;
boolean stopBool = false;
void setup() {
// put your setup code here, to run once:
controller = analogRead(A0);
pinMode(AIN1,OUTPUT);
pinMode(AIN2,OUTPUT);
pinMode(PWMA,OUTPUT);
analogWrite(PWMA,0);
digitalWrite(AIN1,LOW);
digitalWrite(AIN2,LOW);
pinMode(dirPin1,OUTPUT);
pinMode(stepPin1,OUTPUT);
pinMode(enPin1,OUTPUT);
pinMode(dirPin2,OUTPUT);
pinMode(stepPin2,OUTPUT);
pinMode(enPin2,OUTPUT);
digitalWrite(dirPin1,LOW);
digitalWrite(stepPin1,LOW);
digitalWrite(enPin1,HIGH);
digitalWrite(dirPin2,LOW);
digitalWrite(stepPin2,LOW);
digitalWrite(enPin2,HIGH);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
controller = analogRead(A0);
if(controller > value1 - delta && controller < value1 + delta){
button = 1;
}
if(controller > value2 - delta && controller < value2 + delta){
button = 2;
}
if(controller > value3 - delta && controller < value3 + delta){
button = 3;
}
if(controller > value4 - delta && controller < value4 + delta){
button = 4;
}
if(controller > value5 - delta && controller < value5 + delta){
button = 5;
}
if(controller > value6 - delta && controller < value6 + delta){
button = 6;
}
if(controller > value7 - delta && controller < value7 + delta){
button = 7;
}
if(controller > value8 - delta && controller < value8 + delta){
button = 8;
}
if(controller < 50){
button = 0;
}
if(button == 1){
//Serial.println("start");
stopBool = false;
printCoin();
}
if(button == 2){
//Serial.println("stop");
}
if(button == 3){
//Serial.println("left");
moveLeft(1);
}
if(button == 4){
//Serial.println("back");
moveAway(1);
}
if(button == 5){
// Serial.println("forward");
moveTowards(1);
}
if(button == 6){
//Serial.println("right");
moveRight(1);
}
if(button == 7){
z = z - 1;
if(z < -255){
z = -255;
}
delayMicroseconds(delayus);
// Serial.println("down");
}
if(button == 8){
//up
z = z + 1;
if(z > 255){
z = 255;
}
delayMicroseconds(delayus);
// Serial.println("up");
}
// Serial.println(button);
if(z >= 0){
digitalWrite(AIN2,LOW);
digitalWrite(AIN1,HIGH);
}
else{
digitalWrite(AIN1,LOW);
digitalWrite(AIN2,HIGH);
}
analogWrite(PWMA,abs(z));
//Serial.println(z);
}
void moveUp(int nSteps){
for(int index = 0;index < nSteps;index++){
z += 1;
if(z>255){
z=255;
}
if(z >= 0){
digitalWrite(AIN2,LOW);
digitalWrite(AIN1,HIGH);
}
else{
digitalWrite(AIN1,LOW);
digitalWrite(AIN2,HIGH);
}
analogWrite(PWMA,abs(z));
delayMicroseconds(zdelay);
}
}
void moveDown(int nSteps){
for(int index = 0;index < nSteps;index++){
z -= 1;
if(z < 0){
z=0;
}
if(z >= 0){
digitalWrite(AIN2,LOW);
digitalWrite(AIN1,HIGH);
}
else{
digitalWrite(AIN1,LOW);
digitalWrite(AIN2,HIGH);
}
analogWrite(PWMA,abs(z));
delayMicroseconds(zdelay);
}
}
void moveLeft(int nSteps){
digitalWrite(dirPin1,LOW);
digitalWrite(enPin1,LOW);
for(int index = 0;index < nSteps;index++){
digitalWrite(stepPin1,HIGH);
delayMicroseconds(delayus);
digitalWrite(stepPin1,LOW);
delayMicroseconds(delayus);
}
digitalWrite(enPin1,HIGH);
digitalWrite(enPin2,HIGH);
}
void moveRight(int nSteps){
digitalWrite(dirPin1,HIGH);
digitalWrite(enPin1,LOW);
for(int index = 0;index < nSteps;index++){
digitalWrite(stepPin1,HIGH);
delayMicroseconds(delayus);
digitalWrite(stepPin1,LOW);
delayMicroseconds(delayus);
}
digitalWrite(enPin1,HIGH);
}
void moveAway(int nSteps){
digitalWrite(dirPin2,LOW);
digitalWrite(enPin2,LOW);
for(int index = 0;index < nSteps;index++){
digitalWrite(stepPin2,HIGH);
delayMicroseconds(delayus);
digitalWrite(stepPin2,LOW);
delayMicroseconds(delayus);
}
digitalWrite(enPin2,HIGH);
}
void moveTowards(int nSteps){
digitalWrite(dirPin2,HIGH);
digitalWrite(enPin2,LOW);
for(int index = 0;index < nSteps;index++){
digitalWrite(stepPin2,HIGH);
delayMicroseconds(delayus);
digitalWrite(stepPin2,LOW);
delayMicroseconds(delayus);
}
digitalWrite(enPin2,HIGH);
}
void geometronAction(char action){
controller = analogRead(A0);
if(controller > value2 - delta && controller < value2 + delta){
button = 2;
stopBool = true;
}
if(action == 'a'){
moveRight(side);
}
if(action == 'b'){
moveLeft(side);
}
if(action == 'c'){
moveAway(side);
}
if(action == 'd'){
moveTowards(side);
}
if(action == 'e'){
moveUp(side);
}
if(action == 'f'){
moveDown(side);
}
if(action == 'g'){
side /= 2;
}
if(action == 'h'){
side *= 2;
}
if(action == 'A'){
geometronSequence("ggdhhhefg");
}
if(action == 'B'){
geometronSequence("ggchhhefg");
}
if(action == 'C'){
geometronSequence("ggbhhhefg");
}
if(action == 'D'){
geometronSequence("ggahhhefg");
}
if(action == 'E'){
geometronSequence("ggdhh");
}
if(action == 'F'){
geometronSequence("ggchh");
}
if(action == 'G'){
geometronSequence("ggbhh");
}
if(action == 'H'){
geometronSequence("ggahh");
}
}
void printCoin(){
for(int index = 0;index <= sizeof(coin);index++){
if(!stopBool){
geometronAction(coin[index]);
}
}
}
void geometronSequence(String glyph){
//for loop thru the String
int index = 0;
for(index = 0;index < glyph.length();index++){
if(!stopBool){
geometronAction(glyph.charAt(index));
}
}
}
| [
"lafelabs@gmail.com"
] | lafelabs@gmail.com |
7845fe0ffde7d37111e566371db25f49ba9ddb83 | 6508210ebef183ddbef9792d99abe8b9b4289e4b | /HuiReversi.h | 0da5d27014389ff3878a7e2f4bf785d90d4dbe5f | [] | no_license | JohnnyXiaoYang/huiReversi | 20ed2e6fd34f58ac85239375e87aa3fc83b3911e | 5b9da91817fe9f00ed1886559c4ea6a7562a4cce | refs/heads/master | 2021-05-30T07:14:28.343502 | 2015-12-30T08:44:57 | 2015-12-30T08:44:57 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,516 | h | // HuiReversi.h : main header file for the HUIREVERSI application
//
#if !defined(_HUIREVERSI_H_INCLUDED_)
#define _HUIREVERSI_H_INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
#include "ReversiWnd.h"
/////////////////////////////////////////////////////////////////////////////
// CHuiReversiApp:
// See HuiReversi.cpp for the implementation of this class
//
extern CReversiWnd theReversiWnd; //黑白棋窗口对象
class CHuiReversiApp : public CWinApp
{
public:
CHuiReversiApp();
CDocument * GetCurrentDoc(); // 得到文档类对象指针
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CHuiReversiApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CHuiReversiApp)
afx_msg void OnAppAbout();
afx_msg void OnFileOpen();
afx_msg void OnFileSave();
afx_msg void OnFileSaveAs();
afx_msg void OnUpdateFileOpen(CCmdUI* pCmdUI);
afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
afx_msg void OnUpdateFileSaveAs(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(_HUIREVERSI_H_INCLUDED_)
| [
"6545823@qq.com"
] | 6545823@qq.com |
2917db7880838ed11fa3032dbb6b537fc208c63e | c887211fe4bf7d838b0db3a6be62470cda8a2dff | /LinkList.cpp | 255a26029339ccb893aa3059452e4f2f1fe92ea2 | [] | no_license | rong5690001/datastructstudy | 383b77229874f427ec315beece1e91275975d594 | 2f30fba42dedd9ed1765066b3150c0d5c8b839d6 | refs/heads/master | 2021-05-17T22:53:33.959889 | 2020-03-29T10:24:21 | 2020-03-29T10:24:21 | 250,989,495 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,168 | cpp | //
// Created by user on 2020/1/30.
//
#include <cstdlib>
#include <iostream>
#include "LinkList.h"
using namespace std;
Status GetElem(LinkList L, int i, ElemType *e) {
int j = 0; /* j为计数器 */
LinkList p; /* 声明一指针p */
p = L->next; /* 让p指向链表L的第1个结点 */
/* p不为空且计数器j还没有等于i时,循环继续 */
while (p && j < i) {
p = p->next; /* 让p指向下一个结点 */
++j;
}
if (!p || j > i)
return ERROR; /* 第i个结点不存在 */
*e = p->data; /* 取第i个结点的数据 */
return OK;
}
Status ListInsert(LinkList *L, int i, ElemType e) {
int j;
LinkList p, s;
p = *L;
j = 1;
/* 寻找第i-1个结点 */
while (p && j < i) {
p = p->next;
++j;
}
/* 第i个结点不存在 */
if (!p || j > i)
return ERROR;
/* 生成新结点(C标准函数) */
s = (LinkList) malloc(sizeof(Node));
s->data = e;
/* 将p的后继结点赋值给s的后继 */
s->next = p->next;
/* 将s赋值给p的后继 */
p->next = s;
return OK;
}
void CreateListHead(LinkList *L, int n) {
LinkList p;
int i;
/* 初始化随机数种子 */
srand(time(0));
*L = (LinkList) malloc(sizeof(Node));
/* 先建立一个带头结点的单链表 */
(*L)->next = NULL;
for (i = 0; i < n; i++) {
/* 生成新结点 */
p = (LinkList) malloc(sizeof(Node));
/* 随机生成100以内的数字 */
p->data = rand() % 100 + 1;
p->next = (*L)->next;
/* 插入到表头 */
(*L)->next = p;
}
}
void LinkList_Test() {
// auto linkList = (LinkList) malloc(sizeof(Node));
// int size = 0;
// for (int i = 0; i < 100; ++i) {
// if (ListInsert(&linkList, i, i)) {
// size++;
// }
// }
// cout << "sizeOf:" << size << endl;
LinkList *l;
CreateListHead(l, 100);
LinkList p = *l;
for (int i = 0; i < 100; ++i) {
ElemType *e;
GetElem(p, i, e);
// cout << "LinkList第" + (i) + "个元素是:" + (*e) << endl;
}
} | [
"chen.huarong@chinaredstar.com"
] | chen.huarong@chinaredstar.com |
527fb4a1e95bea57ba9d3f7583608748685ddba8 | ac1c9fbc1f1019efb19d0a8f3a088e8889f1e83c | /out/release/gen/third_party/blink/renderer/bindings/modules/v8/document_timeline_or_scroll_timeline.h | 71cb77c372c841c9110d0b53f93042ebeb21859d | [
"BSD-3-Clause"
] | permissive | xueqiya/chromium_src | 5d20b4d3a2a0251c063a7fb9952195cda6d29e34 | d4aa7a8f0e07cfaa448fcad8c12b29242a615103 | refs/heads/main | 2022-07-30T03:15:14.818330 | 2021-01-16T16:47:22 | 2021-01-16T16:47:22 | 330,115,551 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,212 | h | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated from the Jinja2 template
// third_party/blink/renderer/bindings/templates/union_container.h.tmpl
// by the script code_generator_v8.py.
// DO NOT MODIFY!
// clang-format off
#ifndef THIRD_PARTY_BLINK_RENDERER_BINDINGS_MODULES_V8_DOCUMENT_TIMELINE_OR_SCROLL_TIMELINE_H_
#define THIRD_PARTY_BLINK_RENDERER_BINDINGS_MODULES_V8_DOCUMENT_TIMELINE_OR_SCROLL_TIMELINE_H_
#include "base/optional.h"
#include "third_party/blink/renderer/bindings/core/v8/dictionary.h"
#include "third_party/blink/renderer/bindings/core/v8/native_value_traits.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
namespace blink {
class DocumentTimeline;
class ScrollTimeline;
class MODULES_EXPORT DocumentTimelineOrScrollTimeline final {
DISALLOW_NEW();
public:
DocumentTimelineOrScrollTimeline();
bool IsNull() const { return type_ == SpecificType::kNone; }
bool IsDocumentTimeline() const { return type_ == SpecificType::kDocumentTimeline; }
DocumentTimeline* GetAsDocumentTimeline() const;
void SetDocumentTimeline(DocumentTimeline*);
static DocumentTimelineOrScrollTimeline FromDocumentTimeline(DocumentTimeline*);
bool IsScrollTimeline() const { return type_ == SpecificType::kScrollTimeline; }
ScrollTimeline* GetAsScrollTimeline() const;
void SetScrollTimeline(ScrollTimeline*);
static DocumentTimelineOrScrollTimeline FromScrollTimeline(ScrollTimeline*);
DocumentTimelineOrScrollTimeline(const DocumentTimelineOrScrollTimeline&);
~DocumentTimelineOrScrollTimeline();
DocumentTimelineOrScrollTimeline& operator=(const DocumentTimelineOrScrollTimeline&);
void Trace(blink::Visitor*);
private:
enum class SpecificType {
kNone,
kDocumentTimeline,
kScrollTimeline,
};
SpecificType type_;
Member<DocumentTimeline> document_timeline_;
Member<ScrollTimeline> scroll_timeline_;
friend MODULES_EXPORT v8::Local<v8::Value> ToV8(const DocumentTimelineOrScrollTimeline&, v8::Local<v8::Object>, v8::Isolate*);
};
class V8DocumentTimelineOrScrollTimeline final {
public:
MODULES_EXPORT static void ToImpl(v8::Isolate*, v8::Local<v8::Value>, DocumentTimelineOrScrollTimeline&, UnionTypeConversionMode, ExceptionState&);
};
MODULES_EXPORT v8::Local<v8::Value> ToV8(const DocumentTimelineOrScrollTimeline&, v8::Local<v8::Object>, v8::Isolate*);
template <class CallbackInfo>
inline void V8SetReturnValue(const CallbackInfo& callbackInfo, DocumentTimelineOrScrollTimeline& impl) {
V8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
}
template <class CallbackInfo>
inline void V8SetReturnValue(const CallbackInfo& callbackInfo, DocumentTimelineOrScrollTimeline& impl, v8::Local<v8::Object> creationContext) {
V8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIsolate()));
}
template <>
struct NativeValueTraits<DocumentTimelineOrScrollTimeline> : public NativeValueTraitsBase<DocumentTimelineOrScrollTimeline> {
MODULES_EXPORT static DocumentTimelineOrScrollTimeline NativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&);
MODULES_EXPORT static DocumentTimelineOrScrollTimeline NullValue() { return DocumentTimelineOrScrollTimeline(); }
};
template <>
struct V8TypeOf<DocumentTimelineOrScrollTimeline> {
typedef V8DocumentTimelineOrScrollTimeline Type;
};
} // namespace blink
// We need to set canInitializeWithMemset=true because HeapVector supports
// items that can initialize with memset or have a vtable. It is safe to
// set canInitializeWithMemset=true for a union type object in practice.
// See https://codereview.chromium.org/1118993002/#msg5 for more details.
WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::DocumentTimelineOrScrollTimeline)
#endif // THIRD_PARTY_BLINK_RENDERER_BINDINGS_MODULES_V8_DOCUMENT_TIMELINE_OR_SCROLL_TIMELINE_H_
| [
"xueqi@zjmedia.net"
] | xueqi@zjmedia.net |
8c269ced8dc94fbe2d1ffd2bb889638bb7e52fa9 | d9c9095e837a6f22377a89bd8b88e1ba8ac79ca6 | /luogu/P1000 超级玛丽游戏.cpp | acf96fbedc00eecab57c55ccc03e80c65e67b906 | [] | no_license | alexcui03/luogu-test | 3ade46adb43adf50a8f2b40dfde83d399116f0fa | 7614ce64adcf5399181b113bcc571cdc84092f0f | refs/heads/master | 2021-06-28T02:08:33.365736 | 2020-12-02T14:47:01 | 2020-12-02T14:47:01 | 177,288,367 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,332 | cpp | #include <string>
#include <iostream>
std::string prt = "\
********\n\
************\n\
####....#.\n\
#..###.....##....\n\
###.......###### ### ###\n\
........... #...# #...#\n\
##*####### #.#.# #.#.#\n\
####*******###### #.#.# #.#.#\n\
...#***.****.*###.... #...# #...#\n\
....**********##..... ### ###\n\
....**** *****....\n\
#### ####\n\
###### ######\n\
##############################################################\n\
#...#......#.##...#......#.##...#......#.##------------------#\n\
###########################################------------------#\n\
#..#....#....##..#....#....##..#....#....#####################\n\
########################################## #----------#\n\
#.....#......##.....#......##.....#......# #----------#\n\
########################################## #----------#\n\
#.#..#....#..##.#..#....#..##.#..#....#..# #----------#\n\
########################################## ############";
int main() {
std::cout<<prt;
return 0;
} | [
"cuizhihui030925@outlook.com"
] | cuizhihui030925@outlook.com |
0b083a53c391c33ee6dc94ec8239776a3f5a033f | 0de72d530d147475b478ca2088313a151b1efd4d | /splitgate/core/sdk/sdk/MagicLeapARPin_parameters.h | c319804fae4bce2f657d80a96d1609fd23043d74 | [] | no_license | gamefortech123/splitgate-cheat | aca411678799ea3d316197acbde3ee1775b1ca76 | bf935f5b3c0dfc5d618298e76e474b1c8b3cea4b | refs/heads/master | 2023-07-15T00:56:45.222698 | 2021-08-22T03:26:21 | 2021-08-22T03:26:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 21,258 | h | #pragma once
#include "..\..\pch.h"
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Parameters
//---------------------------------------------------------------------------
// Function MagicLeapARPin.MagicLeapARPinComponent.UnPin
struct UMagicLeapARPinComponent_UnPin_Params
{
};
// Function MagicLeapARPin.MagicLeapARPinComponent.TryGetPinData
struct UMagicLeapARPinComponent_TryGetPinData_Params
{
class UClass* InPinDataClass; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool OutPinDataValid; // (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UMagicLeapARPinSaveGame* ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinComponent.PinToRestoredOrSyncedID
struct UMagicLeapARPinComponent_PinToRestoredOrSyncedID_Params
{
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinComponent.PinToID
struct UMagicLeapARPinComponent_PinToID_Params
{
struct FGuid PinId; // (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinComponent.PinToBestFit
struct UMagicLeapARPinComponent_PinToBestFit_Params
{
};
// Function MagicLeapARPin.MagicLeapARPinComponent.PinSceneComponent
struct UMagicLeapARPinComponent_PinSceneComponent_Params
{
class USceneComponent* ComponentToPin; // (Parm, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinComponent.PinRestoredOrSynced
struct UMagicLeapARPinComponent_PinRestoredOrSynced_Params
{
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinComponent.PinActor
struct UMagicLeapARPinComponent_PinActor_Params
{
class AActor* ActorToPin; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction MagicLeapARPin.MagicLeapARPinComponent.PersistentEntityPinned__DelegateSignature
struct UMagicLeapARPinComponent_PersistentEntityPinned__DelegateSignature_Params
{
bool bRestoredOrSynced; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// DelegateFunction MagicLeapARPin.MagicLeapARPinComponent.PersistentEntityPinLost__DelegateSignature
struct UMagicLeapARPinComponent_PersistentEntityPinLost__DelegateSignature_Params
{
};
// DelegateFunction MagicLeapARPin.MagicLeapARPinComponent.MagicLeapARPinDataLoadAttemptCompleted__DelegateSignature
struct UMagicLeapARPinComponent_MagicLeapARPinDataLoadAttemptCompleted__DelegateSignature_Params
{
bool bDataRestored; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinComponent.IsPinned
struct UMagicLeapARPinComponent_IsPinned_Params
{
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinComponent.GetPinState
struct UMagicLeapARPinComponent_GetPinState_Params
{
struct FMagicLeapARPinState State; // (Parm, OutParm, NoDestructor, NativeAccessSpecifierPublic)
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinComponent.GetPinnedPinID
struct UMagicLeapARPinComponent_GetPinnedPinID_Params
{
struct FGuid PinId; // (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinComponent.GetPinData
struct UMagicLeapARPinComponent_GetPinData_Params
{
class UClass* PinDataClass; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UMagicLeapARPinSaveGame* ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinComponent.AttemptPinDataRestorationAsync
struct UMagicLeapARPinComponent_AttemptPinDataRestorationAsync_Params
{
};
// Function MagicLeapARPin.MagicLeapARPinComponent.AttemptPinDataRestoration
struct UMagicLeapARPinComponent_AttemptPinDataRestoration_Params
{
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.UnBindToOnMagicLeapContentBindingFoundDelegate
struct UMagicLeapARPinFunctionLibrary_UnBindToOnMagicLeapContentBindingFoundDelegate_Params
{
struct FScriptDelegate Delegate; // (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.UnBindToOnMagicLeapARPinUpdatedDelegate
struct UMagicLeapARPinFunctionLibrary_UnBindToOnMagicLeapARPinUpdatedDelegate_Params
{
struct FScriptDelegate Delegate; // (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.SetGlobalQueryFilter
struct UMagicLeapARPinFunctionLibrary_SetGlobalQueryFilter_Params
{
struct FMagicLeapARPinQuery InGlobalFilter; // (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
MagicLeapARPin_EMagicLeapPassableWorldError ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.SetContentBindingSaveGameUserIndex
struct UMagicLeapARPinFunctionLibrary_SetContentBindingSaveGameUserIndex_Params
{
int UserIndex; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.QueryARPins
struct UMagicLeapARPinFunctionLibrary_QueryARPins_Params
{
struct FMagicLeapARPinQuery Query; // (ConstParm, Parm, OutParm, ReferenceParm, NativeAccessSpecifierPublic)
TArray<struct FGuid> Pins; // (Parm, OutParm, ZeroConstructor, NativeAccessSpecifierPublic)
MagicLeapARPin_EMagicLeapPassableWorldError ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.ParseStringToARPinId
struct UMagicLeapARPinFunctionLibrary_ParseStringToARPinId_Params
{
struct FString PinIdString; // (Parm, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FGuid ARPinId; // (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.IsTrackerValid
struct UMagicLeapARPinFunctionLibrary_IsTrackerValid_Params
{
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.GetNumAvailableARPins
struct UMagicLeapARPinFunctionLibrary_GetNumAvailableARPins_Params
{
int Count; // (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
MagicLeapARPin_EMagicLeapPassableWorldError ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.GetGlobalQueryFilter
struct UMagicLeapARPinFunctionLibrary_GetGlobalQueryFilter_Params
{
struct FMagicLeapARPinQuery CurrentGlobalFilter; // (Parm, OutParm, NativeAccessSpecifierPublic)
MagicLeapARPin_EMagicLeapPassableWorldError ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.GetContentBindingSaveGameUserIndex
struct UMagicLeapARPinFunctionLibrary_GetContentBindingSaveGameUserIndex_Params
{
int ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.GetClosestARPin
struct UMagicLeapARPinFunctionLibrary_GetClosestARPin_Params
{
struct FVector SearchPoint; // (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FGuid PinId; // (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
MagicLeapARPin_EMagicLeapPassableWorldError ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.GetAvailableARPins
struct UMagicLeapARPinFunctionLibrary_GetAvailableARPins_Params
{
int NumRequested; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TArray<struct FGuid> Pins; // (Parm, OutParm, ZeroConstructor, NativeAccessSpecifierPublic)
MagicLeapARPin_EMagicLeapPassableWorldError ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.GetARPinStateToString
struct UMagicLeapARPinFunctionLibrary_GetARPinStateToString_Params
{
struct FMagicLeapARPinState State; // (ConstParm, Parm, OutParm, ReferenceParm, NoDestructor, NativeAccessSpecifierPublic)
struct FString ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.GetARPinState
struct UMagicLeapARPinFunctionLibrary_GetARPinState_Params
{
struct FGuid PinId; // (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FMagicLeapARPinState State; // (Parm, OutParm, NoDestructor, NativeAccessSpecifierPublic)
MagicLeapARPin_EMagicLeapPassableWorldError ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.GetARPinPositionAndOrientation_TrackingSpace
struct UMagicLeapARPinFunctionLibrary_GetARPinPositionAndOrientation_TrackingSpace_Params
{
struct FGuid PinId; // (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector Position; // (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FRotator Orientation; // (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
bool PinFoundInEnvironment; // (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.GetARPinPositionAndOrientation
struct UMagicLeapARPinFunctionLibrary_GetARPinPositionAndOrientation_Params
{
struct FGuid PinId; // (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector Position; // (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FRotator Orientation; // (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
bool PinFoundInEnvironment; // (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.DestroyTracker
struct UMagicLeapARPinFunctionLibrary_DestroyTracker_Params
{
MagicLeapARPin_EMagicLeapPassableWorldError ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.CreateTracker
struct UMagicLeapARPinFunctionLibrary_CreateTracker_Params
{
MagicLeapARPin_EMagicLeapPassableWorldError ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.BindToOnMagicLeapContentBindingFoundDelegate
struct UMagicLeapARPinFunctionLibrary_BindToOnMagicLeapContentBindingFoundDelegate_Params
{
struct FScriptDelegate Delegate; // (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.BindToOnMagicLeapARPinUpdatedDelegate
struct UMagicLeapARPinFunctionLibrary_BindToOnMagicLeapARPinUpdatedDelegate_Params
{
struct FScriptDelegate Delegate; // (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, NoDestructor, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinFunctionLibrary.ARPinIdToString
struct UMagicLeapARPinFunctionLibrary_ARPinIdToString_Params
{
struct FGuid ARPinId; // (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FString ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// Function MagicLeapARPin.MagicLeapARPinInfoActorBase.OnUpdateARPinState
struct AMagicLeapARPinInfoActorBase_OnUpdateARPinState_Params
{
};
// Function MagicLeapARPin.MagicLeapARPinRenderer.SetVisibilityOverride
struct AMagicLeapARPinRenderer_SetVisibilityOverride_Params
{
bool InVisibilityOverride; // (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"nickmantini01@gmail.com"
] | nickmantini01@gmail.com |
c0a344b1cb7e0ac8b2dc72e3879888549aed234e | 9eb2245869dcc3abd3a28c6064396542869dab60 | /benchspec/CPU/520.omnetpp_r/src/simulator/nedsaxhandler.cc | cd0b1a7008606efe28301373f8d037521d35abbf | [] | no_license | lapnd/CPU2017 | 882b18d50bd88e0a87500484a9d6678143e58582 | 42dac4b76117b1ba4a08e41b54ad9cfd3db50317 | refs/heads/master | 2023-03-23T23:34:58.350363 | 2021-03-24T10:01:03 | 2021-03-24T10:01:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,530 | cc | //==========================================================================
// NEDSAXHANDLER.CC - part of
//
// OMNeT++/OMNEST
// Discrete System Simulation in C++
//
//==========================================================================
/*--------------------------------------------------------------*
Copyright (C) 2002-2008 Andras Varga
Copyright (C) 2006-2008 OpenSim Ltd.
This file is distributed WITHOUT ANY WARRANTY. See the file
`license' for details on this and other legal matters.
*--------------------------------------------------------------*/
#include "nedsaxhandler.h"
#include "nedelements.h"
#include "nederror.h"
#include "nedexception.h"
USING_NAMESPACE
NEDSAXHandler::NEDSAXHandler(const char *fname, NEDErrorStore *e)
{
root = current = 0;
sourcefilename = fname;
errors = e;
}
NEDSAXHandler::~NEDSAXHandler()
{
delete root;
}
NEDElement *NEDSAXHandler::getTree()
{
NEDElement *tree = root;
root = current = 0;
return tree;
}
void NEDSAXHandler::startElement(const char *name, const char **atts)
{
// initialize node
NEDElement *node;
bool unknown = false;
try {
node = NEDElementFactory::getInstance()->createElementWithTag(name);
}
catch (NEDException& e) {
errors->addError(current, "error: %s", e.what());
node = new UnknownElement();
node->setAttribute("element", name);
}
// "debug info"
char buf[200];
sprintf(buf,"%s:%d",sourcefilename, parser->getCurrentLineNumber());
node->setSourceLocation(buf);
// set attributes
if (!unknown)
{
for (int i=0; atts && atts[i]; i+=2) {
try {
node->setAttribute(atts[i], atts[i+1]);
}
catch (NEDException& e) {
errors->addError(node, "error in attribute '%s': %s", atts[i], e.what());
}
}
}
// add to tree
if (!root) {
root = current = node;
} else {
current->appendChild(node);
current = node;
}
}
void NEDSAXHandler::endElement(const char *name)
{
current = current->getParent();
}
void NEDSAXHandler::characterData(const char *s, int len)
{
// ignore
}
void NEDSAXHandler::processingInstruction(const char *target, const char *data)
{
// ignore
}
void NEDSAXHandler::comment(const char *data)
{
// ignore
}
void NEDSAXHandler::startCdataSection()
{
// ignore
}
void NEDSAXHandler::endCdataSection()
{
// ignore
}
| [
"cuda@hp-arm64-09-02.nvidia.com"
] | cuda@hp-arm64-09-02.nvidia.com |
65b2141e8c9da5d7aeac74a42e2d9905928e16c9 | 5b643ff15ffa0f7f09206dd738cf672fa323a9be | /Query/Query_main.cpp | b3d50eac966897c360fb450c52b47e4754c39b20 | [] | no_license | chenweigis/Querytext | 0fdd24e82ac4bac8006e9929c9fc030e4e46e25e | ac1e452cf061f38a020024b9a12689e69074b3fa | refs/heads/master | 2021-01-19T19:31:26.416345 | 2017-05-07T02:30:32 | 2017-05-07T02:30:32 | 88,421,320 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,725 | cpp | // Query.cpp : 定义控制台应用程序的入口点。
//
/************************************************************************/
/* 需求:文本查询程序
(1)读取一个给定的文件
(2)在文件中查询一个单词,返回单词出现的次数以及所在行的列表(展示单词所在行的内容)
(3)要求如果一个单词在某行出现多次,此行只出现一次,行按照升序排列
*/
/************************************************************************/
/************************************************************************/
/*分析:
(1)读取文件 fstream getline()按行读取;istringstream读取每一个单词;
(2)使用vector<string>保存文件,set按顺序不重复保存行号的集合,map保存单词和行号的set的对应关系
(3)使用一个类TextQuery来封装输入文件的操作,使用QueryResult来保存查询结果,两个类使用shared_ptr共享数据
*/
/************************************************************************/
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include "TextQuery.h"
#include "QueryResult.h"
#include "Query.h"
//#include "BinaryQuery.h"
using namespace std;
void runQueries(ifstream &infile);
int main()
{
//BinaryQuery bq;
ifstream infile("./querytext.txt");
runQueries(infile);
system("pause");
return 0;
}
void runQueries(ifstream &infile)
{
TextQuery tq(infile);
Query q = Query("Daddy")& ~Query("hair") | Query("Alice");
QueryResult qr;
qr.print(cout, q.eval(tq));
/*QueryResult qr;
while (1)
{
cout << "enter a word to look for,or q to quit: ";
string s;
if (!(cin >> s) || s == "q")
break;
qr.print(cout, tq.query(s));
}*/
}
| [
"chenweigis@163.com"
] | chenweigis@163.com |
09eb042fe7760c68e07985ce567765c42ea310aa | fac932922e8ec9cb03529a7a1d7395b94938a81e | /common/utils/daemon.cpp | 9a40208023b90a0db2ed1d2867b397f969be65b2 | [
"Apache-2.0"
] | permissive | wanhongbo/cargo | f22d63dc935c3585c7051095ead90fc70c0401c9 | a96848e803fe8277c3b21e8c172afa9a99e364d7 | refs/heads/master | 2021-01-15T10:53:56.928644 | 2016-03-09T10:39:48 | 2016-03-09T10:39:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,381 | cpp | /*
* Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
*
* Contact: Dariusz Michaluk <d.michaluk@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
/**
* @file
* @author Dariusz Michaluk <d.michaluk@samsung.com>
* @brief Run a process as a daemon
*/
#include "config.hpp"
#include "utils/fd-utils.hpp"
#include <sys/stat.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <iostream>
namespace utils {
bool daemonize()
{
pid_t pid = ::fork();
if (pid == -1) {
std::cerr << "Fork failed" << std::endl;
return false;
} else if (pid != 0) {
exit (0);
}
if (::setsid() == -1) {
return false;
}
pid = ::fork();
/*
* Fork a second child and exit immediately to prevent zombies.
* This causes the second child process to be orphaned, making the init
* process responsible for its cleanup. And, since the first child is
* a session leader without a controlling terminal, it's possible for
* it to acquire one by opening a terminal in the future (System V
* based systems). This second fork guarantees that the child is no
* longer a session leader, preventing the daemon from ever acquiring
* a controlling terminal.
*/
if (pid == -1) {
std::cerr << "Fork failed" << std::endl;
return false;
} else if (pid != 0) {
exit(0);
}
if (::chdir("/") == -1) {
return false;
}
::umask(0);
/** Close all open standard file descriptors */
int fd = ::open("/dev/null", O_RDWR);
if (fd == -1) {
return false;
}
for (int i = 0; i <= 2; i++) {
if (::dup2(fd, i) == -1) {
utils::close(fd);
return false;
}
}
utils::close(fd);
return true;
}
} // namespace utils
| [
"d.michaluk@samsung.com"
] | d.michaluk@samsung.com |
39b362fac9f565a3100183af5bbbbfdd830c6282 | 6e6fd14fa254a484ddd80aa4ed74002e2b0d6522 | /51NOD刷题/归并函数逆序.cpp | 1fd837b5a3975ec2572e2377211a98b8fbb89261 | [] | no_license | derekzhang79/Algorithm-Training | 852af331b8409bb1520f4aed9e9304d1ae58107c | 7257df097c2f69a68f9478ef29e6c9a9cc3500dc | refs/heads/master | 2020-04-29T14:33:47.490091 | 2018-05-26T11:15:17 | 2018-05-26T11:15:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,299 | cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <cstdlib>
#include <cmath>
#include <set>
#include <list>
#include <deque>
#include <map>
#include <queue>
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 1000000000;
const int maxn = 1e6;
const int mod = (1e9+7);
ll a[maxn],b[maxn];
ll ans = 0;
//将有序的a[first...mid]和a[mid+1...last]归并为有序的b[first...last]
void Merge(ll *a,ll *b,int first,int mid,int last)
{
int i = first,j = mid + 1;
int cur = first;
while(i<=mid && j<=last)
{
if(a[i]<=a[j])
b[cur++] = a[i++];
else
{
b[cur++] = a[j++];
ans += mid - i + 1;//关键步骤
}
}
while(i<=mid)
{
b[cur++] = a[i++];
}
while(j<=last)
{
b[cur++] = a[j++];
}
}
//将a[first...last]归并排序为b[first...last]
void Msort(ll *a,ll *b,int first,int last)
{
int mid;
if(first<last)
{
mid = (first+last)/2;
Msort(b,a,first,mid);
Msort(b,a,mid+1,last);
Merge(a,b,first,mid,last);
}
}
int main()
{
ios::sync_with_stdio(false);
ll n;
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
b[i] = a[i];
}
Msort(a,b,0,n-1);
cout<<ans<<"\n";
return 0;
} | [
"chenmengyang_2016@hotmail.com"
] | chenmengyang_2016@hotmail.com |
8f8f1c824de27e8e4732e380db1404c62b691619 | 9e90259c170e7c5ff413b83bb10e6ede0cdbb15f | /UtilisationUI/ui_utilisationui.h | 4ef7dc97ee9b1bd3383c1fec86d51ce29ed47758 | [] | no_license | elisangelayumi/Gestion-d-immatriculation-de-vehicules | c3b9089804ba3b0e57d4bf5082281348c08fa55e | 9507091a0c8988eca8037707d76af75fc6777ae5 | refs/heads/master | 2020-12-29T10:12:20.240663 | 2020-02-05T23:40:51 | 2020-02-05T23:40:51 | 238,568,659 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,402 | h | /********************************************************************************
** Form generated from reading UI file 'utilisationui.ui'
**
** Created by: Qt User Interface Compiler version 4.8.7
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_UTILISATIONUI_H
#define UI_UTILISATIONUI_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QHeaderView>
#include <QtGui/QMainWindow>
#include <QtGui/QMenu>
#include <QtGui/QMenuBar>
#include <QtGui/QStatusBar>
#include <QtGui/QTableWidget>
#include <QtGui/QTextBrowser>
#include <QtGui/QToolBar>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class Ui_UtilisationUIClass
{
public:
QAction *actionAjouter_Proprietaire;
QAction *actionQuitter;
QAction *actionSupprimer;
QAction *actionVehicule_Promenade;
QAction *actionCamion;
QAction *actionAjouter_Proprietaire_2;
QWidget *centralwidget;
QTableWidget *tableProprio;
QTextBrowser *textVehicule;
QMenuBar *menubar;
QMenu *menuFichier;
QMenu *menuAjouter;
QStatusBar *statusbar;
QToolBar *toolBar;
void setupUi(QMainWindow *UtilisationUIClass)
{
if (UtilisationUIClass->objectName().isEmpty())
UtilisationUIClass->setObjectName(QString::fromUtf8("UtilisationUIClass"));
UtilisationUIClass->resize(811, 481);
actionAjouter_Proprietaire = new QAction(UtilisationUIClass);
actionAjouter_Proprietaire->setObjectName(QString::fromUtf8("actionAjouter_Proprietaire"));
actionQuitter = new QAction(UtilisationUIClass);
actionQuitter->setObjectName(QString::fromUtf8("actionQuitter"));
actionSupprimer = new QAction(UtilisationUIClass);
actionSupprimer->setObjectName(QString::fromUtf8("actionSupprimer"));
actionVehicule_Promenade = new QAction(UtilisationUIClass);
actionVehicule_Promenade->setObjectName(QString::fromUtf8("actionVehicule_Promenade"));
actionCamion = new QAction(UtilisationUIClass);
actionCamion->setObjectName(QString::fromUtf8("actionCamion"));
actionAjouter_Proprietaire_2 = new QAction(UtilisationUIClass);
actionAjouter_Proprietaire_2->setObjectName(QString::fromUtf8("actionAjouter_Proprietaire_2"));
centralwidget = new QWidget(UtilisationUIClass);
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
tableProprio = new QTableWidget(centralwidget);
if (tableProprio->columnCount() < 2)
tableProprio->setColumnCount(2);
QTableWidgetItem *__qtablewidgetitem = new QTableWidgetItem();
tableProprio->setHorizontalHeaderItem(0, __qtablewidgetitem);
QTableWidgetItem *__qtablewidgetitem1 = new QTableWidgetItem();
tableProprio->setHorizontalHeaderItem(1, __qtablewidgetitem1);
tableProprio->setObjectName(QString::fromUtf8("tableProprio"));
tableProprio->setGeometry(QRect(20, 10, 331, 411));
textVehicule = new QTextBrowser(centralwidget);
textVehicule->setObjectName(QString::fromUtf8("textVehicule"));
textVehicule->setGeometry(QRect(360, 10, 441, 411));
UtilisationUIClass->setCentralWidget(centralwidget);
menubar = new QMenuBar(UtilisationUIClass);
menubar->setObjectName(QString::fromUtf8("menubar"));
menubar->setGeometry(QRect(0, 0, 811, 25));
menuFichier = new QMenu(menubar);
menuFichier->setObjectName(QString::fromUtf8("menuFichier"));
menuAjouter = new QMenu(menuFichier);
menuAjouter->setObjectName(QString::fromUtf8("menuAjouter"));
UtilisationUIClass->setMenuBar(menubar);
statusbar = new QStatusBar(UtilisationUIClass);
statusbar->setObjectName(QString::fromUtf8("statusbar"));
UtilisationUIClass->setStatusBar(statusbar);
toolBar = new QToolBar(UtilisationUIClass);
toolBar->setObjectName(QString::fromUtf8("toolBar"));
UtilisationUIClass->addToolBar(Qt::TopToolBarArea, toolBar);
menubar->addAction(menuFichier->menuAction());
menuFichier->addSeparator();
menuFichier->addAction(actionAjouter_Proprietaire_2);
menuFichier->addAction(menuAjouter->menuAction());
menuFichier->addAction(actionSupprimer);
menuFichier->addSeparator();
menuFichier->addAction(actionQuitter);
menuAjouter->addAction(actionVehicule_Promenade);
menuAjouter->addAction(actionCamion);
retranslateUi(UtilisationUIClass);
QObject::connect(actionQuitter, SIGNAL(triggered()), UtilisationUIClass, SLOT(close()));
QObject::connect(tableProprio, SIGNAL(cellClicked(int,int)), UtilisationUIClass, SLOT(selectionProprietaire()));
QObject::connect(actionCamion, SIGNAL(triggered()), UtilisationUIClass, SLOT(dialogAjouterCamion()));
QObject::connect(actionVehicule_Promenade, SIGNAL(triggered()), UtilisationUIClass, SLOT(dialogAjouterVehiculePromenade()));
QObject::connect(actionSupprimer, SIGNAL(triggered()), UtilisationUIClass, SLOT(dialogSuppression()));
QObject::connect(actionAjouter_Proprietaire_2, SIGNAL(triggered()), UtilisationUIClass, SLOT(dialogAjouterProprietaire()));
QMetaObject::connectSlotsByName(UtilisationUIClass);
} // setupUi
void retranslateUi(QMainWindow *UtilisationUIClass)
{
UtilisationUIClass->setWindowTitle(QApplication::translate("UtilisationUIClass", "MainWindow", 0, QApplication::UnicodeUTF8));
actionAjouter_Proprietaire->setText(QApplication::translate("UtilisationUIClass", "Ajouter Proprietaire", 0, QApplication::UnicodeUTF8));
actionQuitter->setText(QApplication::translate("UtilisationUIClass", "Quitter", 0, QApplication::UnicodeUTF8));
actionSupprimer->setText(QApplication::translate("UtilisationUIClass", "Supprimer Vehicule", 0, QApplication::UnicodeUTF8));
actionVehicule_Promenade->setText(QApplication::translate("UtilisationUIClass", "Vehicule Promenade", 0, QApplication::UnicodeUTF8));
actionCamion->setText(QApplication::translate("UtilisationUIClass", "Camion", 0, QApplication::UnicodeUTF8));
actionAjouter_Proprietaire_2->setText(QApplication::translate("UtilisationUIClass", "Ajouter Proprietaire", 0, QApplication::UnicodeUTF8));
QTableWidgetItem *___qtablewidgetitem = tableProprio->horizontalHeaderItem(0);
___qtablewidgetitem->setText(QApplication::translate("UtilisationUIClass", "Nom", 0, QApplication::UnicodeUTF8));
QTableWidgetItem *___qtablewidgetitem1 = tableProprio->horizontalHeaderItem(1);
___qtablewidgetitem1->setText(QApplication::translate("UtilisationUIClass", "Prenom", 0, QApplication::UnicodeUTF8));
menuFichier->setTitle(QApplication::translate("UtilisationUIClass", "Fichier", 0, QApplication::UnicodeUTF8));
menuAjouter->setTitle(QApplication::translate("UtilisationUIClass", "Ajouter Vehicule", 0, QApplication::UnicodeUTF8));
toolBar->setWindowTitle(QApplication::translate("UtilisationUIClass", "toolBar", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class UtilisationUIClass: public Ui_UtilisationUIClass {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_UTILISATIONUI_H
| [
"elisangela-yumi.jinno-pinho.1@ulaval.ca"
] | elisangela-yumi.jinno-pinho.1@ulaval.ca |
b84be6397ce78f4a126648050cc0f279c2216737 | 167c8395b592fef9332436e5898303f9a8586c3d | /script/hello.cpp | 43807756b6058596b9dc1e324daadf1a767a746b | [] | no_license | syediu/Udacity-RSE-ND-Project-1-BuildMyWorld | a0a421d8763d5eabbd14b70272d6c148da0d228e | 5aa24a8e3d6626284f4f6ae090c989cd8b7c011a | refs/heads/master | 2022-11-01T02:30:58.034870 | 2020-06-09T16:32:18 | 2020-06-09T16:32:18 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 379 | cpp | #include <gazebo/gazebo.hh>
namespace gazebo
{
class WorldPluginMyRobot : public WorldPlugin
{
public: WorldPluginMyRobot() : WorldPlugin()
{
printf("Welcome to Our World!\n");
}
public: void Load(physics::WorldPtr _world, sdf::ElementPtr _sdf)
{
}
};
GZ_REGISTER_WORLD_PLUGIN(WorldPluginMyRobot)
}
| [
"syedizzatullah@gmail.com"
] | syedizzatullah@gmail.com |
1183b98cfa2ac6038a4ad6650ff9f0ba65877031 | 967085e58cd85996d603ba2e55b0be53309eae80 | /CodeForces/CF1013-D2-E.cpp | 01f9827632897576077279a8356e23d691c9aad2 | [] | no_license | Ahmed-Zaher/CompetitiveProgramming | 4c4f8718251cbf45d73e074664cf856daf67047a | 4531541e03b961a6af70d11a700e106d6e707516 | refs/heads/master | 2021-07-06T23:52:20.258408 | 2021-05-07T23:29:43 | 2021-05-07T23:29:43 | 236,213,267 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,409 | cpp | /*
* We note that:
* 1. We can't have 2 adjacent hills on which we can build houses
* 2. The positions where houses will end up don't need to decrease
* 3. If a position is chosen for a house, we only need to decrease the adjacent hills
* to be at most the height of the current hill - 1
* 4. If 2 houses at positions i, j, and |i - j| > 2 then their costs are independent
* So we can use dynamic programming to try all possible configurations of houses' positions,
* and remember for every state whether the hill at current position - 2 is chosen for a house
* and use that to decrease the cost if possible
*/
#include <bits/stdc++.h>
using namespace std;
const int OO = 1e9;
const double EPS = 1e-9;
#define ndl cout << '\n'
#define sz(v) int(v.size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define present(a, x) (a.find(x) != a.end())
#ifdef LOCAL
#define db(...) ({cout << "> Line " << __LINE__ \
<< ": "; _db(#__VA_ARGS__, __VA_ARGS__);})
#define RNG() rng()
#else
#define db(...) true
#define RNG() true
#endif
template<class T>
void _db(const char *dbStr, T e) {
cout << dbStr << " = " << e << endl;
}
template<class T, class... L>
void _db(const char *dbStr, T e, L... r) {
while(*dbStr != ',') cout << *dbStr++;
cout << " = " << e << ','; _db(dbStr + 1, r...);
}
template<class S, class T>
ostream& operator<<(ostream& o, const map<S, T>& v) {
o << "["; int i = 0;
for (const pair<S, T>& pr : v) o << (!i++ ? "" : ", ") << "{"
<< pr.fs << " : " << pr.sc << "}"; return o << "]";
}
template<template <class, class...> class S, class T, class... L>
ostream& operator<<(ostream& o, const S<T, L...>& v) {
o << "["; int i = 0;
for (const auto& e : v) o << (!i++ ? "" : ", ") << e;
return o << "]";
}
template<class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& pr) {
return o << "(" << pr.fs << ", " << pr.sc << ")";
}
ostream& operator<<(ostream& o, const string& s) {
for (const char& c : s) o << c;
return o;
}
template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
template<class T> using VVV = VV<V<T>>;
using ll = long long;
using pii = pair<int, int>;
using vi = V<int>;
using vii = V<pii>;
using vvi = VV<int>;
using mii = map<int, int>;
using umii = unordered_map<int, int>;
using si = set<int>;
using usi = unordered_set<int>;
const int MX = 5005;
int n, a[MX];
int mem[MX][MX >> 1][2][2];
int dp(int idx, int k, bool p1, bool p2) {
if (!k)
return 0;
if (idx == n + 1)
return 1e9;
int& ret = mem[idx][k][p1][p2];
if (ret != -1)
return ret;
ret = dp(idx + 1, k, 0, p1);
if (p1)
return ret;
int cost = max(0, a[idx + 1] - a[idx] + 1);
if (p2)
cost += max(0, min(a[idx - 1], a[idx - 2] - 1) - a[idx] + 1);
else
cost += max(0, a[idx - 1] - a[idx] + 1);
return ret = min(ret, cost + dp(idx + 1, k - 1, 1, p1));
}
int main() {
#ifdef LOCAL
auto stTime = clock();
// freopen("in.txt", "r", stdin);
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
#endif
ios::sync_with_stdio(false);
cout.precision(10);
cin.tie(0);
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
}
memset(mem, -1, sizeof(mem));
for (int k = 1; k <= (n + 1) / 2; ++k) {
cout << dp(1, k, 0, 0) << ' ';
}
#ifdef LOCAL
cout << "\n\n\nExecution time: " <<
(clock() - stTime) * 1e3 / CLOCKS_PER_SEC << " ms" << endl;
#endif
return 0;
}
| [
"ahmedzaher1080@gmail.com"
] | ahmedzaher1080@gmail.com |
94e988a8610f19dbd4f50e7290d6f77a822f6f33 | 45ab1e397b5fc69ba84c8f5dfb66c09b79bca4c6 | /Course_I/Алгоритмы Python/Part2/семинары/pract5/task21/timeit.cpp | 38a80dd978e916fbce34aa9c5a9ca605b8553756 | [
"WTFPL"
] | permissive | GeorgiyDemo/FA | 926016727afa1ce0ee49e6ca9c9a3c60c755b35f | 9575c43fa01c261ea1ed573df9b5686b5a6f4211 | refs/heads/master | 2023-06-28T00:35:43.166167 | 2023-06-16T14:45:00 | 2023-06-16T14:45:00 | 203,040,913 | 46 | 65 | WTFPL | 2022-04-09T21:16:39 | 2019-08-18T18:19:32 | Jupyter Notebook | UTF-8 | C++ | false | false | 446 | cpp | #include "timeit.h"
#if __cplusplus <= 199711L
void Timer::reset()
{
clock_gettime(CLOCK_REALTIME, &beg_);
}
double Timer::elapsed()
{
clock_gettime(CLOCK_REALTIME, &end_);
return end_.tv_sec - beg_.tv_sec +
(end_.tv_nsec - beg_.tv_nsec) / 1000000000.;
}
#else
void Timer::reset()
{
beg_ = clock_::now();
}
double Timer::elapsed()
{
return std::chrono::duration_cast<second_>
(clock_::now() - beg_).count();
}
#endif
| [
"demenchuk.george@protonmail.com"
] | demenchuk.george@protonmail.com |
96362969b002397936dde32d6b13d154f4642718 | 5bd2afeded6a39311403641533f9a8798582b5c6 | /codeforces/1359/E.cpp | 84efb1c693a0787df0624df75011735bbdd15ee4 | [] | no_license | ShahjalalShohag/ProblemSolving | 19109c35fc1a38b7a895dbc4d95cbb89385b895b | 3df122f13808681506839f81b06d507ae7fc17e0 | refs/heads/master | 2023-02-06T09:28:43.118420 | 2019-01-06T11:09:00 | 2020-12-27T14:35:25 | 323,168,270 | 31 | 16 | null | null | null | null | UTF-8 | C++ | false | false | 3,288 | cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 5e5 + 9, mod = 998244353;
template <const int32_t MOD>
struct modint {
int32_t value;
modint() = default;
modint(int32_t value_) : value(value_) {}
inline modint<MOD> operator + (modint<MOD> other) const { int32_t c = this->value + other.value; return modint<MOD>(c >= MOD ? c - MOD : c); }
inline modint<MOD> operator - (modint<MOD> other) const { int32_t c = this->value - other.value; return modint<MOD>(c < 0 ? c + MOD : c); }
inline modint<MOD> operator * (modint<MOD> other) const { int32_t c = (int64_t)this->value * other.value % MOD; return modint<MOD>(c < 0 ? c + MOD : c); }
inline modint<MOD> & operator += (modint<MOD> other) { this->value += other.value; if (this->value >= MOD) this->value -= MOD; return *this; }
inline modint<MOD> & operator -= (modint<MOD> other) { this->value -= other.value; if (this->value < 0) this->value += MOD; return *this; }
inline modint<MOD> & operator *= (modint<MOD> other) { this->value = (int64_t)this->value * other.value % MOD; if (this->value < 0) this->value += MOD; return *this; }
inline modint<MOD> operator - () const { return modint<MOD>(this->value ? MOD - this->value : 0); }
modint<MOD> pow(uint64_t k) const {
modint<MOD> x = *this, y = 1;
for (; k; k >>= 1) {
if (k & 1) y *= x;
x *= x;
}
return y;
}
modint<MOD> inv() const { return pow(MOD - 2); } // MOD must be a prime
inline modint<MOD> operator / (modint<MOD> other) const { return *this * other.inv(); }
inline modint<MOD> operator /= (modint<MOD> other) { return *this *= other.inv(); }
inline bool operator == (modint<MOD> other) const { return value == other.value; }
inline bool operator != (modint<MOD> other) const { return value != other.value; }
inline bool operator < (modint<MOD> other) const { return value < other.value; }
inline bool operator > (modint<MOD> other) const { return value > other.value; }
};
template <int32_t MOD> modint<MOD> operator * (int64_t value, modint<MOD> n) { return modint<MOD>(value) * n; }
template <int32_t MOD> modint<MOD> operator * (int32_t value, modint<MOD> n) { return modint<MOD>(value % MOD) * n; }
template <int32_t MOD> istream & operator >> (istream & in, modint<MOD> &n) { return in >> n.value; }
template <int32_t MOD> ostream & operator << (ostream & out, modint<MOD> n) { return out << n.value; }
using mint = modint<mod>;
struct combi{
int n; vector<mint> facts, finvs, invs;
combi(int _n): n(_n), facts(_n), finvs(_n), invs(_n){
facts[0] = finvs[0] = 1;
invs[1] = 1;
for (int i = 2; i < n; i++) invs[i] = invs[mod % i] * (-mod / i);
for(int i = 1; i < n; i++){
facts[i] = facts[i - 1] * i;
finvs[i] = finvs[i - 1] * invs[i];
}
}
inline mint fact(int n) { return facts[n]; }
inline mint finv(int n) { return finvs[n]; }
inline mint inv(int n) { return invs[n]; }
inline mint ncr(int n, int k) { return n < k ? 0 : facts[n] * finvs[k] * finvs[n-k]; }
};
combi C(N);
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, k; cin >> n >> k;
mint ans = 0;
for (int i = 1; i <= n; i++) {
ans += C.ncr(n / i - 1, k - 1);
}
cout << ans << '\n';
return 0;
} | [
"shahjalalshohag2014@gmail.com"
] | shahjalalshohag2014@gmail.com |
9a238d16d2c721f0d2452accc6c7b79b9a748cf4 | c2153dcfa8bcf5b6d7f187e5a337b904ad9f91ac | /depends/ClanLib/src/Core/Math/base64_encoder.cpp | 3c2b845a2bd9d25a3240f99d4538941883965057 | [] | no_license | ptrefall/smn6200fluidmechanics | 841541a26023f72aa53d214fe4787ed7f5db88e1 | 77e5f919982116a6cdee59f58ca929313dfbb3f7 | refs/heads/master | 2020-08-09T17:03:59.726027 | 2011-01-13T22:39:03 | 2011-01-13T22:39:03 | 32,448,422 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,912 | cpp | /*
** ClanLib SDK
** Copyright (c) 1997-2010 The ClanLib Team
**
** This software is provided 'as-is', without any express or implied
** warranty. In no event will the authors be held liable for any damages
** arising from the use of this software.
**
** Permission is granted to anyone to use this software for any purpose,
** including commercial applications, and to alter it and redistribute it
** freely, subject to the following restrictions:
**
** 1. The origin of this software must not be misrepresented; you must not
** claim that you wrote the original software. If you use this software
** in a product, an acknowledgment in the product documentation would be
** appreciated but is not required.
** 2. Altered source versions must be plainly marked as such, and must not be
** misrepresented as being the original software.
** 3. This notice may not be removed or altered from any source distribution.
**
** Note: Some of the libraries ClanLib may link to may have additional
** requirements or restrictions.
**
** File Author(s):
**
** Magnus Norddahl
*/
#include "precomp.h"
#include "API/Core/Math/base64_encoder.h"
#include "API/Core/System/databuffer.h"
/////////////////////////////////////////////////////////////////////////////
// CL_Base64Encoder_Impl class:
static unsigned char cl_base64char[64] =
{
'A','B','C','D','E','F','G','H','I','J','K','L','M',
'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'a','b','c','d','e','f','g','h','i','j','k','l','m',
'n','o','p','q','r','s','t','u','v','w','x','y','z',
'0','1','2','3','4','5','6','7','8','9','+','/'
};
class CL_Base64Encoder_Impl
{
//! Construction:
public:
CL_Base64Encoder_Impl() : chunk_filled(0)
{
}
//! Attributes:
public:
CL_DataBuffer result;
unsigned char chunk[3];
int chunk_filled;
//! Operations:
public:
static void encode(unsigned char *output, const unsigned char *input, int size_input)
{
int i, o;
for (i = 0, o = 0; i < size_input; i+=3, o+=4)
{
unsigned int v1 = input[i+0];
unsigned int v2 = input[i+1];
unsigned int v3 = input[i+2];
unsigned int value = (v1 << 16) + (v2 << 8) + v3;
output[o+0] = cl_base64char[(value >> 18) & 63];
output[o+1] = cl_base64char[(value >> 12) & 63];
output[o+2] = cl_base64char[(value >> 6) & 63];
output[o+3] = cl_base64char[value & 63];
}
}
};
/////////////////////////////////////////////////////////////////////////////
// CL_Base64Encoder Construction:
CL_Base64Encoder::CL_Base64Encoder()
: impl(new CL_Base64Encoder_Impl)
{
}
/////////////////////////////////////////////////////////////////////////////
// CL_Base64Encoder Attributes:
CL_DataBuffer &CL_Base64Encoder::get_result()
{
return impl->result;
}
/////////////////////////////////////////////////////////////////////////////
// CL_Base64Encoder Operations:
void CL_Base64Encoder::reset()
{
impl->result.set_size(0);
impl->chunk_filled = 0;
}
void CL_Base64Encoder::feed(const void *_data, int size, bool append_result)
{
int pos = 0;
const unsigned char *data = (const unsigned char *) _data;
if (!append_result)
impl->result.set_size(0);
// Handle any left-over data from last encode:
if (impl->chunk_filled > 0)
{
int needed = 3 - impl->chunk_filled;
if (size >= needed)
{
memcpy(impl->chunk + impl->chunk_filled, data, needed);
int out_pos = impl->result.get_size();
impl->result.set_size(out_pos + 4);
CL_Base64Encoder_Impl::encode((unsigned char *) impl->result.get_data() + out_pos, impl->chunk, 3);
pos += needed;
impl->chunk_filled = 0;
}
else
{
memcpy(impl->chunk + impl->chunk_filled, data, size);
impl->chunk_filled += size;
return;
}
}
// Base64 encode what's available to us now:
int blocks = (size-pos) / 3;
int out_pos = impl->result.get_size();
impl->result.set_size(out_pos + blocks*4);
CL_Base64Encoder_Impl::encode((unsigned char *) impl->result.get_data() + out_pos, data + pos, blocks*3);
pos += blocks*3;
// Save data for last incomplete block:
int leftover = size-pos;
if (leftover > 3)
throw CL_Exception("Base64 encoder is broken!");
impl->chunk_filled = leftover;
memcpy(impl->chunk, data + pos, leftover);
}
void CL_Base64Encoder::finalize(bool append_result)
{
if (!append_result)
impl->result.set_size(0);
if (impl->chunk_filled == 0)
return;
// Allocate memory for last block:
int pos = impl->result.get_size();
impl->result.set_size(pos + 4);
unsigned char *output = (unsigned char *) impl->result.get_data() + pos;
unsigned char *input = impl->chunk;
int size = impl->chunk_filled;
// Base64 last block:
memset(input + size, 0, 3-size);
unsigned int v1 = input[0];
unsigned int v2 = input[1];
unsigned int v3 = input[2];
unsigned int value = (v1 << 16) + (v2 << 8) + v3;
output[0] = cl_base64char[(value >> 18) & 63];
output[1] = cl_base64char[(value >> 12) & 63];
output[2] = cl_base64char[(value >> 6) & 63];
output[3] = cl_base64char[value & 63];
if (impl->chunk_filled == 1)
{
output[2] = '=';
output[3] = '=';
}
else if (impl->chunk_filled == 2)
{
output[3] = '=';
}
}
CL_String8 CL_Base64Encoder::encode(const void *data, int size)
{
CL_Base64Encoder encoder;
encoder.feed(data, size);
encoder.finalize(true);
return CL_String8(encoder.get_result().get_data(), encoder.get_result().get_size());
}
CL_String8 CL_Base64Encoder::encode(const CL_StringRef8 &data)
{
return encode(data.data(), data.length());
}
CL_String8 CL_Base64Encoder::encode(const CL_DataBuffer &data)
{
return encode(data.get_data(), data.get_size());
}
/////////////////////////////////////////////////////////////////////////////
// CL_Base64Encoder Implementation:
| [
"PTrefall@gmail.com@c628178a-a759-096a-d0f3-7c7507b30227"
] | PTrefall@gmail.com@c628178a-a759-096a-d0f3-7c7507b30227 |
ef6b3aa3c11858d75a8aa966759d5a4da70b9f5e | 8d705d8d3fb123cc4ec7e84e52821c5c1883d380 | /ICPC.Regional/2009.Dhaka/4493.cpp | 4b2cc0de26354d6bf4045b1000618ca2d872e50c | [] | no_license | ailyanlu1/ACM-ICPC-OJ-Code | 446ceff5ad94d64391ce4d86bb706023323cb1f1 | 344b2c92f75b428d0241ba732c43de780d08df40 | refs/heads/master | 2020-03-22T21:09:01.656511 | 2015-03-11T00:10:27 | 2015-03-11T00:10:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 674 | cpp | // CII 4493
// 2009 Dhaka: That is Your Queue
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int Q[5000];
int main() {
int ca = 1, n, q, x;
char cmd[3];
while (scanf("%d%d", &n, &q) && n + q) {
printf("Case %d:\n", ca++);
int qh = 2000, qe = 2000, i;
for (i = 1; i <= min(1000, n); i++)
Q[qe++] = i;
while (q--) {
scanf("%s", cmd);
if (cmd[0] == 'N') {
while (1) {
x = Q[qh++];
if (x != -1) break;
}
Q[qe++] = x;
printf("%d\n", x);
} else {
scanf("%d", &x);
for (i = qh; i < qe; i++)
if (Q[i] == x) {
Q[i] = -1;
break;
}
Q[--qh] = x;
}
}
}
return 0;
}
| [
"gz.pkkj@gmail.com"
] | gz.pkkj@gmail.com |
927f0a9e3a3ef16f00144bbcb3ca7622aa0f0db9 | 708411bb427239c8bc33bcd019d1c99c60adc572 | /LoliDrive2/solutions/ac.cpp | d5a6e6b32f2ff9f1add042672f84a3d302d48774 | [] | no_license | TNFSH-Programming-Contest/2019NHSPC-TNFSH-Final | 6386a67001696aa027b8e38b3519169ced4a9cd7 | 7c0677cb8193f441c3913d7b30c4b1a1ae014697 | refs/heads/master | 2022-09-30T17:40:15.530620 | 2020-01-30T13:35:51 | 2020-01-30T13:35:51 | 211,501,295 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 691 | cpp | #include<bits/stdc++.h>
#define endl '\n'
using namespace std;
struct Node{
vector<int> to;
long long num;
} tree[1000010];
bool share[1000010];
long long dfs(int id,int p){
if(share[id])return tree[id].num;
long long sum=0,vn=0;
for(int t:tree[id].to){
if(t==p)continue;
sum+=dfs(t,id);
vn++;
}
if(vn==0)return 0;
return min(tree[id].num,sum);
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n,q;
cin>>n>>q;
for(int i=1;i<n;i++){
int x;
cin>>x;
tree[i].to.emplace_back(x);
tree[x].to.emplace_back(i);
}
for(int i=0;i<n;i++){
cin>>tree[i].num;
}
for(int i=0;i<q;i++){
int id;
cin>>id;
share[id] = true;
}
cout<<dfs(0,0)<<endl;
return 0;
}
| [
"lys900829@gmail.com"
] | lys900829@gmail.com |
672eafe18cdd80d9c50c3f08a3afafa59dfd6a7c | 3febdac3fbc009bbf2e5912e55f59efd4dc45a9f | /GamePlay/GameLogicProduct.h | 8b4cd8aaa5d4300f5061cd00149f8f9c115d43a3 | [
"MIT"
] | permissive | TaylorClark/PrimeTime | 95f440451434ded07c5dbd6008f03a3c21fcf66f | 3c62f6c53e0494146a95be1412273de3cf05bcd2 | refs/heads/master | 2021-01-01T17:20:56.420438 | 2017-07-23T01:30:49 | 2017-07-23T01:30:49 | 98,057,599 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,981 | h | //=================================================================================================
/*!
\file GameLogicProduct.h
Game Play Library
Product Mode Game Logic Header
\author Taylor Clark
\date June 22, 2006
This header contains the definition for the product mode game logic manager.
*/
//=================================================================================================
#pragma once
#ifndef __GameLogicProduct_h
#define __GameLogicProduct_h
#include "GameLogicNormalBase.h"
#include "GameDefines.h"
#include <vector>
#include <list>
#include "GUI/MsgBox.h"
#include "GameSessionStatsMult.h"
#include "GameFieldBlock.h"
class GameFieldMultBase;
class GameFieldBlockMultBase;
class GameFieldBlockProduct;
class ProfileSubsetMultiplication;
//-------------------------------------------------------------------------------------------------
/*!
\class GameLogicProduct
\brief Represents the logic for multiplication game modes
This class defines the game logic that is used for multiplication modes.
*/
//-------------------------------------------------------------------------------------------------
class GameLogicProduct : public GameLogicNormalBase
{
protected:
/// The number of completed equations
int32 m_NumCompletedEquations;
/// The multiplication version of the game fiel
GameFieldMultBase* m_pGameFieldMult;
/// A flag for if the current game is done
bool m_IsGameDone;
/// The current score
uint32 m_Score;
/// The current combo chain count
uint32 m_ComboCount;
/// The current session's statistics
GameSessionStatsMult m_CurSessionStats;
/// The current array of products that can be generated
std::vector<GameDefines::ProductEntry> m_GeneratableProducts;
/// The message box for moving to the next ceiling level
//MsgBox* m_pNextLevelMsgBox;
/// The product filter
GameDefines::ProductSubsetFilter m_ProdFilter;
/// If this is practice mode
bool m_IsPractice;
/// If the product preview label should be used
bool m_ShowProductPreview;
/// The flag for when a 0x block should be generated
bool m_ReadyFor0xBlock;
/// The number of product blocks on the field
int32 m_NumProducts;
/// The number of prime blocks on the field
int32 m_NumPrimes;
/// The offset of the required-number-of-primes-to-clear from what's out on the field. A
/// negative number means more of that prime are needed in order for the field to be
/// completely clear able.
int32 m_PrimeOffsets[ GameDefines::NUM_PRIMES ];
/// The current range to use when generating a weighted prime. This value is calculated by
/// the sum of the weights in the current range of generatable primes.
uint32 m_PrimeRandRange;
/// Generate a new block
virtual GameFieldBlockProduct* GenerateBlock( int32 maxWidth );
/// Close the logic
virtual void Term();
// Increase the difficulty level
void SetDifficulty( int32 level );
/// Handle a completed equation
EBlockSelAction HandleEquation( const BlockList& selBlocks );
/// Get the value of the selected product
int32 GetSelectedProduct(GameFieldBlockProduct* pSkipBlock) const;
/// Setup the ceiling field
void SetupCeilingField();
/// The message box for callback when the ceiling mode goes up a level
static void OnNextLevelMBCallback( MsgBox::EMsgBoxReturn retVal, void* pUserData );
protected:
/// Initialize a derived class's data
virtual bool SubclassInit();
public:
/// The default constructor
GameLogicProduct() : GameLogicNormalBase(),
m_NumProducts( 0 ),
m_NumPrimes( 0 ),
m_PrimeRandRange( 1 ),
m_NumCompletedEquations( 0 ),
m_Score( 0 ),
m_ComboCount( 0 ),
m_pGameFieldMult( 0 ),
m_IsPractice( false ),
m_ShowProductPreview( false ),
m_ReadyFor0xBlock( false )
{
// Clear the prime offset counts
for( uint32 primeIndex = 0; primeIndex < GameDefines::NUM_PRIMES; ++primeIndex )
m_PrimeOffsets[ primeIndex ] = 0;
}
/// The destructor
virtual ~GameLogicProduct();
/// Initialize a practice game
void InitPractice( GameDefines::ProductSubsetFilter prodFilter );
/// A message handler for when a block is selected that contains the mode-specific logic
virtual EBlockSelAction OnBlockSelect( GameFieldBlock* pBlock );
/// A message handler for when a block is deselected
virtual EBlockSelAction OnBlockDeselect( GameFieldBlock* );
/// Generate blocks up to a certain width
virtual GameFieldBlockMultBase** GenerateBlocksToFieldWidth();
static GameDefines::ProductSubsetFilter GetFilterFromDiff( GameDefines::EGameplayDiffLevel diff, int32 level );
/// Get the game field
virtual GameField* GetGameField(){ return (GameField*)m_pGameFieldMult; }
/// Is the game over
virtual bool IsGameOver();
/// Get the logic type
virtual ELogicType GetLogicType() const { return LT_Product; }
/// Get the session stats
const GameSessionStatsMult& GetSessionStats() const { return m_CurSessionStats; }
};
#endif // __GameLogicProduct_h | [
"taylor@taylorclarksoftware.com"
] | taylor@taylorclarksoftware.com |
4d0a9861f40e095575d2ae8fca4d32e0e1f94984 | ce8fd2f2ad50cbf0252ee422a35ff171228cb235 | /TSPSolver/include/TSPRandom.h | b613f9d4b0660bb503a37dc68481e829bf88dceb | [
"MIT"
] | permissive | andreshp/TSPSolver | e85d6bbe1d9d61f9dedc280c9341bff601ab247d | e052111b88833f103342fd43977124e50aedfb0f | refs/heads/master | 2021-01-10T19:24:55.096713 | 2015-06-23T10:39:20 | 2015-06-23T10:39:20 | 31,011,027 | 7 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,520 | h | # ifndef TSPRANDOM_H
# define TSPRANDOM_H
# include "TSPProblema.h"
# include "TSPSolucion.h"
/**
* @brief Clase que contiene los métodos necesarios para calcular solución aleatoria al probema del Viajante de Comercio.
*/
class TSPRandom{
private:
/* DATOS MIEMBRO */
/**
* @brief Puntero a un objeto de la clase TSPProblema.
* @brief Se inicializa en el constructor.
*/
TSPProblema *problema;
/**
* @brief Cadena de caracteres con el nombre del algoritmo.
* @brief Se inicializa en el constructor de la clase.
* Al crear una solución con TSPRandom su dato miembro algoritmo apunta a esta string.
*/
const string nombre_algoritmo;
public:
/* MÉTODOS PÚBLICOS */
/**
* @brief Constructor de la clase.
* @brief Inicializa nombre_mejora y problema.
* @param nuevo_xproblema Puntero a un objeto de la clase TSPProblema.
*/
TSPRandom(TSPProblema *nuevo_problema);
/**
* @brief Método que crea una solución mediante el algoritmo Random.
* @brief Utiliza el método determinarVecinoRandom de TSPSolucion.
* @return Puntero a la solución generada.
*/
TSPSolucion *solucionAleatoria();
};
#endif | [
"andreshp9@gmail.com"
] | andreshp9@gmail.com |
f94b3c68618d90238bd670849711a5e988231c02 | 89e78209b2557e3b9627876b654200759c2b24dd | /source/virtualmachine.cc | b64202c78977f137d7a0a7c760130e68fe463199 | [] | no_license | ixtli/vm | f4f5f3f7b888ea73e7528700680093b4b55ec70b | c13d83dbfa153ae0ae59c7a7ff465fce63f63750 | refs/heads/master | 2020-04-10T00:02:54.861659 | 2010-12-14T01:29:44 | 2010-12-14T01:29:44 | 931,739 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 37,068 | cc | #include "includes/virtualmachine.h"
#include <errno.h>>
#include <signal.h>
#include <string.h>
#include <iostream>
#include "includes/server.h"
#include "includes/interrupt.h"
#include "includes/mmu.h"
#include "includes/alu.h"
#include "includes/fpu.h"
#include "includes/util.h"
#include "includes/luavm.h"
#include "includes/pipeline.h"
#include "includes/cache.h"
// Macros for checking the PSR
#define N_SET (_psr & kPSRNBit)
#define N_CLEAR !(_psr & kPSRNBit)
#define V_SET (_psr & kPSRVBit)
#define V_CLEAR !(_psr & kPSRVBit)
#define C_SET (_psr & kPSRCBit)
#define C_CLEAR !(_psr & kPSRCBit)
#define Z_SET (_psr & kPSRZBit)
#define Z_CLEAR !(_psr & kPSRZBit)
#define kDefaultBranchCycles 5
// SIGINT flips this to tell everything to turn off
// Must have it declared extern and at file scope so that we can
// read it form anywhere. Also it needs to be extern C because it's
// going to be referenced from within a syscal? Maybe?
extern "C" {
volatile sig_atomic_t terminate;
}
// Init static mutex
pthread_mutex_t server_mutex;
reg_t *VirtualMachine::demuxRegID(const char id)
{
if (id >= kVMRegisterMax)
{
char temp[35] = "Invalid register selection '%2u'.\n";
sprintf(temp, temp, id);
trap(temp);
return (NULL);
}
if (id < kPQ0Code)
// This is a general register
return (&_r[id]);
if (id > kFPSRCode)
// This is an fpu register
return (&_fpr[id - kFPR0Code]);
switch (id)
{
case kPSRCode:
return (&_psr);
case kPQ0Code:
return (&_pq[0]);
case kPQ1Code:
return (&_pq[1]);
case kPCCode:
return (&_pc);
case kFPSRCode:
return (&_fpsr);
case kCSCode:
return (&_cs);
case kDSCode:
return (&_ds);
case kSSCode:
return (&_ss);
default:
return (NULL);
}
}
const char *VirtualMachine::readOnlyMemory(reg_t &size)
{
return (mmu->readOnlyMemory(size));
}
void VirtualMachine::evaluateConditional(PipelineData *d)
{
d->executes = true;
switch (d->condition_code)
{
case kCondAL: // Always
return;
case kCondEQ: // Equal
if (Z_SET) return; // Z bit set
break;
case kCondNE: // Not equal
if (Z_CLEAR) return; // Z bit clear
break;
case kCondCS: // unsigned higher or same
if (C_SET) return;
break;
case kCondCC: // Unsigned lower
if (C_CLEAR) return;
break;
case kCondMI: // Negative
if (N_SET) return;
break;
case kCondPL: // Positive or Zero
if (N_CLEAR) return;
break;
case kCondVS: // Overflow
if (V_SET) return;
break;
case kCondVC: // No Overflow
if (V_CLEAR) return;
break;
case kCondHI: // Unsigned Higher
if (C_SET && V_CLEAR) return;
break;
case kCondLS: // Unsigned lower or same
if (C_CLEAR || Z_SET) return;
break;
case kCondGE: // Greater or Equal
if ((N_SET && V_CLEAR) || (N_CLEAR && V_CLEAR)) return;
break;
case kCondLT: // Less Than
if ((N_SET && V_CLEAR) || (N_CLEAR && V_SET)) return;
break;
case kCondGT: // Greater Than
// Z clear, AND "EITHER" N set AND V set, OR N clear AND V clear
if (Z_CLEAR && (((N_SET && V_SET))||(N_CLEAR && V_CLEAR))) return;
break;
case kCondLE: // Less than or equal
// Z set, or N set and V clear, or N clear and V set
if (Z_CLEAR || (N_SET && V_CLEAR) || (N_CLEAR && V_SET)) return;
break;
case kCondNV: // Never
default: // Never
break;
}
d->executes = false;
}
VirtualMachine::VirtualMachine()
{
// Set dynamically allocated variables to NULL so that
// we don't accidentally free them when destroying this class
// if an error occurred during allocation or they were
// intentionally not allocated.
_program_file = NULL;
_dump_file = NULL;
_breakpoints = NULL;
_cache_desc = NULL;
}
VirtualMachine::~VirtualMachine()
{
// Do this first, just in case
delete ms;
printf("Destroying virtual machine...\n");
mmu->writeOut(_dump_file);
delete mmu;
delete alu;
delete fpu;
delete icu;
delete pipe;
if (_breakpoints)
free(_breakpoints);
if (_dump_file)
free(_dump_file);
if (_program_file)
free(_program_file);
if (_cache_desc)
free(_cache_desc);
}
bool VirtualMachine::loadProgramImage(const char *path, reg_t addr)
{
// Copy command line arguments onto the stack
// Allocate stack space before code
_ss = addr + (_stack_size << 2);
printf("Program stack: %u words allocated at %#x\n", _stack_size, _ss);
// Code segment starts right after it
_cs = _ss + kRegSize;
printf("Code segment: %#x\n", _cs);
// Load file into memory at _cs
_image_size = mmu->loadProgramImageFile(path, _cs, true);
// Set data segment after code segment
_ds = _cs + _image_size;
// Report
printf("Data segment: %#x\n", _ds);
// Initialize program state
resetGeneralRegisters();
_psr = kPSRDefault;
_fpsr = 0;
// Jump to _main
// TODO: Make this jump to the main label, not the top
_pc = _cs;
}
void VirtualMachine::resetSegmentRegisters()
{
_cs = 0; _ds = 0; _ss = 0;
}
void VirtualMachine::resetGeneralRegisters()
{
for (int i = 0; i < kGeneralRegisters; i++)
_r[i] = 0;
for (int i = 0; i < kFPRegisters; i++)
_fpr[i] = 0;
for (int i = 0; i < kPQRegisters; i++)
_pq[i] = 0;
}
void VirtualMachine::relocateBreakpoints()
{
printf("Relocating breakpoints as offsets into _cs... ");
// This simply adds _cs to each breakpoint and
// bounds checks them to make sure they're still within memory
for (int i = 0; i < _breakpoint_count; i++)
{
if (_breakpoints[i] != 0x0)
_breakpoints[i] += _cs;
if (_breakpoints[i] > _mem_size)
{
fprintf(stderr, "Breakpoint %i relocated outside of memory.\n", i);
deleteBreakpoint(i);
}
}
printf("Done.\n");
}
bool VirtualMachine::configure(const char *c_path, ALUTimings &at)
{
// Parse the config file
LuaVM *lua = new LuaVM();
lua->init();
int ret = lua->exec(c_path, 0);
if (ret)
{
// Something went wrong
fprintf(stderr, "Execution of script failed.");
delete lua;
return (true);
}
// Count the errors for values that must be specified
int err = 0;
// string locations
const char *prog_temp, *dump_temp;
// Grab the config data from the global state of the VM post exec
err += lua->getGlobalField("memory_size", kLUInt, &_mem_size);
err += lua->getGlobalField("read_cycles", kLUInt, &_read_cycles);
err += lua->getGlobalField("write_cycles", kLUInt, &_write_cycles);
// If something required wasn't set, error out
if (err)
{
fprintf(stderr, "A required value was not set in the config file.\n");
delete lua;
return (true);
}
// Enforce POT for _memory_size
reg_t npot = _nearest_power_of_two(_mem_size);
if (npot != _mem_size)
{
fprintf(stderr, "Warning: Memory size scaled to nearest power of two.\n");
_mem_size = npot;
}
// Optional arguments
lua->getGlobalField("stack_size", kLUInt, &_stack_size);
lua->getGlobalField("swint_cycles", kLUInt, &_swint_cycles);
lua->getGlobalField("branch_cycles", kLUInt, &_branch_cycles);
lua->getGlobalField("program", kLString, &prog_temp);
lua->getGlobalField("memory_dump", kLString, &dump_temp);
lua->getGlobalField("print_instruction", kLBool, &_print_instruction);
lua->getGlobalField("print_branch_offset", kLBool, &_print_branch_offset);
lua->getGlobalField("program_length_trap", kLUInt, &_length_trap);
lua->getGlobalField("machine_cycle_trap", kLUInt, &_cycle_trap);
lua->getGlobalField("stages", kLUInt, &_pipe_stages);
lua->getGlobalField("debug_cache", kLBool, &_debug_cache);
// Error check pipe stages
if (_pipe_stages != 1 && _pipe_stages != 4 && _pipe_stages != 5)
{
printf("Warning: Unsupported pipeline length %u.\n", _pipe_stages);
_pipe_stages = kDefaultPipelineStages;
}
// Deal with ALU timings
if (lua->openGlobalTable("alu_timings") != kLuaUnexpectedType)
{
// User defined the table, so pull all the ops out of it
for (int i = 0; i < kDPOpcodeCount; i++)
lua->getTableField(DPOpMnumonics[i], kLUInt, (void *) &at.op[i]);
// Clean up
lua->closeTable();
}
// Copy strings, because they wont exist after we free the lua VM
_program_file = (char *)malloc(sizeof(char) * strlen(prog_temp) + 1);
strcpy(_program_file, prog_temp);
_dump_file = (char *)malloc(sizeof(char) * strlen(dump_temp) + 1);
strcpy(_dump_file, dump_temp);
// Get breakpoint count
lua->getGlobalField("break_count", kLUInt, &_breakpoint_count);
// Allocate memory to hold them all
_breakpoints = (reg_t *)malloc(sizeof(reg_t) * _breakpoint_count);
if (lua->openGlobalTable("breakpoints") != kLuaUnexpectedType)
{
// Pull all the values out of it
reg_t c;
size_t max = lua->lengthOfCurrentObject();
// Get all the breakpoints, remember lua lists are ONE-INDEXED
// so this for loop should look a little unnatural
for (int i = 1; i < max+1; i++)
{
lua->getTableField(i, kLUInt, &c);
addBreakpoint(c << 2);
}
}
// If caches are defined, extract the description data
if (lua->openGlobalTable("caches") != kLuaUnexpectedType)
{
// Each value is another table
size_t len = lua->lengthOfCurrentObject();
if (len)
{
_cache_desc = (CacheDescription *) malloc(
sizeof(CacheDescription) * len);
for (int i = 1; i < len+1; i++)
{
if (lua->openTableAtTableIndex(i) != kLuaUnexpectedType)
{
if (lua->lengthOfCurrentObject() != 4)
{
fprintf(stderr, "Invalid cache description %i.\n", i);
free(_cache_desc);
_cache_desc = NULL;
len = 0;
lua->closeTable();
break;
}
int err;
err = lua->getTableField(1,kLUInt, &_cache_desc[i-1].size);
err += lua->getTableField(2,kLUInt, &_cache_desc[i-1].ways);
err += lua->getTableField(3,kLUInt, &_cache_desc[i-1].len);
err += lua->getTableField(4,kLUInt, &_cache_desc[i-1].time);
if (err != kLuaNoError)
{
fprintf(stderr, "Cache table value error.\n");
free(_cache_desc);
_cache_desc = NULL;
len = 0;
lua->closeTable();
break;
}
_cache_desc[i-1].debug = _debug_cache;
lua->closeTable();
} else {
fprintf(stderr, "Improper cache table format.\n");
free(_cache_desc);
_cache_desc = NULL;
len = 0;
break;
}
}
}
_caches = len;
lua->closeTable();
} else {
_caches = 0;
}
// clean up
delete lua;
return (false);
}
void VirtualMachine::setMachineDefaults()
{
// Most stuff gets set to zero
_print_instruction = false;
_print_branch_offset = false;
_cycle_count = 0;
_pc = 0;
_fpsr = 0;
_length_trap = 0;
_cycle_trap = 0;
_debug_cache = false;
// Others have "hardcoded" defaults
_breakpoint_count = kDefaultBreakCount;
_branch_cycles = kDefaultBranchCycles;
_psr = kPSRDefault;
}
bool VirtualMachine::init(const char *config)
{
// Initialize server_mutex for MonitorServer
pthread_mutex_init(&server_mutex, NULL);
// Initialize command and status server
ms = new MonitorServer(this);
if (ms->init())
return (true);
if (ms->run())
return (true);
// Initialize actual machine
printf("Initializing virtual machine: ");
printf("%i %lu-byte registers.\n", kVMRegisterMax, kRegSize);
// Set defaults
setMachineDefaults();
// Configure the VM using the config file
ALUTimings _aluTiming;
if (configure(config, _aluTiming))
{
fprintf(stderr, "VM configuration failed.\n");
return (true);
}
// Start up ALU
alu = new ALU(this);
if (alu->init(_aluTiming)) return (true);
// Start up FPU
fpu = new FPU(this);
if (fpu->init()) return (true);
// Init memory
mmu = new MMU(this, _mem_size, _read_cycles, _write_cycles);
if (mmu->init(_caches, _cache_desc)) return (true);
// Init instruction pipeline
pipe = new InstructionPipeline(_pipe_stages, this);
if (pipe->init()) return (true);
if (configurePipeline()) return (true);
// Load interrupt controller
icu = new InterruptController(this, _swint_cycles);
icu->init();
// Create initial sane environment
resetGeneralRegisters();
resetSegmentRegisters();
// Initialize the operating system here by running an interrupt that breaks
// at the end, returning control to us
// TODO: Make the OS load the program image through an interrupt
// run(true);
// Load program right after function table
loadProgramImage(_program_file, _int_table_size + _int_function_size);
// Relocate breakpoints now that we have our environment loaded
relocateBreakpoints();
// We can now start the Fetch EXecute cycle
fex = true;
// No errors
return (false);
}
// Evaluate a destructive client operation, like write word
void VirtualMachine::eval(char *op)
{
// We need to parse arguments
char *pch = strtok(op, " ");
if (strcmp(pch, kWriteCommand) == 0)
{
int addr, val;
pch = strtok(NULL, " ");
if (pch)
addr = atoi(pch);
else
addr = 0;
pch = strtok(NULL, " ");
if (pch)
val = _hex_to_int(pch);
else
val = 0;
mmu->writeWord(addr, val);
response = (char *)malloc(sizeof(char) * 512);
sprintf(response, "Value '%i' written to '%#x'.\n",
val, addr);
respsize = strlen(response);
return;
} else if (strcmp(pch, kExecCommand) == 0) {
/*reg_t instruction;
pch = strtok(NULL, " ");
if (pch)
instruction = (reg_t) _hex_to_int(pch);
else
instruction = 0;
reg_t ir = _ir;
_ir = instruction;
execute();
_ir = ir;
*/
fprintf(stderr, "EXEC operation not currently supported.\n");
response = (char *)malloc(sizeof(char) * strlen(op));
strcpy(response, op);
respsize = strlen(response);
return;
}
// If nothing worked
respsize = 0;
}
void VirtualMachine::statusStruct(MachineStatus &s)
{
// Populate status struct
s.type = kStatusMessage;
s.supervisor = supervisor ? 1 : 0;
s.cycles = _cycle_count;
s.psr = _psr;
s.pc = _pc;
s.ir = _ir;
s.cs = _cs;
s.ds = _ds;
s.ss = _ss;
s.pq[0] = _pq[0];
s.pq[1] = _pq[1];
for (int i = 0; i < kGeneralRegisters; i++)
s.r[i] = _r[i];
for (int i = 0; i < kFPRegisters; i++)
s.f[i] = _fpr[i];
}
void VirtualMachine::descriptionStruct(MachineDescription &d)
{
// Populate description struct
d.type = kMachineDescription;
d.int_table_length = _int_table_size;
d.int_fxn_length = _int_function_size;
d.mem_size = _mem_size;
}
char *VirtualMachine::statusString(size_t &len)
{
// Format human readable
char temp[1024];
sprintf(temp, "Machine Status: ");
if (supervisor)
sprintf(temp+strlen(temp), "Supervisor mode\n");
else
sprintf(temp+strlen(temp), "User mode\n");
sprintf(temp+strlen(temp), "Cycle Count: %lu\n", _cycle_count);
sprintf(temp+strlen(temp), "Program Status Register: %#x\n", _psr);
sprintf(temp+strlen(temp), "N: %s V: %s C: %s Z: %s\n", N_SET ? "1" : "0",
V_SET ? "1" : "0", C_SET ? "1" : "0", Z_SET ? "1" : "0");
sprintf(temp+strlen(temp), "Program Counter: %#x\n", _pc);
sprintf(temp+strlen(temp), "Instruction Register: %#x\n", _ir);
sprintf(temp+strlen(temp), "Code segment: %#x\n", _cs);
sprintf(temp+strlen(temp), "Data segment: %#x\n", _ds);
sprintf(temp+strlen(temp), "Stack segment: %#x\n", _ss);
sprintf(temp+strlen(temp), "General Purpose Registers:\n");
sprintf(temp+strlen(temp),
"r0 - %u r1 - %u r2 - %u r3 - %u\n", _r[0], _r[1], _r[2], _r[3]);
sprintf(temp+strlen(temp),
"r4 - %u r5 - %u r6 - %u r7 - %u\n", _r[4], _r[5], _r[6], _r[7]);
sprintf(temp+strlen(temp),
"r8 - %u r9 - %u r10 - %u r11 - %u\n", _r[8], _r[9], _r[10], _r[11]);
sprintf(temp+strlen(temp),
"r12 - %u r13 - %u r14 - %u r15 - %u\n", _r[12], _r[13], _r[14], _r[15]);
sprintf(temp+strlen(temp), "fpr0 - %f fpr1 - %f fpr2 - %f fpr3 - %f\n",
(float)_fpr[0], (float)_fpr[1], (float)_fpr[2], (float)_fpr[3]);
sprintf(temp+strlen(temp), "fpr4 - %f fpr5 - %f fpr6 - %f fpr7 - %f\n",
(float)_fpr[4], (float)_fpr[5], (float)_fpr[6], (float)_fpr[7]);
char *pipeStatus = pipe->stateString();
sprintf(temp+strlen(temp),"Pipeline State:\n%s", pipeStatus);
free(pipeStatus);
char *ret = (char *)malloc(sizeof(char) * strlen(temp) + 1);
strcpy(ret, temp);
len = strlen(ret);
return (ret);
}
void VirtualMachine::trap(const char *error)
{
if (error) fprintf(stderr, "CPU TRAP: %s\n", error);
_ir = 0xEF000000;
pipe->printState();
pipe->invalidate();
fex = false;
}
void VirtualMachine::waitForClientInput()
{
// Is the server even running?
if (!ms->isRunning()) return;
// Busy wait for the other thread to initialize and aquire the lock before
// we go tosleep on it. If we get this lock before the other thread starts
// and begins listening, it will cause a deadlock.
while (!ms->ready())
{ }
while (!terminate && !fex)
{
// Wait for something to happen
pthread_mutex_lock(&server_mutex);
// SIGINT may have been sent while we were asleep,
// or the server may have been told to step or cont
if (terminate || fex)
{
pthread_mutex_unlock(&server_mutex);
return;
}
// If we get here, we have a job to do
if (!operation) continue;
eval(operation);
// we're done
pthread_mutex_unlock(&server_mutex);
}
}
void VirtualMachine::step()
{
// Can't step if we're not broken.
if (fex) return;
pipe->step();
}
bool VirtualMachine::configurePipeline()
{
printf("Configuring ");
switch (_pipe_stages)
{
case 1:
printf("single stage pipeline... ");
if (pipe->registerStage(&VirtualMachine::doInstruction))
return (true);
_forwarding = true;
break;
case 5:
printf("five stage pipeline... ");
if (pipe->registerStage(&VirtualMachine::fetchInstruction))
return (true);
if (pipe->registerStage(&VirtualMachine::decodeInstruction))
return (true);
if (pipe->registerStage(&VirtualMachine::executeInstruction))
return (true);
if (pipe->registerStage(&VirtualMachine::memoryAccess))
return (true);
if (pipe->registerStage(&VirtualMachine::writeBack))
return (true);
_forwarding = false;
break;
case 4:
default:
printf("four stage pipeline (forwarding)... ");
if (pipe->registerStage(&VirtualMachine::fetchInstruction))
return (true);
if (pipe->registerStage(&VirtualMachine::decodeInstruction))
return (true);
if (pipe->registerStage(&VirtualMachine::executeInstruction))
return (true);
if (pipe->registerStage(&VirtualMachine::memoryAccess))
return (true);
_forwarding = true;
break;
}
printf("Done.\n");
return (false);
}
void VirtualMachine::run()
{
printf("Starting execution at %#x\n", _pc);
// Logic for the fetch -> execute cycle
while (fex)
{
// Check breakpoints on the CURRENT instruction, that is, before
// advancing the pipeline
reg_t loc = pipe->locationToExecute();
for (int i = 0; i < _breakpoint_count; i++)
{
if (_breakpoints[i] == loc && loc != 0x0)
{
printf("Breakpoint %i at instruction %u (%#x).\n",
i, _breakpoints[i] - _cs, _breakpoints[i]);
// stop execution
fex = false;
// sit around
waitForClientInput();
// SIGINT could have happened during this time, so test for it
if (terminate)
{
printf("Exiting...\n");
return;
}
}
}
if(pipe->cycle())
trap("Pipeline exception.\n");
}
// Idle and only close server after SIGINT
while (!terminate)
waitForClientInput();
printf("Exiting...\n");
}
void VirtualMachine::installJumpTable(reg_t *data, reg_t size)
{
incCycleCount(mmu->writeBlock(0x0, data, size));
_int_table_size = size;
printf("(%ub table @ 0x0) ", size);
}
void VirtualMachine::installIntFunctions(reg_t *data, reg_t size)
{
incCycleCount(mmu->writeBlock(_int_table_size, data, size));
_int_function_size = size;
printf("(%ub functions @ %#x) ", size, (reg_t)_int_table_size);
}
void VirtualMachine::readWord(reg_t addr, reg_t &val)
{
incCycleCount(mmu->readWord(addr, val));
}
void VirtualMachine::readRange(reg_t start, reg_t end, bool hex, char **ret)
{
incCycleCount(mmu->readRange(start, end, hex, ret));
}
void VirtualMachine::addBreakpoint(reg_t addr)
{
// Error check
if (!_breakpoints || !_breakpoint_count) return;
if (addr == 0x0)
{
fprintf(stderr, "Cannot set breakpoint at 0x0. Ignoring.\n");
return;
}
if (addr >= _mem_size)
{
fprintf(stderr, "Attempt to set breakpoint outside memory: %#x.\n", addr);
return;
}
for (int i = 0; i < _breakpoint_count; i++)
{
if (_breakpoints[i] == 0x0)
{
_breakpoints[i] = addr;
printf("Breakpoint %i set: %#x\n", i, addr);
return;
}
}
fprintf(stderr, "Could not set breakpoint: Array full.");
}
reg_t VirtualMachine::deleteBreakpoint(reg_t index)
{
if (!_breakpoints || !_breakpoint_count) return (0x0);
if (index >= _breakpoint_count)
{
fprintf(stderr, "Delete breakpoint: Bounds exception.\n");
return (0x0);
}
if (_breakpoints[index] == 0x0)
{
fprintf(stderr, "No breakpoint at index %u\n.", index);
return (0x0);
}
reg_t ret = _breakpoints[index];
_breakpoints[index] = 0x0;
printf("Breakpoints %u deleted.\n", index);
return (ret);
}
// Five stage pipe (writeback)
void VirtualMachine::writeBack(PipelineData *d)
{
if (!d)
{
trap("Invalid writeback parameter.\n");
return;
}
// If execute decided not to, there's no unlocking to be done
if (!d->executes) return;
switch (d->instruction_class)
{
case kDataProcessing:
if (!d->record) break;
if (d->flags.dp.op == kMUL)
{
// if MUL
_pq[0] = d->output0;
_pq[1] = d->output1;
} else {
// Else we only have one place to write back to
*(demuxRegID(d->flags.dp.rd)) = d->output0;
}
// Make sure to invalidate pipe if we're jumping
if (d->flags.dp.rd == kPCCode)
pipe->invalidate();
break;
case kSingleTransfer:
// writeback to dest register if a load
if (d->flags.st.l)
{
*(demuxRegID(d->flags.st.rs)) = d->output1;
if (d->flags.st.w)
*(demuxRegID(d->flags.st.rd)) = d->output0;
} else {
if (d->flags.st.w)
*(demuxRegID(d->flags.st.rs)) = d->output0;
}
// write address back into rs if w == 1
// Make sure to invalidate pipe if we're jumping
if (d->flags.st.rd == kPCCode)
pipe->invalidate();
break;
case kFloatingPoint:
*(demuxRegID(d->flags.fp.s + kFPR0Code)) = d->output0;
*(demuxRegID(d->flags.fp.d + kFPR0Code)) = d->output1;
break;
case kBranch:
// Store current pc in the link register (r15)
if (d->flags.b.link) _r[15] = d->location;
// Don't jump to a negative offset
if (_print_branch_offset) printf("BRANCH: %i\n", d->flags.b.offset);
if (d->flags.b.offset < 0)
_pc = 0;
else
_pc = d->flags.b.offset;
// Invalidate the pipe
pipe->invalidate();
break;
case kInterrupt:
// pc is always saved in r15 before branching
_r[15] = d->location;
incCycleCount(icu->swint(d->flags.i));
// Invalidate the pipe, we're branching
pipe->invalidate();
break;
default:
break;
}
pipe->unlock();
}
// Four stage pipe (forwarding)
void VirtualMachine::fetchInstruction(PipelineData *d)
{
if (!d)
{
trap("Invalid fetch parameter.\n");
return;
}
// Fetch PC instruction into IR and increment the pc
incCycleCount(mmu->readWord(_pc, _ir));
// Set metadata
d->instruction = _ir;
d->location = _pc;
// Increment the program counter.
// NOTE: The effect of this action being taken here is that the PC
// always points to the NEXT instruction to be executed, that is
// the location of the instruction ONE AHEAD of the ir register
_pc += kRegSize;
// Set this up to break out of possibly invalid jumps
if (_length_trap)
if (_pc > (_length_trap + _cs))
trap("Program unlikely to be this long.");
}
void VirtualMachine::decodeInstruction(PipelineData *d)
{
if (!d)
{
trap("Invalid decode parameter.\n");
return;
}
// Parse the condition code
// Get the most significant nybble of the instruction by masking
// then move it from the MSN into the LSN
d->condition_code = (_ir & kConditionCodeMask) >> 28;
// Parse the Operation Code
// Test to see if it has a 0 in the first place of the opcode
if ((_ir & 0x08000000) == 0x0)
{
// We're either a data processing or single transfer operation
// Test to see if there is a 1 in the second place of the opcode
if (_ir & kSingleTransferMask)
{
// We're a single transfer
d->instruction_class = kSingleTransfer;
d->flags.st.i = (_ir & kSTIFlagMask) ? 1 : 0;
d->flags.st.l = (_ir & kSTLFlagMask) ? 1 : 0;
d->flags.st.w = (_ir & kSTWFlagMask) ? 1 : 0;
d->flags.st.b = (_ir & kSTBFlagMask) ? 1 : 0;
d->flags.st.u = (_ir & kSTUFlagMask) ? 1 : 0;
d->flags.st.p = (_ir & kSTPFlagMask) ? 1 : 0;
d->flags.st.rs = (_ir & kSTSourceMask) >> 15;
d->flags.st.rd = (_ir & kSTDestMask) >> 10;
d->flags.st.offset = (_ir & kSTOffsetMask);
// wait on the source register
pipe->waitOnRegister(d->flags.st.rs);
// Check to see if we're doing fancy shifting, if so wait on source
if (!d->flags.st.i)
{
pipe->waitOnRegister(
(d->flags.st.offset & kShiftRmMask) >> 3);
if (d->flags.st.offset & kShiftType)
{
pipe->waitOnRegister(
(d->flags.st.offset & kShiftRsMask) >> 7);
}
}
} else {
// Only other case is a data processing op
// extract all operands and flags
d->instruction_class = kDataProcessing;
d->flags.dp.i = (_ir & kDPIFlagMask) ? 1 : 0;
d->flags.dp.s = (_ir & kDPSFlagMask) ? 1 : 0;
d->flags.dp.op = ( (_ir & kDPOpCodeMask) >> 21 );
d->flags.dp.rs = ( (_ir & kDPSourceMask) >> 15 );
d->flags.dp.rd = ( (_ir & kDPDestMask) >> 10);
d->flags.dp.offset = ( (_ir & kDPOperandTwoMask) );
pipe->waitOnRegister(d->flags.dp.rs);
// we might be shifting by register vals
if (!d->flags.dp.i)
{
if (d->flags.dp.op == kMOV)
{
if (d->flags.dp.offset & kShiftType)
{
pipe->waitOnRegister(
(d->flags.dp.offset & kMOVShiftRs) >> 3);
}
} else {
pipe->waitOnRegister(
(d->flags.dp.offset & kShiftRmMask) >> 3);
if (d->flags.dp.offset & kShiftType)
{
pipe->waitOnRegister(
(d->flags.dp.offset & kShiftRsMask) >> 7);
}
}
}
}
return;
}
// Are we a branch?
if ((_ir & kBranchMask) == 0x0) {
// We could be trying to execute something in reserved space
if (_ir & kReservedSpaceMask == 0x0)
{
d->instruction_class = kReserved;
} else {
d->instruction_class = kBranch;
// We're a branch
if ( _ir & kBranchLBitMask)
d->flags.b.link = true;
// Left shift the address by two because instructions
// are word-aligned
int temp = (_ir & kBranchOffsetMask) << 2;
// Temp is now a 25-bit number, but needs to be sign extended to
// 32 bits, so we do this with a little struct trick that will
// PROBABLY work everywhere.
struct {signed int x:25;} s;
s.x = temp;
d->flags.b.offset = s.x;
}
return;
}
if ((_ir & kFloatingPointMask) == 0x0) {
// We're a floating point operation
d->instruction_class = kFloatingPoint;
d->flags.fp.op = ((_ir & kFPOpcodeMask) >> 20);
d->flags.fp.s = ((_ir & kFPsMask) >> 17);
d->flags.fp.d = ((_ir & kFPdMask) >> 14);
d->flags.fp.n = ((_ir & kFPnMask) >> 11);
d->flags.fp.m = ((_ir & kFPmMask) >> 8);
// TODO: Optimize this
pipe->waitOnRegister(d->flags.fp.n + kFPR0Code);
pipe->waitOnRegister(d->flags.fp.m + kFPR0Code);
return;
}
// We're a SW interrupt
d->instruction_class = kInterrupt;
d->flags.i.comment = (_ir & kSWIntCommentMask);
}
void VirtualMachine::executeInstruction(PipelineData *d)
{
if (!d)
{
trap("Invalid execute parameter.\n");
return;
}
// If the cond code precludes execution of the op, don't bother
evaluateConditional(d);
if (!d->executes) return;
// Print instruction if requested
if (_print_instruction)
printf("PC: %#X\t\t\t%#X\n", d->location, d->instruction);
// Try to detect if we've jumped to something that doesn't look like a valid
// instruction
if ((d->location - _cs) % 4)
// pc isn't word aligned with _cs
fprintf(stderr, "Warning: PC not word aligned with code segment.\n");
if (d->location > _cs + _image_size)
{
// Going outside of the bounds of the loaded program image
fprintf(stderr, "Warning: PC outside of program image (%#x).\n",
d->location);
}
switch (d->instruction_class)
{
case kDataProcessing:
if (d->flags.dp.op == kMUL)
{
// lock PQ registers if it's a mul
pipe->lock(kPQ0Code);
pipe->lock(kPQ1Code);
} else {
// lock dest register
pipe->lock(d->flags.dp.rd);
}
// Do the job
incCycleCount(alu->dataProcessing(d->flags.dp));
// Save emitted values
d->record = alu->result();
d->output0 = alu->output();
d->output1 = alu->auxOut();
// release the register if there's no writeback stage
if (_forwarding) writeBack(d);
break;
case kSingleTransfer:
// lock dest register if it's a load
if (d->flags.st.l)
pipe->lock(d->flags.st.rd);
// lock source register if there will be writeback
if (d->flags.st.w)
pipe->lock(d->flags.st.rs);
// Here we use the alu to calculate the address we're going to be
// transfering to or from.
incCycleCount(alu->singleTransfer(d->flags.st));
// Save emitted values
d->record = alu->result();
d->output0 = alu->output(); // value, if any, to be written to base
d->output1 = alu->auxOut(); // Computed source address for this op
break;
case kBranch:
// As far as I can see, there is no reason to lock a register here
// since once writeback occurs, everything will get invalidated
// Calculate offset based on location of the instruction
d->flags.b.offset += ((signed int)d->location);
if (_forwarding) writeBack(d);
break;
case kInterrupt:
// Interrupts are executed during writeback so as to not invalidate
// an instruction that is closer to the front of the pipe
if (_forwarding) writeBack(d);
break;
case kFloatingPoint:
// TODO: optimize this
pipe->lock(d->flags.fp.s + kFPR0Code);
pipe->lock(d->flags.fp.d + kFPR0Code);
// Have the FPU do the operation
incCycleCount(fpu->execute(d->flags.fp));
// Save emitted values
d->record = alu->result();
d->output0 = alu->output();
d->output1 = alu->auxOut();
if (_forwarding) writeBack(d);
break;
case kReserved:
default:
trap("Unknown or reserved opcode.\n");
break;
}
}
void VirtualMachine::memoryAccess(PipelineData *d)
{
if (!d)
{
trap("Invalid memory access parameter.\n");
return;
}
if (!d->executes) return;
switch (d->instruction_class)
{
case kSingleTransfer:
incCycleCount(mmu->singleTransfer(d->flags.st, d->output1));
// Save values emitted by MMU;
d->output1 = mmu->readOut(); // value, if any, to be written from load
if (_forwarding) writeBack(d);
break;
default:
break;
}
}
// Single stage pipe
void VirtualMachine::doInstruction(PipelineData *d)
{
fetchInstruction(d);
decodeInstruction(d);
executeInstruction(d);
memoryAccess(d);
}
| [
"cg@325i.org"
] | cg@325i.org |
61d63cb4f03cfd51bf5b744e3589c1ef665e2f6e | 7c4e5e105e81036c40ea1c6104331b87b78862d2 | /ovs_sdk2.0win/libraries/sonixcamera(20200902)/SNDLL_Demo/SNDLL_DemoDlg.h | 6d43fc735d0e75f98615cc296d6ff6d5151c57e3 | [] | no_license | jameshilliard/MFCOVS | 6f1cecac89f8ffc90e806a72f943a831da3c5402 | 73e6edb08b485201d436f49dafb78eec53670247 | refs/heads/main | 2023-06-26T13:45:13.326719 | 2021-07-24T12:53:33 | 2021-07-24T12:53:33 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,992 | h |
// SNDLL_DemoDlg.h : 头文件
//
#pragma once
#include <functional>
#define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
#define SAFE_DELETE(x) { if (x) delete x; x = NULL; }
#define SAFE_DELETE_ARRAY(x) { if (x) delete []x; x = NULL; }
#include <string>
#include "afxwin.h"
using std::string;
static const GUID PROPSETID_VIDCAP_EXTENSION_UNIT =
{ 0x28f03370, 0x6311, 0x4a2e, { 0xba, 0x2c, 0x68, 0x90, 0xeb, 0x33, 0x40, 0x16 } };
static const GUID PROPSETID_UVC_EXTENSION_UNIT =
{ 0xDDDF7394, 0x973E, 0x4727, { 0xBE, 0xD9, 0x04, 0xED, 0x64, 0x26, 0xDC, 0x67 } };
//{ 0xBD5321B4, 0xD635, 0xCA45, { 0xB2, 0x03, 0x4E, 0x01, 0x49, 0xB3, 0x01, 0xBC } };
//DDDF7394 - 973E-4727 - BED9 - 04ED6426DC67
// CSNDLL_DemoDlg 对话框
class CSNDLL_DemoDlg : public CDialogEx
{
// 构造
public:
CSNDLL_DemoDlg(CWnd* pParent = NULL); // 标准构造函数
// 对话框数据
enum { IDD = IDD_SNDLL_DEMO_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
// 实现
protected:
HICON m_hIcon;
// 生成的消息映射函数
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnDropFiles(HDROP hDropInfo);
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedBtnAsicRegisterRead();
afx_msg void OnBnClickedBtnAsicRegisterWrite();
afx_msg void OnBnClickedBtnSensorRegisterRead();
afx_msg void OnBnClickedBtnSensorRegisterWrite();
afx_msg void OnBnClickedBtnFlashRead();
afx_msg void OnBnClickedBtnFlashWrite();
afx_msg void OnBnClickedBtnBurnerFW();
afx_msg void OnBnClickedBtnExportFW();
afx_msg void OnBnClickedBtnGetFwVersion();
afx_msg void OnBnClickedBtnGetVidPid();
afx_msg void OnBnClickedBtnGetErrorCode();
afx_msg void OnBnClickedBtnGetSfType();
afx_msg void OnBnClickedBtnGetManufacturer();
afx_msg void OnBnClickedBtnGetProduct();
afx_msg void OnBnClickedBtnGetSerialNumber();
afx_msg void OnClose();
afx_msg void OnBnClickedBtnGetString3();
afx_msg void OnBnClickedBtnFlashCustomRead();
afx_msg void OnBnClickedBtnFlashCustomWrite();
afx_msg void OnBnClickedBtnMd();
afx_msg void OnBnClickedBtnXuRead();
afx_msg void OnBnClickedBtnXuWrite();
afx_msg void OnBnClickedBtnGetNodeid();
afx_msg void OnBnClickedBtnGetInterface();
virtual BOOL PreTranslateMessage(MSG* pMsg);
BOOL LoadFW(const CString &fwPath);
BOOL BurnerFW();
private:
CString m_editString3;
CString m_asicAddr;
CString m_asicLength;
CString m_sensorSlaveID;
CString m_sensorAddr;
CString m_sensorLength;
CString m_sfDataLen;
CString m_sfAddr;
CString m_editOutput;
CString m_editFwVersion;
CString m_editVidPid;
CString m_editErrorCode;
CString m_editSFType;
CString m_editManufacturer;
CString m_editProduct;
CString m_editSerialNumber;
CString m_editInterface;
CString m_editNodeId;
CString m_editLength;
CString m_editCS;
BYTE *m_pFwBuf;
LONG m_lFwBufLen;
CString m_nodeId;
CString m_editXuOutput;
};
| [
"jirenze@hotmail.com"
] | jirenze@hotmail.com |
641174b9a7ff32d6307f1716db4266c79c776ca0 | 2470a4b370ee2790a5e42614cd2328a322d7ae0b | /Lista6/fibonacci.cpp | 90590d16cd4c13ca87b71ebcb8c0c99eda87c4f8 | [] | no_license | silvagal/paa | 55256438b3b4e4bdc5ad4bf413c4e6cafd942180 | 1071bd7a29f14e81b9c659eb0bfd354b292c398c | refs/heads/main | 2023-06-23T02:29:15.739822 | 2021-07-13T11:46:00 | 2021-07-13T11:46:00 | 346,726,890 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 310 | cpp | #include <iostream>
int fibonacci(int n){
int f;
if (n == 0)
return 0;
if (n == 1)
return 1;
f = fibonacci(n - 1) + fibonacci(n - 2);
return f;
}
int main() {
int n = 10;
for (int i = 0; i < n; ++i) {
std::cout << fibonacci(i) << " ";
}
return 0;
} | [
"noreply@github.com"
] | noreply@github.com |
5677ed9ce25d186c7e47d5bb0dbc835147c1b1b7 | 627d4d432c86ad98f669214d9966ae2db1600b31 | /src/scripttools/debugging/qscriptdebuggerjob.cpp | 07c9b4d2200f2c3eeb795ed910e684e11ad9d6dc | [] | no_license | fluxer/copperspice | 6dbab905f71843b8a3f52c844b841cef17f71f3f | 07e7d1315d212a4568589b0ab1bd6c29c06d70a1 | refs/heads/cs-1.1 | 2021-01-17T21:21:54.176319 | 2015-08-26T15:25:29 | 2015-08-26T15:25:29 | 39,802,091 | 6 | 0 | null | 2015-07-27T23:04:01 | 2015-07-27T23:04:00 | null | UTF-8 | C++ | false | false | 2,453 | cpp | /***********************************************************************
*
* Copyright (c) 2012-2015 Barbara Geller
* Copyright (c) 2012-2015 Ansel Sermersheim
* Copyright (c) 2012-2014 Digia Plc and/or its subsidiary(-ies).
* Copyright (c) 2008-2012 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
*
* This file is part of CopperSpice.
*
* CopperSpice is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* CopperSpice is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with CopperSpice. If not, see
* <http://www.gnu.org/licenses/>.
*
***********************************************************************/
#include "qscriptdebuggerjob_p.h"
#include "qscriptdebuggerjob_p_p.h"
#include "qscriptdebuggerjobschedulerinterface_p.h"
#include <QtCore/qdebug.h>
QT_BEGIN_NAMESPACE
/*!
\class QScriptDebuggerJob
\since 4.5
\internal
\brief The QScriptDebuggerJob class is the base class of debugger jobs.
*/
QScriptDebuggerJobPrivate::QScriptDebuggerJobPrivate()
{
}
QScriptDebuggerJobPrivate::~QScriptDebuggerJobPrivate()
{
}
QScriptDebuggerJobPrivate *QScriptDebuggerJobPrivate::get(QScriptDebuggerJob *q)
{
return q->d_func();
}
QScriptDebuggerJob::QScriptDebuggerJob()
: d_ptr(new QScriptDebuggerJobPrivate)
{
d_ptr->q_ptr = this;
d_ptr->jobScheduler = 0;
}
QScriptDebuggerJob::QScriptDebuggerJob(QScriptDebuggerJobPrivate &dd)
: d_ptr(&dd)
{
d_ptr->q_ptr = this;
d_ptr->jobScheduler = 0;
}
QScriptDebuggerJob::~QScriptDebuggerJob()
{
}
void QScriptDebuggerJob::finish()
{
Q_D(QScriptDebuggerJob);
Q_ASSERT(d->jobScheduler != 0);
d->jobScheduler->finishJob(this);
}
void QScriptDebuggerJob::hibernateUntilEvaluateFinished()
{
Q_D(QScriptDebuggerJob);
Q_ASSERT(d->jobScheduler != 0);
d->jobScheduler->hibernateUntilEvaluateFinished(this);
}
void QScriptDebuggerJob::evaluateFinished(const QScriptDebuggerValue &)
{
Q_ASSERT_X(false, "QScriptDebuggerJob::evaluateFinished()",
"implement if hibernateUntilEvaluateFinished() is called");
}
QT_END_NAMESPACE
| [
"ansel@copperspice.com"
] | ansel@copperspice.com |
384193896ab11392267baf873563a43a960516b4 | 38c10c01007624cd2056884f25e0d6ab85442194 | /ui/message_center/notification_list.h | 7b49994dd483c0397d0dd3b6eea53428d5fc0a34 | [
"BSD-3-Clause"
] | permissive | zenoalbisser/chromium | 6ecf37b6c030c84f1b26282bc4ef95769c62a9b2 | e71f21b9b4b9b839f5093301974a45545dad2691 | refs/heads/master | 2022-12-25T14:23:18.568575 | 2016-07-14T21:49:52 | 2016-07-23T08:02:51 | 63,980,627 | 0 | 2 | BSD-3-Clause | 2022-12-12T12:43:41 | 2016-07-22T20:14:04 | null | UTF-8 | C++ | false | false | 5,807 | h | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_
#define UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_
#include <list>
#include <set>
#include <string>
#include "base/gtest_prod_util.h"
#include "ui/message_center/message_center_export.h"
#include "ui/message_center/notification_blocker.h"
#include "ui/message_center/notification_types.h"
namespace base {
class DictionaryValue;
class TimeDelta;
}
namespace gfx {
class Image;
}
namespace message_center {
namespace test {
class NotificationListTest;
}
class Notification;
class NotificationDelegate;
struct NotifierId;
// Comparers used to auto-sort the lists of Notifications.
struct MESSAGE_CENTER_EXPORT ComparePriorityTimestampSerial {
bool operator()(Notification* n1, Notification* n2);
};
struct MESSAGE_CENTER_EXPORT CompareTimestampSerial {
bool operator()(Notification* n1, Notification* n2);
};
// A helper class to manage the list of notifications.
class MESSAGE_CENTER_EXPORT NotificationList {
public:
// Auto-sorted set. Matches the order in which Notifications are shown in
// Notification Center.
typedef std::set<Notification*, ComparePriorityTimestampSerial> Notifications;
// Auto-sorted set used to return the Notifications to be shown as popup
// toasts.
typedef std::set<Notification*, CompareTimestampSerial> PopupNotifications;
explicit NotificationList();
virtual ~NotificationList();
// Affects whether or not a message has been "read". Collects the set of
// ids whose state have changed and set to |udpated_ids|. NULL if updated
// ids don't matter.
void SetMessageCenterVisible(bool visible,
std::set<std::string>* updated_ids);
void AddNotification(scoped_ptr<Notification> notification);
void UpdateNotificationMessage(const std::string& old_id,
scoped_ptr<Notification> new_notification);
void RemoveNotification(const std::string& id);
Notifications GetNotificationsByNotifierId(const NotifierId& notifier_id);
// Returns true if the notification exists and was updated.
bool SetNotificationIcon(const std::string& notification_id,
const gfx::Image& image);
// Returns true if the notification exists and was updated.
bool SetNotificationImage(const std::string& notification_id,
const gfx::Image& image);
// Returns true if the notification and button exist and were updated.
bool SetNotificationButtonIcon(const std::string& notification_id,
int button_index,
const gfx::Image& image);
// Returns true if |id| matches a notification in the list and that
// notification's type matches the given type.
bool HasNotificationOfType(const std::string& id,
const NotificationType type);
// Returns false if the first notification has been shown as a popup (which
// means that all notifications have been shown).
bool HasPopupNotifications(const NotificationBlockers& blockers);
// Returns the recent notifications of the priority higher then LOW,
// that have not been shown as a popup. kMaxVisiblePopupNotifications are
// used to limit the number of notifications for the DEFAULT priority.
// It also stores the list of notification ids which is blocked by |blockers|
// to |blocked_ids|. |blocked_ids| can be NULL if the caller doesn't care
// which notifications are blocked.
PopupNotifications GetPopupNotifications(
const NotificationBlockers& blockers,
std::list<std::string>* blocked_ids);
// Marks a specific popup item as shown. Set |mark_notification_as_read| to
// true in case marking the notification as read too.
void MarkSinglePopupAsShown(const std::string& id,
bool mark_notification_as_read);
// Marks a specific popup item as displayed.
void MarkSinglePopupAsDisplayed(const std::string& id);
NotificationDelegate* GetNotificationDelegate(const std::string& id);
bool quiet_mode() const { return quiet_mode_; }
// Sets the current quiet mode status to |quiet_mode|.
void SetQuietMode(bool quiet_mode);
// Sets the current quiet mode to true. The quiet mode will expire in the
// specified time-delta from now.
void EnterQuietModeWithExpire(const base::TimeDelta& expires_in);
// Returns the notification with the corresponding id. If not found, returns
// NULL. Notification instance is owned by this list.
Notification* GetNotificationById(const std::string& id);
// Returns all visible notifications, in a (priority-timestamp) order.
// Suitable for rendering notifications in a MessageCenter.
Notifications GetVisibleNotifications(
const NotificationBlockers& blockers) const;
size_t NotificationCount(const NotificationBlockers& blockers) const;
size_t UnreadCount(const NotificationBlockers& blockers) const;
bool is_message_center_visible() const { return message_center_visible_; }
private:
friend class NotificationListTest;
FRIEND_TEST_ALL_PREFIXES(NotificationListTest,
TestPushingShownNotification);
// Iterates through the list and returns the first notification matching |id|.
Notifications::iterator GetNotification(const std::string& id);
void EraseNotification(Notifications::iterator iter);
void PushNotification(scoped_ptr<Notification> notification);
Notifications notifications_;
bool message_center_visible_;
bool quiet_mode_;
DISALLOW_COPY_AND_ASSIGN(NotificationList);
};
} // namespace message_center
#endif // UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_
| [
"zeno.albisser@hemispherian.com"
] | zeno.albisser@hemispherian.com |
119cf1b488fc19ca15acf801bac84b6881fc64cb | 1203c8aa543696764e6dab9ead5f3b69fe1bd318 | /draemcia/Task_Field.h | 4c965ebd79fdf4612d0da845fe8e985ed5fc611d | [] | no_license | feveleK5563/draemcia | 4d929f6350df3d15605f04122251b6805f4004b6 | 6b276132a81bbaed0872bba8dae3654eddbfc4a7 | refs/heads/master | 2021-09-03T15:59:17.179175 | 2018-01-10T08:25:39 | 2018-01-10T08:25:39 | 114,894,741 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 1,927 | h | #pragma warning(disable:4996)
#pragma once
//-------------------------------------------------------------------
//
//-------------------------------------------------------------------
#include "GameEngine_Ver3_7.h"
namespace Field
{
//タスクに割り当てるグループ名と固有名
const string defGroupName("フィールド"); //グループ名
const string defName("フィールド"); //タスク名
//-------------------------------------------------------------------
class Resource
{
bool Initialize();
bool Finalize();
Resource();
public:
~Resource();
typedef shared_ptr<Resource> SP;
typedef weak_ptr<Resource> WP;
static WP instance;
static Resource::SP Create();
//共有する変数はここに追加する
};
//-------------------------------------------------------------------
class Object : public BTask
{
//変更不可◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆
public:
virtual ~Object();
typedef shared_ptr<Object> SP;
typedef weak_ptr<Object> WP;
//生成窓口 引数はtrueでタスクシステムへ自動登録
static Object::SP Create(bool flagGameEnginePushBack_);
Resource::SP res;
private:
Object();
bool B_Initialize();
bool B_Finalize();
bool Initialize(); //「初期化」タスク生成時に1回だけ行う処理
void UpDate(); //「実行」1フレーム毎に行う処理
void Render2D_AF(); //「2D描画」1フレーム毎に行う処理
bool Finalize(); //「終了」タスク消滅時に1回だけ行う処理
//変更可◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇
public:
//追加したい変数・メソッドはここに追加する
string imageName;
const int groundBorder = 36;
//画面外判定
bool OutScreen(const ML::Box2D&);
//足元判定
bool HitFoot(const ML::Box2D&);
};
} | [
"buncha102828@gmail.com"
] | buncha102828@gmail.com |
5d78e8914fe78667da4aef160cfb09baf6aba990 | 3cb55fcec0c65f340df5f71b56bd886797bef567 | /dcc/src/ir/IrCommon.cpp | 3a5d5a2a9c736459d74f9dc4e2a68ab44b41cf92 | [] | no_license | rweyrauch/Compiler | ba3acec94d192d3ec59582bf187a54245b17da9a | 9abd541313504aae9b4ed27c6b4e578e9fc476ea | refs/heads/master | 2020-05-20T01:37:07.483902 | 2016-04-22T14:42:44 | 2016-04-22T14:42:44 | 185,315,003 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,133 | cpp | //
// The MIT License (MIT)
//
// Copyright (c) 2015 Rick Weyrauch (rpweyrauch@gmail.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#include "IrCommon.h"
namespace Decaf
{
const std::string gIrTypeStrings[(int)IrType::NUM_IR_TYPES] =
{
std::string("Unknown"),
std::string("Void"),
std::string("Integer"),
std::string("Boolean"),
std::string("Character"),
std::string("String"),
std::string("Double"),
std::string("Array"),
std::string("Class"),
std::string("Interface")
};
static_assert(sizeof(gIrTypeStrings)/sizeof(std::string) == (size_t)IrType::NUM_IR_TYPES, "Unexpected number of IrType strings.");
bool IsNumeric(IrType type)
{
return (type == IrType::Integer || type == IrType::Double);
}
bool IsComparable(IrType type)
{
return (type == IrType::Integer || type == IrType::Double || type == IrType::Boolean);
}
const std::string gIrBinaryOperatorStrings[(int)IrBinaryOperator::NUM_IR_BINARY_OPERATORS] =
{
std::string("Add"),
std::string("Subtract"),
std::string("Multiply"),
std::string("Divide"),
std::string("Modulo"),
};
static_assert(sizeof(gIrBinaryOperatorStrings)/sizeof(std::string) == (size_t)IrBinaryOperator::NUM_IR_BINARY_OPERATORS, "Unexpected number of IrBinaryOperator strings.");
const std::string gIrBooleanOperatorStrings[(int)IrBooleanOperator::NUM_IR_BOOLEAN_OPERATORS] =
{
std::string("Equal"),
std::string("NotEqual"),
std::string("Less"),
std::string("LessEqual"),
std::string("Greater"),
std::string("GreaterEqual"),
std::string("LogicalAnd"),
std::string("LogicalOr"),
std::string("Not")
};
static_assert(sizeof(gIrBooleanOperatorStrings)/sizeof(std::string) == (size_t)IrBooleanOperator::NUM_IR_BOOLEAN_OPERATORS, "Unexpected number of IrBooleanOperator strings.");
const std::string gIrAssignmentOperatorStrings[(int)IrAssignmentOperator::NUM_IR_ASSIGNMENT_OPERATORS] =
{
std::string("Assign"),
std::string("IncrementAssign"),
std::string("DecrementAssign")
};
static_assert(sizeof(gIrAssignmentOperatorStrings)/sizeof(std::string) == (size_t)IrAssignmentOperator::NUM_IR_ASSIGNMENT_OPERATORS, "Unexpected number of IrAssignmentOperator strings.");
const std::string gIrMemLocationStrings[(int)IrMemLocation::NUM_MEM_LOCATIONS] =
{
std::string("Local"),
std::string("Global")
};
static_assert(sizeof(gIrMemLocationStrings)/sizeof(std::string) == (size_t)IrMemLocation::NUM_MEM_LOCATIONS, "Unexpected number or IrMemLocation strings.");
const std::string& IrTypeToString(IrType type)
{
return gIrTypeStrings[(int)type];
}
const std::string& IrBinaryOperatorToString(IrBinaryOperator op)
{
return gIrBinaryOperatorStrings[(int)op];
}
const std::string& IrBooleanOperatorToString(IrBooleanOperator op)
{
return gIrBooleanOperatorStrings[(int)op];
}
const std::string& IrAssignmentOperatorToString(IrAssignmentOperator op)
{
return gIrAssignmentOperatorStrings[(int)op];
}
const std::string& IrMemLocationToString(IrMemLocation loc)
{
return gIrMemLocationStrings[(int)loc];
}
} // namespace Decaf | [
"rpweyrauch@gmail.com"
] | rpweyrauch@gmail.com |
b5de6e78f63e9f1f0b7f5a5973766e59859ce685 | 86b503314c1984a7ad83dae62dd8565fb79f4741 | /Nhapxuatfile/bai5.cpp | 7dc960f8b2390834acebc9b3f6be1461e54e8acf | [] | no_license | 20021423/on-basic-bec-17 | 9b61b63a65e967cfde816b0deea724e922ce44af | b6716079023aed5bd37c78ccb8f98228e00d6360 | refs/heads/main | 2023-09-01T08:39:14.547293 | 2021-10-18T12:01:31 | 2021-10-18T12:01:31 | 350,401,371 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 827 | cpp | #include<iostream>
#include<cmath>
using namespace std;
int giaithua(int n)
{ int tich = 1;
for (int i = 1; i <=n; i++)
{
tich = tich* i;
}
return tich;
}
int main(){
int n, k, C;
int x ;
do
{
cin >> n >> k;
if(n <= 0 || k <= 0 )
{
cout <<"Nhap lai gia tri n va k";
cin >> n >> k;
}
}while(n <= 0 || k <= 0 );
if (k == 1)
{
C = n;
int x = C % (int ((pow(10, 9))+7));
}
else if(k == 2)
{
C = ((n - 1) * (n - 2)) / 2;
int x = (C % (int ((pow(10, 9))+7)));
}
else (k >= 3)
{
C = ((giaithua(n))/(giaithua(k) * giaithua(n-k))) - pow((n-k), 2);
int x = (C % (int ((pow(10, 9))+7)));
}
cout <<" Ket qua cua bai toan la:"<<x;
return 0;
}
| [
"80799030+20021423@users.noreply.github.com"
] | 80799030+20021423@users.noreply.github.com |
1e0c2894967c092d0f4e3cda62dd98180178312c | 4db165b7859b4db00b3a6bbe174ad286f9b23813 | /C++ Tasks/A12P8/Square.h | 1ee5406c7a58671c440cb4c445bfc83bbb6b6b78 | [] | no_license | osobiehl/C-and-C- | 1461d947fe5375cf05d546699e76b5deb9fc20b9 | 69a934a62052ca8541339eaa5092a697e8205c87 | refs/heads/master | 2022-12-16T11:33:15.357872 | 2020-09-10T14:44:59 | 2020-09-10T14:44:59 | 294,438,857 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 202 | h | #include "Rectangle.h"
class Square : public Rectangle{
public:
Square(const char *n, double a);
~Square(){}
double calcArea() const;
double calcPerimeter() const;
private:
double side;
};
| [
"osobiehl@me.com"
] | osobiehl@me.com |
63b39040df9ea0abd73b6820cafa9b356311fcf5 | aff5c16fa27944171c764b33b7f681143d0db1ed | /UVa/Emoogle_Balance.cpp | d026398c052bf146fd7ab1cd6ebc8a2847e4dc3a | [] | no_license | sahirboghani/Code | 3de61acd539dbaffa554e709f7f0db60e9893f32 | a108850fb1387a7fb4a24819acbe9bb00bdd2794 | refs/heads/master | 2016-09-06T00:22:09.268272 | 2015-10-13T21:51:37 | 2015-10-13T21:51:37 | 38,544,450 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 295 | cpp | #include <stdio.h>
int main() {
int N = 1, n = 0, Emoogle = 0, temp;
while(true) {
scanf("%i", &N);
if(N == 0)
return 0;
Emoogle = 0;
while(N--) {
scanf("%i", &temp);
Emoogle = temp == 0 ? Emoogle-1 : Emoogle+1;
}
printf("Case %i: %i\n", ++n, Emoogle);
}
return 0;
} | [
"sahirboghani@gmail.com"
] | sahirboghani@gmail.com |
f40d664e5c8be680d319e6e4c79c0bab5ec0a53d | 80149474d446df105af08a50310ac2acb3c55df5 | /1609_Team1/1609_Team1/InputManager.h | 1252ae21172ab8935a56daf157531da2e18ae0c8 | [] | no_license | LimCHBunkerDefense/BunkerDefense | 39f6ac90594bc40af0d16ec8c8aa91cf25d9bea7 | c929e41a8322fca35da94b7d6bea28dc3068acb8 | refs/heads/master | 2021-01-09T05:29:38.862838 | 2017-02-20T04:25:40 | 2017-02-20T04:25:40 | 80,777,212 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,251 | h | #pragma once
#include "Singleton.h"
#include "Common.h"
#include <Windows.h>
#define INPUT InputManager::Instance()
class InputManager : public Singleton<InputManager>
{
HWND m_hWnd;
KEY_STATE m_keyStates[KEY_COUNT];
MOUSE_STATE m_mouseStates[MOUSE_COUNT];
POINT m_mousePrevPos;
POINT m_mouseCurrentPos;
POINT m_mouseDeltaPos;
void UpdateKeyState();
void UpdateMouseState();
public:
InputManager();
~InputManager();
void Init(HWND hWnd);
void Release();
void Update();
KEY_STATE GetKeyState(int key) { return m_keyStates[key]; }
MOUSE_STATE GetMouseState(MOUSE_BUTTON btn) { return m_mouseStates[btn]; }
POINT GetMousePos() { return m_mouseCurrentPos; }
POINT GetMouseDelta() { return m_mouseDeltaPos; }
bool IsKeyDown(int key) { return GetKeyState(key) == KEY_DOWN; }
bool IsKeyUp(int key) { return GetKeyState(key) == KEY_UP; }
bool IsKeyPress(int key) { return GetKeyState(key) == KEY_PRESS; }
bool IsMouseDown(MOUSE_BUTTON btn) { return GetMouseState(btn) == MOUSE_DOWN; }
bool IsMouseUp(MOUSE_BUTTON btn) { return GetMouseState(btn) == MOUSE_UP; }
bool IsMousePress(MOUSE_BUTTON btn) { return GetMouseState(btn) == MOUSE_PRESS; }
bool IsMouseDrag(MOUSE_BUTTON btn) { return GetMouseState(btn) == MOUSE_DRAG; }
}; | [
"gnwmapf@naver.com"
] | gnwmapf@naver.com |
ab8e4491c784245e0c8598eecfc868d986edde1f | f67b83eaea2999c89bab8819ec252ec4f2e21884 | /interface/Producers/TagAndProbePairProducer.h | 0cd05418847a0941813a78d3e0406b39cca36529 | [] | no_license | KIT-CMS/KITHiggsToTauTau | c2ef71b5e25ec9c2734c754939c03486a44548c1 | 140415158182562432715c38f783ba3dd5a5a3ce | refs/heads/reduced_trigger_objects | 2021-12-22T17:20:00.221747 | 2021-12-17T14:14:06 | 2021-12-17T14:14:06 | 99,792,165 | 1 | 7 | null | 2021-05-25T06:25:07 | 2017-08-09T09:45:59 | Python | UTF-8 | C++ | false | false | 17,341 | h | #pragma once
#include "../HttTypes.h"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/trim.hpp>
class TagAndProbeMuonPairProducer: public ProducerBase<HttTypes> {
public:
typedef typename HttTypes::event_type event_type;
typedef typename HttTypes::product_type product_type;
typedef typename HttTypes::setting_type setting_type;
virtual std::string GetProducerId() const override {
return "TagAndProbeMuonPairProducer";
}
enum class ValidMuonsInput : int
{
AUTO = 0,
UNCORRECTED = 1,
CORRECTED = 2,
};
static ValidMuonsInput ToValidMuonsInput(std::string const& validMuonsInput)
{
if (validMuonsInput == "uncorrected") return ValidMuonsInput::UNCORRECTED;
else if (validMuonsInput == "corrected") return ValidMuonsInput::CORRECTED;
else return ValidMuonsInput::AUTO;
}
enum class MuonID : int
{
NONE = -1,
TIGHT = 0,
MEDIUM = 1,
LOOSE = 2,
VETO = 3,
FAKEABLE = 4,
EMBEDDING = 5
};
static MuonID ToMuonID(std::string const& muonID)
{
if (muonID == "tight") return MuonID::TIGHT;
else if (muonID == "medium") return MuonID::MEDIUM;
else if (muonID == "loose") return MuonID::LOOSE;
else if (muonID == "veto") return MuonID::VETO;
else if (muonID == "fakeable") return MuonID::FAKEABLE;
else if (muonID == "embedding") return MuonID::EMBEDDING;
else return MuonID::NONE;
}
virtual void Init(setting_type const& settings) override;
virtual void Produce(event_type const& event, product_type& product,
setting_type const& settings) const override;
protected:
MuonID muonID;
private:
ValidMuonsInput validMuonsInput;
float (setting_type::*GetMuonDeltaBetaCorrectionFactor)(void) const;
bool MuonIDshortTerm = false;
bool IsMediumMuon2016ShortTerm(KMuon* muon, event_type const& event, product_type& product) const;
bool IsMediumMuon2016(KMuon* muon, event_type const& event, product_type& product) const;
};
class TagAndProbeElectronPairProducer: public ProducerBase<HttTypes> {
public:
typedef typename HttTypes::event_type event_type;
typedef typename HttTypes::product_type product_type;
typedef typename HttTypes::setting_type setting_type;
virtual std::string GetProducerId() const override {
return "TagAndProbeElectronPairProducer";
}
enum class ValidElectronsInput : int
{
AUTO = 0,
UNCORRECTED = 1,
CORRECTED = 2,
};
static ValidElectronsInput ToValidElectronsInput(std::string const& validElectronsInput)
{
if (validElectronsInput == "uncorrected") return ValidElectronsInput::UNCORRECTED;
else if (validElectronsInput == "corrected") return ValidElectronsInput::CORRECTED;
else return ValidElectronsInput::AUTO;
}
enum class ElectronID : int
{
INVALID = -2,
NONE = -1,
MVANONTRIG = 0,
MVATRIG = 1,
VBTF95_VETO = 2,
VBTF95_LOOSE = 3,
VBTF95_MEDIUM = 4,
VBTF95_TIGHT = 5,
FAKEABLE = 6,
USER = 7,
VETO = 8,
LOOSE = 9,
MEDIUM = 10,
TIGHT = 11,
VBTF95_LOOSE_RELAXEDVTXCRITERIA = 12,
};
static ElectronID ToElectronID(std::string const& electronID)
{
if (electronID == "mvanontrig") return ElectronID::MVANONTRIG;
else if (electronID == "mvatrig") return ElectronID::MVATRIG;
else if (electronID == "vbft95_veto") return ElectronID::VBTF95_VETO;
else if (electronID == "vbft95_loose") return ElectronID::VBTF95_LOOSE;
else if (electronID == "vbft95_loose_relaxedvtxcriteria") return ElectronID::VBTF95_LOOSE_RELAXEDVTXCRITERIA;
else if (electronID == "vbft95_medium") return ElectronID::VBTF95_MEDIUM;
else if (electronID == "vbft95_tight") return ElectronID::VBTF95_TIGHT;
else if (electronID == "fakeable") return ElectronID::FAKEABLE;
else if (electronID == "user") return ElectronID::USER;
else if (electronID == "none") return ElectronID::NONE;
else if (electronID == "veto") return ElectronID::VETO;
else if (electronID == "loose") return ElectronID::LOOSE;
else if (electronID == "medium") return ElectronID::MEDIUM;
else if (electronID == "tight") return ElectronID::TIGHT;
else
LOG(FATAL) << "Could not find ElectronID " << electronID << "! If you want the ValidElectronsProducer to use no special ID, use \"none\" as argument."<< std::endl;
return ElectronID::INVALID;
}
virtual void Init(setting_type const& settings) override;
virtual void Produce(event_type const& event, product_type& product,
setting_type const& settings) const override;
protected:
ElectronID electronID;
private:
ValidElectronsInput validElectronsInput;
std::string electronIDName;
double electronMvaIDCutEB1;
double electronMvaIDCutEB2;
double electronMvaIDCutEE;
bool IsMVABased(KElectron* electron, event_type const& event, const std::string &idName) const;
};
/*
template<class TLepton>
class TagAndProbeGenLeptonProducer: public ProducerBase<HttTypes> {
public:
typedef typename HttTypes::event_type event_type;
typedef typename HttTypes::product_type product_type;
typedef typename HttTypes::setting_type setting_type;
TagAndProbeGenLeptonProducer(std::vector<TLepton>* event_type::*leptons,
std::vector<std::shared_ptr<TLepton>> product_type::*leptons_corrected,
std::vector<TLepton*> product_type::*validleptons,
std::vector<TLepton*> product_type::*genleptons) :
ProducerBase<HttTypes>(),
m_leptons(leptons),
m_leptons_corrected(leptons_corrected),
m_validleptons(validleptons),
m_genleptons(genleptons)
{
}
virtual std::string GetProducerId() const override {
return "TagAndProbeGenLeptonProducer";
}
enum class ValidLeptonsInput : int
{
AUTO = 0,
UNCORRECTED = 1,
CORRECTED = 2,
};
ValidLeptonsInput ToValidLeptzonsInput(std::string const& validLeptonsInput)
{
if (validLeptonsInput == "uncorrected") return ValidLeptonsInput::UNCORRECTED;
else if (validLeptonsInput == "corrected") return ValidLeptonsInput::CORRECTED;
else return ValidLeptonsInput::AUTO;
}
virtual void Init(setting_type const& settings) override
{
ProducerBase<HttTypes>::Init(settings);
}
virtual void Produce(event_type const& event, product_type& product,
setting_type const& settings) const override
{
assert(*m_leptons);
bool IsData = settings.GetInputIsData();
if(IsData) return;
// select input source
std::vector<TLepton*> leptons;
if ((validLeptonsInput == ValidLeptonsInput::AUTO && (m_leptons_corrected->size() > 0)) || (validLeptonsInput == ValidLeptonsInput::CORRECTED))
{
leptons.resize(m_leptons_corrected->size());
size_t leptonIndex = 0;
for (typename std::vector<std::shared_ptr<TLepton> >::iterator lepton = m_leptons_corrected->begin();
lepton != m_leptons_corrected->end(); ++lepton)
{
leptons[leptonIndex] = lepton->get();
++leptonIndex;
}
}
else
{
leptons.resize((*m_leptons)->size());
size_t leptonIndex = 0;
for (typename std::vector<TLepton>::iterator lepton = (*m_leptons)->begin(); lepton != (*m_leptons)->end(); ++lepton)
{
leptons[leptonIndex] = &(*lepton);
++leptonIndex;
}
}
//loop over leptons
for (typename std::vector<TLepton*>::iterator lepton = leptons.begin(); lepton != leptons.end(); ++lepton)
{
m_validleptons->push_back(*lepton); //needed for ValidLEptonsFilter
//filter
if (
(*lepton)->p4.Pt() > 10.0 &&
std::abs((*lepton)->p4.Eta()) < 2.5
){
m_genleptons->push_back(*lepton);
}
}
}
ValidLeptonsInput validLeptonsInput;
private:
std::vector<TLepton>* event_type::*m_leptons;
std::vector<std::shared_ptr<TLepton>> product_type::*m_leptons_corrected;
std::vector<TLepton*> product_type::*m_validleptons;
std::vector<TLepton*> product_type::*m_genleptons;
};
class TagAndProbeGenElectronProducer: public TagAndProbeGenLeptonProducer<KElectron> {
public:
typedef typename HttTypes::event_type event_type;
typedef typename HttTypes::product_type product_type;
typedef typename HttTypes::setting_type setting_type;
enum class ValidLeptonsInput : int
{
AUTO = 0,
UNCORRECTED = 1,
CORRECTED = 2,
};
virtual std::string GetProducerId() const override;
TagAndProbeGenElectronProducer();
virtual void Init(setting_type const& settings) override;
};
class TagAndProbeGenMuonProducer: public TagAndProbeGenLeptonProducer<KMuon> {
public:
typedef typename HttTypes::event_type event_type;
typedef typename HttTypes::product_type product_type;
typedef typename HttTypes::setting_type setting_type;
enum class ValidLeptonsInput : int
{
AUTO = 0,
UNCORRECTED = 1,
CORRECTED = 2,
};
virtual std::string GetProducerId() const override;
TagAndProbeGenMuonProducer();
virtual void Init(setting_type const& settings) override;
};
class TagAndProbeGenTauProducer: public TagAndProbeGenLeptonProducer<KTau> {
public:
typedef typename HttTypes::event_type event_type;
typedef typename HttTypes::product_type product_type;
typedef typename HttTypes::setting_type setting_type;
enum class ValidLeptonsInput : int
{
AUTO = 0,
UNCORRECTED = 1,
CORRECTED = 2,
};
virtual std::string GetProducerId() const override;
TagAndProbeGenTauProducer();
virtual void Init(setting_type const& settings) override;
};
*/
class TagAndProbeGenElectronProducer: public ProducerBase<HttTypes> {
public:
typedef typename HttTypes::event_type event_type;
typedef typename HttTypes::product_type product_type;
typedef typename HttTypes::setting_type setting_type;
virtual std::string GetProducerId() const override {
return "TagAndProbeGenElectronProducer";
}
enum class ValidElectronsInput : int
{
AUTO = 0,
UNCORRECTED = 1,
CORRECTED = 2,
};
ValidElectronsInput ToValidElectronsInput(std::string const& validElectronsInput)
{
if (validElectronsInput == "uncorrected") return ValidElectronsInput::UNCORRECTED;
else if (validElectronsInput == "corrected") return ValidElectronsInput::CORRECTED;
else return ValidElectronsInput::AUTO;
}
virtual void Init(setting_type const& settings) override
{
ProducerBase<HttTypes>::Init(settings);
validElectronsInput = ToValidElectronsInput(boost::algorithm::to_lower_copy(boost::algorithm::trim_copy(settings.GetValidElectronsInput())));
}
virtual void Produce(event_type const& event, product_type& product,
setting_type const& settings) const override
{
assert(event.m_electrons);
bool IsData = settings.GetInputIsData();
if(IsData) return;
// select input source
std::vector<KElectron*> electrons;
if ((validElectronsInput == ValidElectronsInput::AUTO && (product.m_correctedElectrons.size() > 0)) || (validElectronsInput == ValidElectronsInput::CORRECTED))
{
electrons.resize(product.m_correctedElectrons.size());
size_t electronIndex = 0;
for (std::vector<std::shared_ptr<KElectron> >::iterator electron = product.m_correctedElectrons.begin();
electron != product.m_correctedElectrons.end(); ++electron)
{
electrons[electronIndex] = electron->get();
++electronIndex;
}
}
else
{
electrons.resize(event.m_electrons->size());
size_t electronIndex = 0;
for (KElectrons::iterator electron = event.m_electrons->begin(); electron != event.m_electrons->end(); ++electron)
{
electrons[electronIndex] = &(*electron);
++electronIndex;
}
}
//loop over electrons
for (typename std::vector<KElectron*>::iterator electron = electrons.begin(); electron != electrons.end(); ++electron)
{
product.m_validElectrons.push_back(*electron); //needed for ValidLEptonsFilter
//filter
if (
(*electron)->p4.Pt() > 10.0 &&
std::abs((*electron)->p4.Eta()) < 2.5
){
product.m_TagAndProbeGenElectrons.push_back(*electron);
}
}
}
private:
ValidElectronsInput validElectronsInput;
};
class TagAndProbeGenMuonProducer: public ProducerBase<HttTypes> {
public:
typedef typename HttTypes::event_type event_type;
typedef typename HttTypes::product_type product_type;
typedef typename HttTypes::setting_type setting_type;
virtual std::string GetProducerId() const override {
return "TagAndProbeGenMuonProducer";
}
enum class ValidMuonsInput : int
{
AUTO = 0,
UNCORRECTED = 1,
CORRECTED = 2,
};
ValidMuonsInput ToValidMuonsInput(std::string const& validMuonsInput)
{
if (validMuonsInput == "uncorrected") return ValidMuonsInput::UNCORRECTED;
else if (validMuonsInput == "corrected") return ValidMuonsInput::CORRECTED;
else return ValidMuonsInput::AUTO;
}
virtual void Init(setting_type const& settings) override
{
ProducerBase<HttTypes>::Init(settings);
validMuonsInput = ToValidMuonsInput(boost::algorithm::to_lower_copy(boost::algorithm::trim_copy(settings.GetValidMuonsInput())));
}
virtual void Produce(event_type const& event, product_type& product,
setting_type const& settings) const override
{
assert(event.m_muons);
bool IsData = settings.GetInputIsData();
if(IsData) return;
// select input source
std::vector<KMuon*> muons;
if ((validMuonsInput == ValidMuonsInput::AUTO && (product.m_correctedMuons.size() > 0)) || (validMuonsInput == ValidMuonsInput::CORRECTED))
{
muons.resize(product.m_correctedMuons.size());
size_t muonIndex = 0;
for (std::vector<std::shared_ptr<KMuon> >::iterator muon = product.m_correctedMuons.begin();
muon != product.m_correctedMuons.end(); ++muon)
{
muons[muonIndex] = muon->get();
++muonIndex;
}
}
else
{
muons.resize(event.m_muons->size());
size_t muonIndex = 0;
for (KMuons::iterator muon = event.m_muons->begin(); muon != event.m_muons->end(); ++muon)
{
muons[muonIndex] = &(*muon);
++muonIndex;
}
}
//loop over muons
for (typename std::vector<KMuon*>::iterator muon = muons.begin(); muon != muons.end(); ++muon)
{
product.m_validMuons.push_back(*muon); //needed for ValidLEptonsFilter
//filter
if (
(*muon)->p4.Pt() > 10.0 &&
std::abs((*muon)->p4.Eta()) < 2.5
){
product.m_TagAndProbeGenMuons.push_back(*muon);
}
}
}
private:
ValidMuonsInput validMuonsInput;
};
class TagAndProbeGenTauProducer: public ProducerBase<HttTypes> {
public:
typedef typename HttTypes::event_type event_type;
typedef typename HttTypes::product_type product_type;
typedef typename HttTypes::setting_type setting_type;
virtual std::string GetProducerId() const override {
return "TagAndProbeGenTauProducer";
}
enum class ValidTausInput : int
{
AUTO = 0,
UNCORRECTED = 1,
CORRECTED = 2,
};
ValidTausInput ToValidTausInput(std::string const& validTausInput)
{
if (validTausInput == "uncorrected") return ValidTausInput::UNCORRECTED;
else if (validTausInput == "corrected") return ValidTausInput::CORRECTED;
else return ValidTausInput::AUTO;
}
virtual void Init(setting_type const& settings) override
{
ProducerBase<HttTypes>::Init(settings);
validTausInput = ToValidTausInput(boost::algorithm::to_lower_copy(boost::algorithm::trim_copy(settings.GetValidTausInput())));
}
virtual void Produce(event_type const& event, product_type& product,
setting_type const& settings) const override
{
assert(event.m_taus);
bool IsData = settings.GetInputIsData();
if(IsData) return;
// select input source
std::vector<KTau*> taus;
if ((validTausInput == ValidTausInput::AUTO && (product.m_correctedTaus.size() > 0)) || (validTausInput == ValidTausInput::CORRECTED))
{
taus.resize(product.m_correctedTaus.size());
size_t tauIndex = 0;
for (std::vector<std::shared_ptr<KTau> >::iterator tau = product.m_correctedTaus.begin();
tau != product.m_correctedTaus.end(); ++tau)
{
taus[tauIndex] = tau->get();
++tauIndex;
}
}
else
{
taus.resize(event.m_taus->size());
size_t tauIndex = 0;
for (KTaus::iterator tau = event.m_taus->begin(); tau != event.m_taus->end(); ++tau)
{
taus[tauIndex] = &(*tau);
++tauIndex;
}
}
//loop over taus
for (typename std::vector<KTau*>::iterator tau = taus.begin(); tau != taus.end(); ++tau)
{
product.m_validTaus.push_back(*tau); //needed for ValidLEptonsFilter
//filter
if (
(*tau)->p4.Pt() > 10.0 &&
std::abs((*tau)->p4.Eta()) < 2.5
){
product.m_TagAndProbeGenTaus.push_back(*tau);
}
}
}
private:
ValidTausInput validTausInput;
}; | [
"sebastian.wozniewski@student.kit.edu"
] | sebastian.wozniewski@student.kit.edu |
f31cbba93d374e525422aeb799b9b52192523a06 | ec8f6238a89045c4420b19fe662abc8754a33ead | /luogu/1897.cpp | 1b9e4021e509819b9390c41e00b38dc8c8286b0d | [] | no_license | hajbw/OICodeStorage | 9fe4748a13ec799aed8c21f67c576f8cfd47d3c6 | c4c1bbee4c2e0d5c5af792ce6cfb42a7ef5294b0 | refs/heads/master | 2021-07-23T22:51:23.816998 | 2018-11-09T13:58:34 | 2018-11-09T13:58:34 | 113,634,410 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 291 | cpp | #include <iostream>
using std::cin;
int main()
{
int* men;
int amount_of_men,result;
cin>>amount_of_men;
men = new int[amount_of_men];
for(int i = 0;i < amount_of_men;++i)
{
cin>>men[i];
}
std::cout<<result<<std::endl;
return 0;
} | [
"hajbw10@126.com"
] | hajbw10@126.com |
3f6ee3daeccbc0503af31c54d0b16396edab700a | 5c5fd0651610eba8615fbd1452a8aa9b86f023fc | /src/draw.cpp | 44a65d29a6f2743e67ba23e7d921d98a0e41fd69 | [] | no_license | Grinshpon/Feldunor-old- | 4d42603fccbb87d4a1c9cc70180c9370ca5ad860 | a4c0b18cbad281d2c63efb3aadfe8278f4e24bc2 | refs/heads/master | 2021-10-28T01:09:56.894197 | 2019-04-21T06:52:11 | 2019-04-21T06:52:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,072 | cpp | //all ncurses code to draw the game goes here
#include<ncurses.h>
#include<iostream>
#include<vector>
using std::string;
using std::vector;
int MAXROWS;
int MAXCOLS;
int clearScreen() {
//printf("\033[H\033[J");
clear();
return 0;
}
int initScreen() {
initscr();
cbreak();
noecho();
clear();
MAXROWS = LINES - 1;
MAXCOLS = COLS - 1;
return 0;
}
//drawScreen(stats bar, level plus entities on it, width of worldmap, height of world map, bottom actions bar)
int drawScreen(string statBar, char* world, int w, int h, string actions) { //will take char* 's and print them in the terminal
int status = clearScreen();
addstr(statBar.c_str());
//addch(ACS_ULCORNER);//REMOVE
addch('\n');
/*for(int i = 0, count=0; i < w*h; i++,count++) {
if (count == w) {
printf("\n");
count = 0;
}
printf("%c",world[i]);
}*/
for(int row = 0; row < h; row++) {
for(int col = 0; col < w; col++) {
addch(world[row*w+col]);
}
addch('\n');
}
addstr(actions.c_str());
refresh();
return status;
}
int exitCurse() {
endwin();
}
| [
"noreply@github.com"
] | noreply@github.com |
cfafc4af36878462e7eba765a54ca3a311c4d644 | c69e81086606a72d5fb43f0ca084513661d64f3e | /lib/lazybox/lazybox.h | c2a53688f9ef3e1edcbccc6bd2719744d724f0d9 | [] | no_license | fulf/lazybox | a5de0e86f2054609fd661b84b017a355b788e5c1 | d35c470d6d330837def027330b85f498f0496dc9 | refs/heads/master | 2020-03-16T23:08:23.895253 | 2018-10-12T16:08:32 | 2018-10-12T16:08:32 | 133,066,680 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 447 | h | #ifndef LAZYBOX_H
#define LAZYBOX_H
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <lazybox-webserver.h>
#include <lazybox-poller.h>
#include <map>
class LazyBox
{
private:
LazyBoxCore* _core;
LazyBoxWebServer* _web_server;
LazyBoxPoller* _poller;
std::map<const char*, LazyBoxPin> _pins;
void setWiFi(const char*);
public:
enum {
WEMOSD1miniPro,
};
LazyBox(uint8_t);
void run();
};
#endif
| [
"sorin.guga@gmail.com"
] | sorin.guga@gmail.com |
4811be62695715103cc675df8eb578f5e685d12c | a689db842a1a451d75612d2768e47786ba4d5af6 | /프로그래머스/프로그래머스_신규아이디추천.cpp | 164e1bc873ae7f5f33202797b2c0b39f1d4e8092 | [] | no_license | LeeYunSung/Algorithm | 3f3deea64629f1e250e73cf6d7762a55b6f8c447 | d37991da94ebcd9e368ee537429b0f60f016229a | refs/heads/master | 2023-08-18T19:23:42.392862 | 2023-08-12T15:40:12 | 2023-08-12T15:40:12 | 175,958,029 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 1,660 | cpp | #include <iostream>
#include <string>
#include <cctype>
#include <vector>
using namespace std;
int main() {
string id = "";
cin >> id;
cout << solution(id);
}
string solution(string id) {
string new_id = "";
//1단계: 대문자->소문자로 변환
for (int i = 0; i < id.size(); i++) {
id[i] = tolower(id[i]);
}
//2단계: ~!@#$%^&*()=+[{]}:?,<>/ 문자 제거 (해당되는 문자만 new_id[]에 넣기)
for (int i = 0; i < id.size(); i++) {
if (id[i] != '-' && id[i] != '.'
&& !('a' <= id[i] && id[i] <= 'z')
&& !('0' <= id[i] && id[i] <= '9')) {
continue;
}
new_id.push_back(id[i]);
}
//3단계: 마침표(.)가 2번 이상 연속된 부분을 하나의 마침표(.)로 치환
string temp = "";
for (int i = 0; i < new_id.size(); i++) {
if (new_id[i] == '.') {
temp.push_back('.');
while (i < new_id.size() && new_id[i] == '.') i++;
i--;
}
else temp.push_back(new_id[i]);
}
new_id = temp;
//4단계: 양끝에 있는 마침표(.) 제거
if (new_id[0] == '.') new_id = new_id.substr(1);
if (new_id[new_id.size() - 1] == '.') new_id = new_id.substr(0, new_id.size() - 1);
//5단계: id가 빈문자열일 경우, "a"를 대입
if (new_id.empty()) new_id = "a";
//6단계: id 길이가 16자 이상이면, 15개 이후 문자 모두 제거
if (new_id.size() >= 16) new_id = new_id.substr(0, 15);
if (new_id[new_id.size() - 1] == '.') new_id = new_id.substr(0, new_id.size() - 1);
//7단계: id 길이가 2자 이하라면, id 마지막 문자를 id의 길이가 3이 될 때까지 반복해서 끝에 붙이기.
while (new_id.size() <= 2) new_id += new_id[new_id.size() - 1];
return new_id;
} | [
"dldbstjd6350@naver.com"
] | dldbstjd6350@naver.com |
0a50d49b5261c11c4e9e73493137e994c28a1009 | 334815c36b3c22211b9e98a4e197f71082930a48 | /Source/DataServer/Header Files/Database.h | 585a7a49bea3409901589e0ac0158e27f9a08857 | [] | no_license | sonnickoo/mu-server-ex | 3e8c181acc7ce1aa3e2bce3a9dd99cde500d580e | bfb5e089de504fef83bca8bed5e14cc5abb97100 | refs/heads/master | 2021-01-19T00:43:16.625249 | 2015-09-14T13:10:37 | 2015-09-14T13:10:37 | 42,448,734 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,235 | h | #ifndef _DATABASE_H_
#define _DATABASE_H_
#include "StdAfx.H"
#include "Database.H"
#include "LogProc.H"
class CDataBase
{
public:
CDataBase();
virtual ~CDataBase();
// ----
bool Initialize();
bool Connect(const char * szHost, const char * szDataBase, const char * szUser, const char * szPassword);
bool Connect(const char * szDnsName);
bool Reconnect();
bool Exec(const char * szQuery);
bool ExecFormat(const char * szQuery, ...);
int FindCol(const char * szName);
int GetInt(int nCol);
int GetInt(const char *sCol);
__int64 GetInt64(int nCol);
__int64 GetInt64(const char *sCol);
float GetFloat(int nCol);
float GetFloat(const char *sCol);
void GetStr(int nCol, char *buf);
void GetStr(const char *sCol, char *buf);
int GetAsBinary(LPSTR lpszStatement, LPBYTE OUT lpszReturnBuffer);
void SetAsBinary(LPTSTR lpszStatement, LPBYTE lpBinaryBuffer, SQLUINTEGER BinaryBufferSize);
// ----
SQLRETURN inline Fetch(){ return SQLFetch(m_hStmt); };
void inline Clear(){ SQLCloseCursor(m_hStmt) ; SQLFreeStmt(m_hStmt, SQL_UNBIND); };
// ----
void Diagnostic()
{
if(SQLGetDiagRec(SQL_HANDLE_STMT, m_hStmt, m_SQLErrorCount, m_SqlState, &m_NativeError, m_szMsg, sizeof(m_szMsg), &m_MsgOutLen) != SQL_NO_DATA)
{
m_SQLErrorCount++;
// ----
memcpy(m_szTemp, m_szMsg , m_MsgOutLen);
// ----
CLog.Error(m_szTemp);
}
else m_SQLErrorCount = 1;
// ----
if( strcmp((LPCTSTR)m_SqlState, "08S01") == 0 )
{
Reconnect();
}
};
// ----
void DiagnosticConnection()
{
if(SQLGetDiagRec(SQL_HANDLE_DBC, m_hDbc, m_SQLErrorCount, m_SqlState, &m_NativeError, m_szMsg, sizeof(m_szMsg), &m_MsgOutLen) != SQL_NO_DATA)
{
m_SQLErrorCount++;
// ----
memcpy(m_szTemp, m_szMsg , m_MsgOutLen);
// ----
CLog.Error(m_szTemp);
}
else m_SQLErrorCount = 1;
// ----
if( strcmp((LPCTSTR)m_SqlState, "08S01") == 0 )
{
Reconnect();
}
};
// -----
private:
SQLINTEGER m_AfftedRowCount;
SQLRETURN m_Return;
// ----
SQLHENV m_hEnv;
SQLHDBC m_hDbc;
SQLHSTMT m_hStmt;
SQLSMALLINT m_nCol;
// ----
char m_Col[MAX_COLUMN][255];
SQLCHAR m_ColName[MAX_COLUMN][50];
SQLINTEGER m_lCol[MAX_COLUMN];
// ----
std::string m_strHost;
std::string m_strUser;
std::string m_strPassword;
std::string m_strDataBase;
std::string m_strDnsName;
// ----
char m_szTemp[MAX_DB_TEXT_LEN];
SQLCHAR m_szMsg[MAX_DB_TEXT_LEN];
SQLCHAR m_SqlState[MAX_DB_TEXT_LEN];
// ----
int m_SQLErrorCount;
SQLSMALLINT m_MsgOutLen;
SQLINTEGER m_NativeError;
// ----
va_list m_pArgs;
};
// -------------------------------------------------------------------------------------------------------------------------------------------------------
extern CDataBase gDataBase;
// -------------------------------------------------------------------------------------------------------------------------------------------------------
#endif /* _DATABASE_H_ */
// ------------------------------------------------------------------------------------------------------------------------------------------------------- | [
"krisis521@inbox.lv"
] | krisis521@inbox.lv |
49110c84dcdff9d2fd12aec5775e00ed441d8159 | 90047daeb462598a924d76ddf4288e832e86417c | /media/blink/webmediaplayer_params.cc | 3cd835f5dc536aa25393a484efbb118fabc4404c | [
"BSD-3-Clause"
] | permissive | massbrowser/android | 99b8c21fa4552a13c06bbedd0f9c88dd4a4ad080 | a9c4371682c9443d6e1d66005d4db61a24a9617c | refs/heads/master | 2022-11-04T21:15:50.656802 | 2017-06-08T12:31:39 | 2017-06-08T12:31:39 | 93,747,579 | 2 | 2 | BSD-3-Clause | 2022-10-31T10:34:25 | 2017-06-08T12:36:07 | null | UTF-8 | C++ | false | false | 2,257 | cc | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/blink/webmediaplayer_params.h"
#include "base/single_thread_task_runner.h"
#include "base/task_runner.h"
#include "media/base/audio_renderer_sink.h"
namespace media {
WebMediaPlayerParams::WebMediaPlayerParams(
std::unique_ptr<MediaLog> media_log,
const DeferLoadCB& defer_load_cb,
const scoped_refptr<SwitchableAudioRendererSink>& audio_renderer_sink,
const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
const scoped_refptr<base::TaskRunner>& worker_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner,
const Context3DCB& context_3d_cb,
const AdjustAllocatedMemoryCB& adjust_allocated_memory_cb,
blink::WebContentDecryptionModule* initial_cdm,
SurfaceManager* surface_manager,
base::WeakPtr<MediaObserver> media_observer,
base::TimeDelta max_keyframe_distance_to_disable_background_video,
base::TimeDelta max_keyframe_distance_to_disable_background_video_mse,
bool enable_instant_source_buffer_gc,
bool allow_suspend,
bool embedded_media_experience_enabled)
: defer_load_cb_(defer_load_cb),
audio_renderer_sink_(audio_renderer_sink),
media_log_(std::move(media_log)),
media_task_runner_(media_task_runner),
worker_task_runner_(worker_task_runner),
compositor_task_runner_(compositor_task_runner),
context_3d_cb_(context_3d_cb),
adjust_allocated_memory_cb_(adjust_allocated_memory_cb),
initial_cdm_(initial_cdm),
surface_manager_(surface_manager),
media_observer_(media_observer),
max_keyframe_distance_to_disable_background_video_(
max_keyframe_distance_to_disable_background_video),
max_keyframe_distance_to_disable_background_video_mse_(
max_keyframe_distance_to_disable_background_video_mse),
enable_instant_source_buffer_gc_(enable_instant_source_buffer_gc),
allow_suspend_(allow_suspend),
embedded_media_experience_enabled_(embedded_media_experience_enabled) {}
WebMediaPlayerParams::~WebMediaPlayerParams() {}
} // namespace media
| [
"xElvis89x@gmail.com"
] | xElvis89x@gmail.com |
b239c35a8ffc6408d9b3492ff48da0a52c74b818 | c5926d298295d62cb1571bb21cc2ce164b38babd | /src/qt/bitcoingui.cpp | e8e22c7b75799698b43638d6f84376254f9493a4 | [
"MIT"
] | permissive | MasternodeXchange/MNXCV2 | 59c1702c482ab74747faacb3b9e58d12c8d063cc | df8c1999b354bc4673b729447ea56ee95a09482d | refs/heads/master | 2021-09-03T05:05:44.018429 | 2018-01-05T20:59:45 | 2018-01-05T20:59:45 | 116,422,346 | 2 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 47,865 | cpp | /*
* Qt4 bitcoin GUI.
*
* W.J. van der Laan 2011-2012
* The Bitcoin Developers 2011-2012
*/
#include <QApplication>
#include "bitcoingui.h"
#include "transactiontablemodel.h"
#include "addressbookpage.h"
#include "sendcoinsdialog.h"
#include "signverifymessagedialog.h"
#include "optionsdialog.h"
#include "aboutdialog.h"
#include "clientmodel.h"
#include "walletmodel.h"
#include "editaddressdialog.h"
#include "optionsmodel.h"
#include "transactiondescdialog.h"
#include "addresstablemodel.h"
#include "transactionview.h"
#include "overviewpage.h"
#include "bitcoinunits.h"
#include "guiconstants.h"
#include "askpassphrasedialog.h"
#include "notificator.h"
#include "guiutil.h"
#include "rpcconsole.h"
#include "wallet.h"
#include "main.h"
#include "init.h"
#include "ui_interface.h"
#include "masternodemanager.h"
#include "messagemodel.h"
#include "messagepage.h"
#include "blockbrowser.h"
#include "tradingdialog.h"
#ifdef Q_OS_MAC
#include "macdockiconhandler.h"
#endif
#include <QMenuBar>
#include <QMenu>
#include <QIcon>
#include <QVBoxLayout>
#include <QToolBar>
#include <QStatusBar>
#include <QLabel>
#include <QMessageBox>
#include <QMimeData>
#include <QProgressBar>
#include <QProgressDialog>
#include <QStackedWidget>
#include <QDateTime>
#include <QMovie>
#include <QFileDialog>
#include <QDesktopServices>
#include <QTimer>
#include <QDragEnterEvent>
#include <QUrl>
#include <QMimeData>
#include <QStyle>
#include <QToolButton>
#include <QScrollArea>
#include <QScroller>
#include <QTextDocument>
#include <iostream>
extern bool fOnlyTor;
extern CWallet* pwalletMain;
extern int64_t nLastCoinStakeSearchInterval;
double GetPoSKernelPS();
BitcoinGUI::BitcoinGUI(QWidget *parent):
QMainWindow(parent),
clientModel(0),
walletModel(0),
toolbar(0),
progressBarLabel(0),
progressBar(0),
progressDialog(0),
encryptWalletAction(0),
changePassphraseAction(0),
unlockWalletAction(0),
lockWalletAction(0),
aboutQtAction(0),
trayIcon(0),
notificator(0),
rpcConsole(0),
prevBlocks(0),
nWeight(0)
{
resize(900, 520);
setWindowTitle(tr("MasternodeXchange") + " - " + tr("Wallet"));
#ifndef Q_OS_MAC
qApp->setWindowIcon(QIcon(":icons/bitcoin"));
setWindowIcon(QIcon(":icons/bitcoin"));
#else
//setUnifiedTitleAndToolBarOnMac(true);
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
setObjectName("MasternodeXchange");
setStyleSheet("#MasternodeXchange { background-color: #ffffff}");
// Accept D&D of URIs
setAcceptDrops(true);
// Create actions for the toolbar, menu bar and tray/dock icon
createActions();
// Create application menu bar
createMenuBar();
// Create the toolbars
createToolBars();
// Create the tray icon (or setup the dock icon)
createTrayIcon();
// Create tabs
overviewPage = new OverviewPage();
transactionsPage = new QWidget(this);
QVBoxLayout *vbox = new QVBoxLayout();
transactionView = new TransactionView(this);
vbox->addWidget(transactionView);
transactionsPage->setLayout(vbox);
blockBrowser = new BlockBrowser(this);
addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);
receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);
sendCoinsPage = new SendCoinsDialog(this);
tradingDialogPage = new tradingDialog(this);
tradingDialogPage->setObjectName("tradingDialog");
signVerifyMessageDialog = new SignVerifyMessageDialog(this);
masternodeManagerPage = new MasternodeManager(this);
messagePage = new MessagePage(this);
centralStackedWidget = new QStackedWidget(this);
centralStackedWidget->setContentsMargins(0, 0, 0, 0);
centralStackedWidget->addWidget(overviewPage);
centralStackedWidget->addWidget(transactionsPage);
centralStackedWidget->addWidget(addressBookPage);
centralStackedWidget->addWidget(receiveCoinsPage);
centralStackedWidget->addWidget(sendCoinsPage);
centralStackedWidget->addWidget(masternodeManagerPage);
centralStackedWidget->addWidget(messagePage);
centralStackedWidget->addWidget(blockBrowser);
centralStackedWidget->addWidget(tradingDialogPage);
QWidget *centralWidget = new QWidget();
QVBoxLayout *centralLayout = new QVBoxLayout(centralWidget);
centralLayout->setContentsMargins(0,0,0,0);
centralWidget->setContentsMargins(0,0,0,0);
centralLayout->addWidget(centralStackedWidget);
setCentralWidget(centralWidget);
// Create status bar
statusBar();
// Disable size grip because it looks ugly and nobody needs it
statusBar()->setSizeGripEnabled(false);
// Status bar notification icons
QWidget *frameBlocks = new QWidget();
frameBlocks->setContentsMargins(0,0,0,0);
frameBlocks->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
frameBlocks->setStyleSheet("QWidget { background: none; margin-bottom: 5px; }");
QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
frameBlocksLayout->setContentsMargins(3,0,3,0);
frameBlocksLayout->setSpacing(3);
frameBlocksLayout->setAlignment(Qt::AlignHCenter);
labelEncryptionIcon = new QLabel();
labelStakingIcon = new QLabel();
labelConnectionsIcon = new QLabel();
labelBlocksIcon = new QLabel();
frameBlocksLayout->addWidget(netLabel);
//frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelEncryptionIcon);
//frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelStakingIcon);
//frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelConnectionsIcon);
//frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelBlocksIcon);
//frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(netLabel);
//frameBlocksLayout->addStretch();
if (GetBoolArg("-staking", true))
{
QTimer *timerStakingIcon = new QTimer(labelStakingIcon);
connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon()));
timerStakingIcon->start(20 * 1000);
updateStakingIcon();
}
// Progress bar and label for blocks download
progressBarLabel = new QLabel();
progressBarLabel->setVisible(false);
progressBar = new QProgressBar();
progressBar->setAlignment(Qt::AlignCenter);
progressBar->setVisible(false);
if (!fUseBlackTheme)
{
// Override style sheet for progress bar for styles that have a segmented progress bar,
// as they make the text unreadable (workaround for issue #1071)
// See https://qt-project.org/doc/qt-4.8/gallery.html
QString curStyle = qApp->style()->metaObject()->className();
if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
{
progressBar->setStyleSheet("QProgressBar { color: #ffffff;background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }");
}
}
statusBar()->addWidget(progressBarLabel);
statusBar()->addWidget(progressBar);
statusBar()->addPermanentWidget(frameBlocks);
statusBar()->setObjectName("statusBar");
statusBar()->setStyleSheet("#statusBar { color: #ffffff; background-color: qradialgradient(cx: -0.8, cy: 0, fx: -0.8, fy: 0, radius: 0.6, stop: 0 #1690ca, stop: 1 #127fb3); }");
syncIconMovie = new QMovie(fUseBlackTheme ? ":/movies/update_spinner_black" : ":/movies/update_spinner", "mng", this);
// Clicking on a transaction on the overview page simply sends you to transaction history page
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));
connect(TradingAction, SIGNAL(triggered()), tradingDialogPage, SLOT(InitTrading()));
// Double-clicking on a transaction on the transaction history page shows details
connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
rpcConsole = new RPCConsole(this);
connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));
// clicking on automatic backups shows details
connect(showBackupsAction, SIGNAL(triggered()), rpcConsole, SLOT(showBackups()));
// prevents an oben debug window from becoming stuck/unusable on client shutdown
connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide()));
// Clicking on "Verify Message" in the address book sends you to the verify message tab
connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
// Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));
gotoOverviewPage();
}
BitcoinGUI::~BitcoinGUI()
{
if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu)
trayIcon->hide();
#ifdef Q_OS_MAC
delete appMenuBar;
#endif
}
void BitcoinGUI::createActions()
{
QActionGroup *tabGroup = new QActionGroup(this);
overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Dashboard"), this);
overviewAction->setToolTip(tr("Show general overview of wallet"));
overviewAction->setCheckable(true);
overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1));
tabGroup->addAction(overviewAction);
receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive"), this);
receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments"));
receiveCoinsAction->setCheckable(true);
receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
tabGroup->addAction(receiveCoinsAction);
sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send"), this);
sendCoinsAction->setToolTip(tr("Send coins to a MasternodeXchange address"));
sendCoinsAction->setCheckable(true);
sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
tabGroup->addAction(sendCoinsAction);
historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this);
historyAction->setToolTip(tr("Browse transaction history"));
historyAction->setCheckable(true);
historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
tabGroup->addAction(historyAction);
addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Addresses"), this);
addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels"));
addressBookAction->setCheckable(true);
addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
tabGroup->addAction(addressBookAction);
masternodeManagerAction = new QAction(QIcon(":/icons/mnodes"), tr("&Masternodes"), this);
masternodeManagerAction->setToolTip(tr("Show Master Nodes status and configure your nodes."));
masternodeManagerAction->setCheckable(true);
tabGroup->addAction(masternodeManagerAction);
messageAction = new QAction(QIcon(":/icons/edit"), tr("&Messages"), this);
messageAction->setToolTip(tr("View and Send Encrypted messages"));
messageAction->setCheckable(true);
tabGroup->addAction(messageAction);
blockAction = new QAction(QIcon(":/icons/block"), tr("&Block Explorer"), this);
blockAction->setToolTip(tr("Explore the BlockChain"));
blockAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));
blockAction->setCheckable(true);
tabGroup->addAction(blockAction);
TradingAction = new QAction(QIcon(":/icons/trade"), tr("&Bittrex"), this);
TradingAction ->setToolTip(tr("Start Trading"));
TradingAction ->setCheckable(true);
TradingAction ->setShortcut(QKeySequence(Qt::ALT + Qt::Key_8));
TradingAction->setProperty("objectName","TradingAction");
tabGroup->addAction(TradingAction);
showBackupsAction = new QAction(QIcon(":/icons/browse"), tr("Show Auto&Backups"), this);
showBackupsAction->setStatusTip(tr("S"));
connect(TradingAction, SIGNAL(triggered()), this, SLOT(gotoTradingPage()));
connect(blockAction, SIGNAL(triggered()), this, SLOT(gotoBlockBrowser()));
connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage()));
connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage()));
connect(masternodeManagerAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(masternodeManagerAction, SIGNAL(triggered()), this, SLOT(gotoMasternodeManagerPage()));
connect(messageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(messageAction, SIGNAL(triggered()), this, SLOT(gotoMessagePage()));
quitAction = new QAction(tr("E&xit"), this);
quitAction->setToolTip(tr("Quit application"));
quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
quitAction->setMenuRole(QAction::QuitRole);
aboutAction = new QAction(tr("&About MasternodeXchange"), this);
aboutAction->setToolTip(tr("Show information about MasternodeXchange"));
aboutAction->setMenuRole(QAction::AboutRole);
aboutQtAction = new QAction(tr("About &Qt"), this);
aboutQtAction->setToolTip(tr("Show information about Qt"));
aboutQtAction->setMenuRole(QAction::AboutQtRole);
optionsAction = new QAction(tr("&Options..."), this);
optionsAction->setToolTip(tr("Modify configuration options for MasternodeXchange"));
optionsAction->setMenuRole(QAction::PreferencesRole);
toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this);
encryptWalletAction = new QAction(tr("&Encrypt Wallet..."), this);
encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet"));
backupWalletAction = new QAction(tr("&Backup Wallet..."), this);
backupWalletAction->setToolTip(tr("Backup wallet to another location"));
changePassphraseAction = new QAction(tr("&Change Passphrase..."), this);
changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption"));
unlockWalletAction = new QAction(tr("&Unlock Wallet..."), this);
unlockWalletAction->setToolTip(tr("Unlock wallet"));
lockWalletAction = new QAction(tr("&Lock Wallet"), this);
lockWalletAction->setToolTip(tr("Lock wallet"));
signMessageAction = new QAction(tr("Sign &message..."), this);
verifyMessageAction = new QAction(tr("&Verify message..."), this);
exportAction = new QAction(tr("&Export..."), this);
exportAction->setToolTip(tr("Export the data in the current tab to a file"));
openRPCConsoleAction = new QAction(tr("&Debug window"), this);
openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console"));
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));
connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden()));
connect(encryptWalletAction, SIGNAL(triggered()), this, SLOT(encryptWallet()));
connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet()));
connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase()));
connect(unlockWalletAction, SIGNAL(triggered()), this, SLOT(unlockWallet()));
connect(lockWalletAction, SIGNAL(triggered()), this, SLOT(lockWallet()));
connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab()));
connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab()));
}
void BitcoinGUI::createMenuBar()
{
#ifdef Q_OS_MAC
appMenuBar = new QMenuBar();
#else
appMenuBar = menuBar();
#endif
// Configure the menus
QMenu *file = appMenuBar->addMenu(tr("&File"));
file->addAction(backupWalletAction);
file->addAction(exportAction);
file->addAction(signMessageAction);
file->addAction(verifyMessageAction);
file->addSeparator();
file->addAction(quitAction);
QMenu *settings = appMenuBar->addMenu(tr("&Settings"));
settings->addAction(encryptWalletAction);
settings->addAction(changePassphraseAction);
settings->addAction(unlockWalletAction);
settings->addAction(lockWalletAction);
settings->addSeparator();
settings->addAction(optionsAction);
settings->addAction(showBackupsAction);
QMenu *help = appMenuBar->addMenu(tr("&Help"));
help->addAction(openRPCConsoleAction);
help->addSeparator();
help->addAction(aboutAction);
help->addAction(aboutQtAction);
}
static QWidget* makeToolBarSpacer()
{
QWidget* spacer = new QWidget();
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
spacer->setStyleSheet("QWidget { background: none; }");
return spacer;
}
void BitcoinGUI::createToolBars()
{
fLiteMode = GetBoolArg("-litemode", false);
toolbar = new QToolBar(tr("Tabs toolbar"));
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
toolbar->setObjectName("tabs");
toolbar->setStyleSheet("QToolButton { color: #505050; font-weight:bold;} QToolButton:hover { background-color: #909090 } QToolButton:checked { background-color: #f1f1f1 } QToolButton:pressed { background-color: #101010 } #tabs { color: #505050; background-color: #ffffff; }");
toolbar->setIconSize(QSize(24,24));
QLabel* header = new QLabel();
header->setMinimumSize(142, 142);
header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
header->setPixmap(QPixmap(":/images/header"));
header->setMaximumSize(142,142);
header->setScaledContents(true);
toolbar->addWidget(header);
toolbar->addAction(overviewAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
toolbar->addAction(masternodeManagerAction);
if (!fLiteMode){
toolbar->addAction(messageAction);
}
toolbar->addAction(blockAction);
toolbar->addAction(TradingAction);
netLabel = new QLabel();
QWidget *spacer = makeToolBarSpacer();
netLabel->setObjectName("netLabel");
netLabel->setStyleSheet("#netLabel { color: #efefef; }");
toolbar->addWidget(spacer);
toolbar->setOrientation(Qt::Vertical);
toolbar->setMovable(false);
addToolBar(Qt::LeftToolBarArea, toolbar);
foreach(QAction *action, toolbar->actions()) {
toolbar->widgetForAction(action)->setFixedWidth(142);
}
}
void BitcoinGUI::setClientModel(ClientModel *clientModel)
{
if(!fOnlyTor)
netLabel->setText("CLEARNET");
else
{
if(!IsLimited(NET_TOR))
{
netLabel->setText("TOR");
}
}
this->clientModel = clientModel;
if(clientModel)
{
// Replace some strings and icons, when using the testnet
if(clientModel->isTestNet())
{
setWindowTitle(windowTitle() + QString(" ") + tr("[testnet]"));
#ifndef Q_OS_MAC
qApp->setWindowIcon(QIcon(":icons/bitcoin_testnet"));
setWindowIcon(QIcon(":icons/bitcoin_testnet"));
#else
MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet"));
#endif
if(trayIcon)
{
trayIcon->setToolTip(tr("MasternodeXchange client") + QString(" ") + tr("[testnet]"));
trayIcon->setIcon(QIcon(":/icons/toolbar_testnet"));
toggleHideAction->setIcon(QIcon(":/icons/toolbar_testnet"));
}
}
// Keep up to date with client
setNumConnections(clientModel->getNumConnections());
connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
setNumBlocks(clientModel->getNumBlocks());
connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(setNumBlocks(int)));
// Receive and report messages from network/worker thread
connect(clientModel, SIGNAL(message(QString,QString,bool,unsigned int)), this, SLOT(message(QString,QString,bool,unsigned int)));
// Show progress dialog
connect(clientModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int)));
connect(walletModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int)));
overviewPage->setClientModel(clientModel);
rpcConsole->setClientModel(clientModel);
addressBookPage->setOptionsModel(clientModel->getOptionsModel());
receiveCoinsPage->setOptionsModel(clientModel->getOptionsModel());
}
}
void BitcoinGUI::setWalletModel(WalletModel *walletModel)
{
this->walletModel = walletModel;
if(walletModel)
{
// Receive and report messages from wallet thread
connect(walletModel, SIGNAL(message(QString,QString,bool,unsigned int)), this, SLOT(message(QString,QString,bool,unsigned int)));
connect(sendCoinsPage, SIGNAL(message(QString,QString,bool,unsigned int)), this, SLOT(message(QString,QString,bool,unsigned int)));
// Put transaction list in tabs
transactionView->setModel(walletModel);
overviewPage->setWalletModel(walletModel);
addressBookPage->setModel(walletModel->getAddressTableModel());
receiveCoinsPage->setModel(walletModel->getAddressTableModel());
sendCoinsPage->setModel(walletModel);
signVerifyMessageDialog->setModel(walletModel);
blockBrowser->setModel(walletModel);
tradingDialogPage->setModel(walletModel);
setEncryptionStatus(walletModel->getEncryptionStatus());
connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SLOT(setEncryptionStatus(int)));
// Balloon pop-up for new transaction
connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(incomingTransaction(QModelIndex,int,int)));
// Ask for passphrase if needed
connect(walletModel, SIGNAL(requireUnlock()), this, SLOT(unlockWallet()));
}
}
void BitcoinGUI::setMessageModel(MessageModel *messageModel)
{
this->messageModel = messageModel;
if(messageModel)
{
// Report errors from message thread
connect(messageModel, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool)));
// Put transaction list in tabs
messagePage->setModel(messageModel);
// Balloon pop-up for new message
connect(messageModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(incomingMessage(QModelIndex,int,int)));
}
}
void BitcoinGUI::createTrayIcon()
{
QMenu *trayIconMenu;
#ifndef Q_OS_MAC
trayIcon = new QSystemTrayIcon(this);
trayIconMenu = new QMenu(this);
trayIcon->setContextMenu(trayIconMenu);
trayIcon->setToolTip(tr("MasternodeXchange client"));
trayIcon->setIcon(QIcon(":/icons/toolbar"));
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason)));
trayIcon->show();
#else
// Note: On Mac, the dock icon is used to provide the tray's functionality.
MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance();
dockIconHandler->setMainWindow((QMainWindow *)this);
trayIconMenu = dockIconHandler->dockMenu();
#endif
// Configuration of the tray icon (or dock icon) icon menu
trayIconMenu->addAction(toggleHideAction);
trayIconMenu->addSeparator();
trayIconMenu->addAction(receiveCoinsAction);
trayIconMenu->addAction(sendCoinsAction);
trayIconMenu->addSeparator();
trayIconMenu->addAction(signMessageAction);
trayIconMenu->addAction(verifyMessageAction);
trayIconMenu->addSeparator();
trayIconMenu->addAction(optionsAction);
trayIconMenu->addAction(openRPCConsoleAction);
trayIconMenu->addAction(showBackupsAction);
#ifndef Q_OS_MAC // This is built-in on Mac
trayIconMenu->addSeparator();
trayIconMenu->addAction(quitAction);
#endif
notificator = new Notificator(qApp->applicationName(), trayIcon);
}
#ifndef Q_OS_MAC
void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
{
if(reason == QSystemTrayIcon::Trigger)
{
// Click on system tray icon triggers show/hide of the main window
toggleHideAction->trigger();
}
}
#endif
void BitcoinGUI::optionsClicked()
{
if(!clientModel || !clientModel->getOptionsModel())
return;
OptionsDialog dlg;
dlg.setModel(clientModel->getOptionsModel());
dlg.exec();
}
void BitcoinGUI::aboutClicked()
{
AboutDialog dlg;
dlg.setModel(clientModel);
dlg.exec();
}
void BitcoinGUI::setNumConnections(int count)
{
QString icon;
switch(count)
{
case 0: icon = fUseBlackTheme ? ":/icons/black/connect_0" : ":/icons/connect_0"; break;
case 1: case 2: case 3: icon = fUseBlackTheme ? ":/icons/black/connect_1" : ":/icons/connect_1"; break;
case 4: case 5: case 6: icon = fUseBlackTheme ? ":/icons/black/connect_2" : ":/icons/connect_2"; break;
case 7: case 8: case 9: icon = fUseBlackTheme ? ":/icons/black/connect_3" : ":/icons/connect_3"; break;
default: icon = fUseBlackTheme ? ":/icons/black/connect_4" : ":/icons/connect_4"; break;
}
labelConnectionsIcon->setPixmap(QIcon(icon).pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelConnectionsIcon->setToolTip(tr("%n active connection(s) to MasternodeXchange network", "", count));
}
void BitcoinGUI::setNumBlocks(int count)
{
QString tooltip;
QDateTime lastBlockDate = clientModel->getLastBlockDate();
QDateTime currentDate = QDateTime::currentDateTime();
int totalSecs = GetTime() - Params().GenesisBlock().GetBlockTime();
int secs = lastBlockDate.secsTo(currentDate);
tooltip = tr("Processed %1 blocks of transaction history.").arg(count);
// Set icon state: spinning if catching up, tick otherwise
if(secs < 90*60)
{
tooltip = tr("Up to date") + QString(".<br>") + tooltip;
labelBlocksIcon->setPixmap(QIcon(fUseBlackTheme ? ":/icons/black/synced" : ":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
overviewPage->showOutOfSyncWarning(false);
progressBarLabel->setVisible(false);
progressBar->setVisible(false);
}
else
{
// Represent time from last generated block in human readable text
QString timeBehindText;
const int HOUR_IN_SECONDS = 60*60;
const int DAY_IN_SECONDS = 24*60*60;
const int WEEK_IN_SECONDS = 7*24*60*60;
const int YEAR_IN_SECONDS = 31556952; // Average length of year in Gregorian calendar
if(secs < 2*DAY_IN_SECONDS)
{
timeBehindText = tr("%n hour(s)","",secs/HOUR_IN_SECONDS);
}
else if(secs < 2*WEEK_IN_SECONDS)
{
timeBehindText = tr("%n day(s)","",secs/DAY_IN_SECONDS);
}
else if(secs < YEAR_IN_SECONDS)
{
timeBehindText = tr("%n week(s)","",secs/WEEK_IN_SECONDS);
}
else
{
int years = secs / YEAR_IN_SECONDS;
int remainder = secs % YEAR_IN_SECONDS;
timeBehindText = tr("%1 and %2").arg(tr("%n year(s)", "", years)).arg(tr("%n week(s)","", remainder/WEEK_IN_SECONDS));
}
progressBarLabel->setText(tr(clientModel->isImporting() ? "Importing blocks..." : "Synchronizing with network..."));
progressBarLabel->setVisible(true);
progressBarLabel->setStyleSheet("QLabel { color: #ffffff; }");
progressBar->setFormat(tr("%1 behind").arg(timeBehindText));
progressBar->setMaximum(totalSecs);
progressBar->setValue(totalSecs - secs);
progressBar->setVisible(true);
tooltip = tr("Catching up...") + QString("<br>") + tooltip;
labelBlocksIcon->setMovie(syncIconMovie);
if(count != prevBlocks)
syncIconMovie->jumpToNextFrame();
prevBlocks = count;
overviewPage->showOutOfSyncWarning(true);
tooltip += QString("<br>");
tooltip += tr("Last received block was generated %1 ago.").arg(timeBehindText);
tooltip += QString("<br>");
tooltip += tr("Transactions after this will not yet be visible.");
}
// Don't word-wrap this (fixed-width) tooltip
tooltip = QString("<nobr>") + tooltip + QString("</nobr>");
labelBlocksIcon->setToolTip(tooltip);
progressBarLabel->setToolTip(tooltip);
progressBar->setToolTip(tooltip);
statusBar()->setVisible(true);
}
void BitcoinGUI::message(const QString &title, const QString &message, bool modal, unsigned int style)
{
QString strTitle = tr("MasternodeXchange") + " - ";
// Default to information icon
int nMBoxIcon = QMessageBox::Information;
int nNotifyIcon = Notificator::Information;
// Check for usage of predefined title
switch (style) {
case CClientUIInterface::MSG_ERROR:
strTitle += tr("Error");
break;
case CClientUIInterface::MSG_WARNING:
strTitle += tr("Warning");
break;
case CClientUIInterface::MSG_INFORMATION:
strTitle += tr("Information");
break;
default:
strTitle += title; // Use supplied title
}
// Check for error/warning icon
if (style & CClientUIInterface::ICON_ERROR) {
nMBoxIcon = QMessageBox::Critical;
nNotifyIcon = Notificator::Critical;
}
else if (style & CClientUIInterface::ICON_WARNING) {
nMBoxIcon = QMessageBox::Warning;
nNotifyIcon = Notificator::Warning;
}
// Display message
if (modal) {
// Check for buttons, use OK as default, if none was supplied
QMessageBox::StandardButton buttons;
if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK)))
buttons = QMessageBox::Ok;
QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons);
mBox.exec();
}
else
notificator->notify((Notificator::Class)nNotifyIcon, strTitle, message);
}
void BitcoinGUI::error(const QString &title, const QString &message, bool modal)
{
// Report errors from network/worker thread
if(modal)
{
QMessageBox::critical(this, title, message, QMessageBox::Ok, QMessageBox::Ok);
} else {
notificator->notify(Notificator::Critical, title, message);
}
}
void BitcoinGUI::changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);
#ifndef Q_OS_MAC // Ignored on Mac
if(e->type() == QEvent::WindowStateChange)
{
if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray())
{
QWindowStateChangeEvent *wsevt = static_cast<QWindowStateChangeEvent*>(e);
if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized())
{
QTimer::singleShot(0, this, SLOT(hide()));
e->ignore();
}
}
}
#endif
}
void BitcoinGUI::closeEvent(QCloseEvent *event)
{
if(clientModel)
{
#ifndef Q_OS_MAC // Ignored on Mac
if(!clientModel->getOptionsModel()->getMinimizeToTray() &&
!clientModel->getOptionsModel()->getMinimizeOnClose())
{
qApp->quit();
}
#endif
}
QMainWindow::closeEvent(event);
}
void BitcoinGUI::askFee(qint64 nFeeRequired, bool *payFee)
{
if (!clientModel || !clientModel->getOptionsModel())
return;
QString strMessage = tr("This transaction is over the size limit. You can still send it for a fee of %1, "
"which goes to the nodes that process your transaction and helps to support the network. "
"Do you want to pay the fee?").arg(BitcoinUnits::formatWithUnit(clientModel->getOptionsModel()->getDisplayUnit(), nFeeRequired));
QMessageBox::StandardButton retval = QMessageBox::question(
this, tr("Confirm transaction fee"), strMessage,
QMessageBox::Yes|QMessageBox::Cancel, QMessageBox::Yes);
*payFee = (retval == QMessageBox::Yes);
}
void BitcoinGUI::incomingTransaction(const QModelIndex & parent, int start, int end)
{
// Prevent balloon-spam when initial block download is in progress
if(!walletModel || !clientModel || clientModel->inInitialBlockDownload() || walletModel->processingQueuedTransactions())
return;
TransactionTableModel *ttm = walletModel->getTransactionTableModel();
qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent)
.data(Qt::EditRole).toULongLong();
QString date = ttm->index(start, TransactionTableModel::Date, parent)
.data().toString();
QString type = ttm->index(start, TransactionTableModel::Type, parent)
.data().toString();
QString address = ttm->index(start, TransactionTableModel::ToAddress, parent)
.data().toString();
QIcon icon = qvariant_cast<QIcon>(ttm->index(start,
TransactionTableModel::ToAddress, parent)
.data(Qt::DecorationRole));
// On new transaction, make an info balloon
notificator->notify(Notificator::Information,
(amount)<0 ? tr("Sent transaction") :
tr("Incoming transaction"),
tr("Date: %1\n"
"Amount: %2\n"
"Type: %3\n"
"Address: %4\n")
.arg(date)
.arg(BitcoinUnits::formatWithUnit(walletModel->getOptionsModel()->getDisplayUnit(), amount, true))
.arg(type)
.arg(address), icon);
}
void BitcoinGUI::incomingMessage(const QModelIndex & parent, int start, int end)
{
if(!messageModel)
return;
MessageModel *mm = messageModel;
if (mm->index(start, MessageModel::TypeInt, parent).data().toInt() == MessageTableEntry::Received)
{
QString sent_datetime = mm->index(start, MessageModel::ReceivedDateTime, parent).data().toString();
QString from_address = mm->index(start, MessageModel::FromAddress, parent).data().toString();
QString to_address = mm->index(start, MessageModel::ToAddress, parent).data().toString();
QString message = mm->index(start, MessageModel::Message, parent).data().toString();
QTextDocument html;
html.setHtml(message);
QString messageText(html.toPlainText());
notificator->notify(Notificator::Information,
tr("Incoming Message"),
tr("Date: %1\n"
"From Address: %2\n"
"To Address: %3\n"
"Message: %4\n")
.arg(sent_datetime)
.arg(from_address)
.arg(to_address)
.arg(messageText));
};
}
void BitcoinGUI::clearWidgets()
{
centralStackedWidget->setCurrentWidget(centralStackedWidget->widget(0));
for(int i = centralStackedWidget->count(); i>0; i--){
QWidget* widget = centralStackedWidget->widget(i);
centralStackedWidget->removeWidget(widget);
widget->deleteLater();
}
}
void BitcoinGUI::gotoMasternodeManagerPage()
{
masternodeManagerAction->setChecked(true);
centralStackedWidget->setCurrentWidget(masternodeManagerPage);
exportAction->setEnabled(false);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
}
void BitcoinGUI::gotoBlockBrowser()
{
blockAction->setChecked(true);
centralStackedWidget->setCurrentWidget(blockBrowser);
exportAction->setEnabled(false);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
}
void BitcoinGUI::gotoOverviewPage()
{
overviewAction->setChecked(true);
centralStackedWidget->setCurrentWidget(overviewPage);
exportAction->setEnabled(false);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
}
void BitcoinGUI::gotoHistoryPage()
{
historyAction->setChecked(true);
centralStackedWidget->setCurrentWidget(transactionsPage);
exportAction->setEnabled(true);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
connect(exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked()));
}
void BitcoinGUI::gotoAddressBookPage()
{
addressBookAction->setChecked(true);
centralStackedWidget->setCurrentWidget(addressBookPage);
exportAction->setEnabled(true);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
connect(exportAction, SIGNAL(triggered()), addressBookPage, SLOT(exportClicked()));
}
void BitcoinGUI::gotoTradingPage()
{
TradingAction->setChecked(true);
centralStackedWidget->setCurrentWidget(tradingDialogPage);
// exportAction->setEnabled(false);
// disconnect(exportAction, SIGNAL(triggered()), 0, 0);
}
void BitcoinGUI::gotoReceiveCoinsPage()
{
receiveCoinsAction->setChecked(true);
centralStackedWidget->setCurrentWidget(receiveCoinsPage);
exportAction->setEnabled(true);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
connect(exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked()));
}
void BitcoinGUI::gotoSendCoinsPage()
{
sendCoinsAction->setChecked(true);
centralStackedWidget->setCurrentWidget(sendCoinsPage);
exportAction->setEnabled(false);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
}
void BitcoinGUI::gotoSignMessageTab(QString addr)
{
// call show() in showTab_SM()
signVerifyMessageDialog->showTab_SM(true);
if(!addr.isEmpty())
signVerifyMessageDialog->setAddress_SM(addr);
}
void BitcoinGUI::gotoVerifyMessageTab(QString addr)
{
// call show() in showTab_VM()
signVerifyMessageDialog->showTab_VM(true);
if(!addr.isEmpty())
signVerifyMessageDialog->setAddress_VM(addr);
}
void BitcoinGUI::gotoMessagePage()
{
messageAction->setChecked(true);
centralStackedWidget->setCurrentWidget(messagePage);
exportAction->setEnabled(true);
disconnect(exportAction, SIGNAL(triggered()), 0, 0);
connect(exportAction, SIGNAL(triggered()), messagePage, SLOT(exportClicked()));
}
void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event)
{
// Accept only URIs
if(event->mimeData()->hasUrls())
event->acceptProposedAction();
}
void BitcoinGUI::dropEvent(QDropEvent *event)
{
if(event->mimeData()->hasUrls())
{
int nValidUrisFound = 0;
QList<QUrl> uris = event->mimeData()->urls();
foreach(const QUrl &uri, uris)
{
if (sendCoinsPage->handleURI(uri.toString()))
nValidUrisFound++;
}
// if valid URIs were found
if (nValidUrisFound)
gotoSendCoinsPage();
else
notificator->notify(Notificator::Warning, tr("URI handling"), tr("URI can not be parsed! This can be caused by an invalid MasternodeXchange address or malformed URI parameters."));
}
event->acceptProposedAction();
}
void BitcoinGUI::handleURI(QString strURI)
{
// URI has to be valid
if (sendCoinsPage->handleURI(strURI))
{
showNormalIfMinimized();
gotoSendCoinsPage();
}
else
notificator->notify(Notificator::Warning, tr("URI handling"), tr("URI can not be parsed! This can be caused by an invalid MasternodeXchange address or malformed URI parameters."));
}
void BitcoinGUI::setEncryptionStatus(int status)
{
if(fWalletUnlockStakingOnly)
{
labelEncryptionIcon->setPixmap(QIcon(fUseBlackTheme ? ":/icons/black/lock_open" : ":/icons/lock_open").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked for staking only</b>"));
changePassphraseAction->setEnabled(false);
unlockWalletAction->setVisible(true);
lockWalletAction->setVisible(true);
encryptWalletAction->setEnabled(false);
}
else
{
switch(status)
{
case WalletModel::Unencrypted:
labelEncryptionIcon->setPixmap(QIcon(fUseBlackTheme ? ":/icons/black/lock_open" : ":/icons/lock_open").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelEncryptionIcon->setToolTip(tr("Wallet is <b>not encrypted</b>"));
changePassphraseAction->setEnabled(false);
unlockWalletAction->setVisible(false);
lockWalletAction->setVisible(false);
encryptWalletAction->setEnabled(true);
break;
case WalletModel::Unlocked:
labelEncryptionIcon->setPixmap(QIcon(fUseBlackTheme ? ":/icons/black/lock_open" : ":/icons/lock_open").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
changePassphraseAction->setEnabled(true);
unlockWalletAction->setVisible(false);
lockWalletAction->setVisible(true);
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
break;
case WalletModel::Locked:
labelEncryptionIcon->setPixmap(QIcon(fUseBlackTheme ? ":/icons/black/lock_closed" : ":/icons/lock_closed").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>locked</b>"));
changePassphraseAction->setEnabled(true);
unlockWalletAction->setVisible(true);
lockWalletAction->setVisible(false);
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
break;
}
}
}
void BitcoinGUI::encryptWallet()
{
if(!walletModel)
return;
AskPassphraseDialog dlg(AskPassphraseDialog::Encrypt, this);
dlg.setModel(walletModel);
dlg.exec();
setEncryptionStatus(walletModel->getEncryptionStatus());
}
void BitcoinGUI::backupWallet()
{
QString saveDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
QString filename = QFileDialog::getSaveFileName(this, tr("Backup Wallet"), saveDir, tr("Wallet Data (*.dat)"));
if(!filename.isEmpty()) {
if(!walletModel->backupWallet(filename)) {
QMessageBox::warning(this, tr("Backup Failed"), tr("There was an error trying to save the wallet data to the new location."));
}
}
}
void BitcoinGUI::changePassphrase()
{
AskPassphraseDialog dlg(AskPassphraseDialog::ChangePass, this);
dlg.setModel(walletModel);
dlg.exec();
}
void BitcoinGUI::unlockWallet()
{
if(!walletModel)
return;
// Unlock wallet when requested by wallet model
if(walletModel->getEncryptionStatus() == WalletModel::Locked)
{
AskPassphraseDialog::Mode mode = sender() == unlockWalletAction ?
AskPassphraseDialog::UnlockStaking : AskPassphraseDialog::Unlock;
AskPassphraseDialog dlg(mode, this);
dlg.setModel(walletModel);
dlg.exec();
}
}
void BitcoinGUI::lockWallet()
{
if(!walletModel)
return;
walletModel->setWalletLocked(true);
}
void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)
{
// activateWindow() (sometimes) helps with keyboard focus on Windows
if (isHidden())
{
show();
activateWindow();
}
else if (isMinimized())
{
showNormal();
activateWindow();
}
else if (GUIUtil::isObscured(this))
{
raise();
activateWindow();
}
else if(fToggleHidden)
hide();
}
void BitcoinGUI::toggleHidden()
{
showNormalIfMinimized(true);
}
void BitcoinGUI::updateWeight()
{
if (!pwalletMain)
return;
TRY_LOCK(cs_main, lockMain);
if (!lockMain)
return;
TRY_LOCK(pwalletMain->cs_wallet, lockWallet);
if (!lockWallet)
return;
nWeight = pwalletMain->GetStakeWeight();
}
void BitcoinGUI::updateStakingIcon()
{
updateWeight();
if (nLastCoinStakeSearchInterval && nWeight)
{
uint64_t nWeight = this->nWeight;
uint64_t nNetworkWeight = GetPoSKernelPS();
unsigned nEstimateTime = 0;
nEstimateTime = GetTargetSpacing * nNetworkWeight / nWeight;
QString text;
if (nEstimateTime < 60)
{
text = tr("%n second(s)", "", nEstimateTime);
}
else if (nEstimateTime < 60*60)
{
text = tr("%n minute(s)", "", nEstimateTime/60);
}
else if (nEstimateTime < 24*60*60)
{
text = tr("%n hour(s)", "", nEstimateTime/(60*60));
}
else
{
text = tr("%n day(s)", "", nEstimateTime/(60*60*24));
}
nWeight /= COIN;
nNetworkWeight /= COIN;
labelStakingIcon->setPixmap(QIcon(fUseBlackTheme ? ":/icons/black/staking_on" : ":/icons/staking_on").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelStakingIcon->setToolTip(tr("Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3").arg(nWeight).arg(nNetworkWeight).arg(text));
}
else
{
labelStakingIcon->setPixmap(QIcon(fUseBlackTheme ? ":/icons/black/staking_off" : ":/icons/staking_off").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
if (pwalletMain && pwalletMain->IsLocked())
labelStakingIcon->setToolTip(tr("Not staking because wallet is locked"));
else if (vNodes.empty())
labelStakingIcon->setToolTip(tr("Not staking because wallet is offline"));
else if (IsInitialBlockDownload())
labelStakingIcon->setToolTip(tr("Not staking because wallet is syncing"));
else if (!nWeight)
labelStakingIcon->setToolTip(tr("Not staking because you don't have mature coins"));
else
labelStakingIcon->setToolTip(tr("Not staking"));
}
}
void BitcoinGUI::detectShutdown()
{
if (ShutdownRequested())
QMetaObject::invokeMethod(QCoreApplication::instance(), "quit", Qt::QueuedConnection);
}
void BitcoinGUI::showProgress(const QString &title, int nProgress)
{
if (nProgress == 0)
{
progressDialog = new QProgressDialog(title, "", 0, 100);
progressDialog->setWindowModality(Qt::ApplicationModal);
progressDialog->setMinimumDuration(0);
progressDialog->setCancelButton(0);
progressDialog->setAutoClose(false);
progressDialog->setValue(0);
}
else if (nProgress == 100)
{
if (progressDialog)
{
progressDialog->close();
progressDialog->deleteLater();
}
}
else if (progressDialog)
progressDialog->setValue(nProgress);
}
| [
"mnxchane@gmail.com"
] | mnxchane@gmail.com |
5e91107b3cc3f3ef50874ae2d279a53d8aa1d8d0 | 7e206171aff10918b71adf2ed7c85d68558d6b39 | /examples/ME/W_4j/P0_Sigma_sm_ds_mumvmxusssx_W_4j.cc | 6aa5029b39e32cb26c9725cc9ac1f21b3308ba48 | [] | no_license | matt-komm/momenta | 934d62f407abcce25e7c813c0ae9002d308f09cf | c52c63fad5ab38dc54e71636f3182d5fbcd308bc | refs/heads/master | 2021-01-01T05:31:11.499532 | 2014-04-01T20:01:29 | 2014-04-01T20:01:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 21,475 | cc | //==========================================================================
// This file has been automatically generated for C++ Standalone by
// MadGraph 5 v. 2.0.0.beta3, 2013-02-14
// By the MadGraph Development Team
// Please visit us at https://launchpad.net/madgraph5
//==========================================================================
#include "P0_Sigma_sm_ds_mumvmxusssx_W_4j.h"
#include "HelAmps_sm.h"
using namespace MG5_sm;
//==========================================================================
// Class member functions for calculating the matrix elements for
// Process: d s > w- u s s s~ WEIGHTED=6
// * Decay: w- > mu- vm~ WEIGHTED=2
//--------------------------------------------------------------------------
// Initialize process.
void P0_Sigma_sm_ds_mumvmxusssx_W_4j::initProc(string param_card_name)
{
// Instantiate the model class and set parameters that stay fixed during run
pars = Parameters_sm::getInstance();
SLHAReader slha(param_card_name);
pars->setIndependentParameters(slha);
pars->setIndependentCouplings();
pars->printIndependentParameters();
pars->printIndependentCouplings();
// Set external particle masses for this matrix element
mME.push_back(pars->ZERO);
mME.push_back(pars->ZERO);
mME.push_back(pars->ZERO);
mME.push_back(pars->ZERO);
mME.push_back(pars->ZERO);
mME.push_back(pars->ZERO);
mME.push_back(pars->ZERO);
mME.push_back(pars->ZERO);
jamp2[0] = new double[6];
}
//--------------------------------------------------------------------------
// Evaluate |M|^2, part independent of incoming flavour.
void P0_Sigma_sm_ds_mumvmxusssx_W_4j::sigmaKin()
{
// Set the parameters which change event by event
pars->setDependentParameters();
pars->setDependentCouplings();
static bool firsttime = true;
if (firsttime)
{
pars->printDependentParameters();
pars->printDependentCouplings();
firsttime = false;
}
// Reset color flows
for(int i = 0; i < 6; i++ )
jamp2[0][i] = 0.;
// Local variables and constants
const int ncomb = 256;
static bool goodhel[ncomb] = {ncomb * false};
static int ntry = 0, sum_hel = 0, ngood = 0;
static int igood[ncomb];
static int jhel;
std::complex<double> * * wfs;
double t[nprocesses];
// Helicities for the process
static const int helicities[ncomb][nexternal] = {{-1, -1, -1, -1, -1, -1, -1,
-1}, {-1, -1, -1, -1, -1, -1, -1, 1}, {-1, -1, -1, -1, -1, -1, 1, -1},
{-1, -1, -1, -1, -1, -1, 1, 1}, {-1, -1, -1, -1, -1, 1, -1, -1}, {-1, -1,
-1, -1, -1, 1, -1, 1}, {-1, -1, -1, -1, -1, 1, 1, -1}, {-1, -1, -1, -1,
-1, 1, 1, 1}, {-1, -1, -1, -1, 1, -1, -1, -1}, {-1, -1, -1, -1, 1, -1,
-1, 1}, {-1, -1, -1, -1, 1, -1, 1, -1}, {-1, -1, -1, -1, 1, -1, 1, 1},
{-1, -1, -1, -1, 1, 1, -1, -1}, {-1, -1, -1, -1, 1, 1, -1, 1}, {-1, -1,
-1, -1, 1, 1, 1, -1}, {-1, -1, -1, -1, 1, 1, 1, 1}, {-1, -1, -1, 1, -1,
-1, -1, -1}, {-1, -1, -1, 1, -1, -1, -1, 1}, {-1, -1, -1, 1, -1, -1, 1,
-1}, {-1, -1, -1, 1, -1, -1, 1, 1}, {-1, -1, -1, 1, -1, 1, -1, -1}, {-1,
-1, -1, 1, -1, 1, -1, 1}, {-1, -1, -1, 1, -1, 1, 1, -1}, {-1, -1, -1, 1,
-1, 1, 1, 1}, {-1, -1, -1, 1, 1, -1, -1, -1}, {-1, -1, -1, 1, 1, -1, -1,
1}, {-1, -1, -1, 1, 1, -1, 1, -1}, {-1, -1, -1, 1, 1, -1, 1, 1}, {-1, -1,
-1, 1, 1, 1, -1, -1}, {-1, -1, -1, 1, 1, 1, -1, 1}, {-1, -1, -1, 1, 1, 1,
1, -1}, {-1, -1, -1, 1, 1, 1, 1, 1}, {-1, -1, 1, -1, -1, -1, -1, -1},
{-1, -1, 1, -1, -1, -1, -1, 1}, {-1, -1, 1, -1, -1, -1, 1, -1}, {-1, -1,
1, -1, -1, -1, 1, 1}, {-1, -1, 1, -1, -1, 1, -1, -1}, {-1, -1, 1, -1, -1,
1, -1, 1}, {-1, -1, 1, -1, -1, 1, 1, -1}, {-1, -1, 1, -1, -1, 1, 1, 1},
{-1, -1, 1, -1, 1, -1, -1, -1}, {-1, -1, 1, -1, 1, -1, -1, 1}, {-1, -1,
1, -1, 1, -1, 1, -1}, {-1, -1, 1, -1, 1, -1, 1, 1}, {-1, -1, 1, -1, 1, 1,
-1, -1}, {-1, -1, 1, -1, 1, 1, -1, 1}, {-1, -1, 1, -1, 1, 1, 1, -1}, {-1,
-1, 1, -1, 1, 1, 1, 1}, {-1, -1, 1, 1, -1, -1, -1, -1}, {-1, -1, 1, 1,
-1, -1, -1, 1}, {-1, -1, 1, 1, -1, -1, 1, -1}, {-1, -1, 1, 1, -1, -1, 1,
1}, {-1, -1, 1, 1, -1, 1, -1, -1}, {-1, -1, 1, 1, -1, 1, -1, 1}, {-1, -1,
1, 1, -1, 1, 1, -1}, {-1, -1, 1, 1, -1, 1, 1, 1}, {-1, -1, 1, 1, 1, -1,
-1, -1}, {-1, -1, 1, 1, 1, -1, -1, 1}, {-1, -1, 1, 1, 1, -1, 1, -1}, {-1,
-1, 1, 1, 1, -1, 1, 1}, {-1, -1, 1, 1, 1, 1, -1, -1}, {-1, -1, 1, 1, 1,
1, -1, 1}, {-1, -1, 1, 1, 1, 1, 1, -1}, {-1, -1, 1, 1, 1, 1, 1, 1}, {-1,
1, -1, -1, -1, -1, -1, -1}, {-1, 1, -1, -1, -1, -1, -1, 1}, {-1, 1, -1,
-1, -1, -1, 1, -1}, {-1, 1, -1, -1, -1, -1, 1, 1}, {-1, 1, -1, -1, -1, 1,
-1, -1}, {-1, 1, -1, -1, -1, 1, -1, 1}, {-1, 1, -1, -1, -1, 1, 1, -1},
{-1, 1, -1, -1, -1, 1, 1, 1}, {-1, 1, -1, -1, 1, -1, -1, -1}, {-1, 1, -1,
-1, 1, -1, -1, 1}, {-1, 1, -1, -1, 1, -1, 1, -1}, {-1, 1, -1, -1, 1, -1,
1, 1}, {-1, 1, -1, -1, 1, 1, -1, -1}, {-1, 1, -1, -1, 1, 1, -1, 1}, {-1,
1, -1, -1, 1, 1, 1, -1}, {-1, 1, -1, -1, 1, 1, 1, 1}, {-1, 1, -1, 1, -1,
-1, -1, -1}, {-1, 1, -1, 1, -1, -1, -1, 1}, {-1, 1, -1, 1, -1, -1, 1,
-1}, {-1, 1, -1, 1, -1, -1, 1, 1}, {-1, 1, -1, 1, -1, 1, -1, -1}, {-1, 1,
-1, 1, -1, 1, -1, 1}, {-1, 1, -1, 1, -1, 1, 1, -1}, {-1, 1, -1, 1, -1, 1,
1, 1}, {-1, 1, -1, 1, 1, -1, -1, -1}, {-1, 1, -1, 1, 1, -1, -1, 1}, {-1,
1, -1, 1, 1, -1, 1, -1}, {-1, 1, -1, 1, 1, -1, 1, 1}, {-1, 1, -1, 1, 1,
1, -1, -1}, {-1, 1, -1, 1, 1, 1, -1, 1}, {-1, 1, -1, 1, 1, 1, 1, -1},
{-1, 1, -1, 1, 1, 1, 1, 1}, {-1, 1, 1, -1, -1, -1, -1, -1}, {-1, 1, 1,
-1, -1, -1, -1, 1}, {-1, 1, 1, -1, -1, -1, 1, -1}, {-1, 1, 1, -1, -1, -1,
1, 1}, {-1, 1, 1, -1, -1, 1, -1, -1}, {-1, 1, 1, -1, -1, 1, -1, 1}, {-1,
1, 1, -1, -1, 1, 1, -1}, {-1, 1, 1, -1, -1, 1, 1, 1}, {-1, 1, 1, -1, 1,
-1, -1, -1}, {-1, 1, 1, -1, 1, -1, -1, 1}, {-1, 1, 1, -1, 1, -1, 1, -1},
{-1, 1, 1, -1, 1, -1, 1, 1}, {-1, 1, 1, -1, 1, 1, -1, -1}, {-1, 1, 1, -1,
1, 1, -1, 1}, {-1, 1, 1, -1, 1, 1, 1, -1}, {-1, 1, 1, -1, 1, 1, 1, 1},
{-1, 1, 1, 1, -1, -1, -1, -1}, {-1, 1, 1, 1, -1, -1, -1, 1}, {-1, 1, 1,
1, -1, -1, 1, -1}, {-1, 1, 1, 1, -1, -1, 1, 1}, {-1, 1, 1, 1, -1, 1, -1,
-1}, {-1, 1, 1, 1, -1, 1, -1, 1}, {-1, 1, 1, 1, -1, 1, 1, -1}, {-1, 1, 1,
1, -1, 1, 1, 1}, {-1, 1, 1, 1, 1, -1, -1, -1}, {-1, 1, 1, 1, 1, -1, -1,
1}, {-1, 1, 1, 1, 1, -1, 1, -1}, {-1, 1, 1, 1, 1, -1, 1, 1}, {-1, 1, 1,
1, 1, 1, -1, -1}, {-1, 1, 1, 1, 1, 1, -1, 1}, {-1, 1, 1, 1, 1, 1, 1, -1},
{-1, 1, 1, 1, 1, 1, 1, 1}, {1, -1, -1, -1, -1, -1, -1, -1}, {1, -1, -1,
-1, -1, -1, -1, 1}, {1, -1, -1, -1, -1, -1, 1, -1}, {1, -1, -1, -1, -1,
-1, 1, 1}, {1, -1, -1, -1, -1, 1, -1, -1}, {1, -1, -1, -1, -1, 1, -1, 1},
{1, -1, -1, -1, -1, 1, 1, -1}, {1, -1, -1, -1, -1, 1, 1, 1}, {1, -1, -1,
-1, 1, -1, -1, -1}, {1, -1, -1, -1, 1, -1, -1, 1}, {1, -1, -1, -1, 1, -1,
1, -1}, {1, -1, -1, -1, 1, -1, 1, 1}, {1, -1, -1, -1, 1, 1, -1, -1}, {1,
-1, -1, -1, 1, 1, -1, 1}, {1, -1, -1, -1, 1, 1, 1, -1}, {1, -1, -1, -1,
1, 1, 1, 1}, {1, -1, -1, 1, -1, -1, -1, -1}, {1, -1, -1, 1, -1, -1, -1,
1}, {1, -1, -1, 1, -1, -1, 1, -1}, {1, -1, -1, 1, -1, -1, 1, 1}, {1, -1,
-1, 1, -1, 1, -1, -1}, {1, -1, -1, 1, -1, 1, -1, 1}, {1, -1, -1, 1, -1,
1, 1, -1}, {1, -1, -1, 1, -1, 1, 1, 1}, {1, -1, -1, 1, 1, -1, -1, -1},
{1, -1, -1, 1, 1, -1, -1, 1}, {1, -1, -1, 1, 1, -1, 1, -1}, {1, -1, -1,
1, 1, -1, 1, 1}, {1, -1, -1, 1, 1, 1, -1, -1}, {1, -1, -1, 1, 1, 1, -1,
1}, {1, -1, -1, 1, 1, 1, 1, -1}, {1, -1, -1, 1, 1, 1, 1, 1}, {1, -1, 1,
-1, -1, -1, -1, -1}, {1, -1, 1, -1, -1, -1, -1, 1}, {1, -1, 1, -1, -1,
-1, 1, -1}, {1, -1, 1, -1, -1, -1, 1, 1}, {1, -1, 1, -1, -1, 1, -1, -1},
{1, -1, 1, -1, -1, 1, -1, 1}, {1, -1, 1, -1, -1, 1, 1, -1}, {1, -1, 1,
-1, -1, 1, 1, 1}, {1, -1, 1, -1, 1, -1, -1, -1}, {1, -1, 1, -1, 1, -1,
-1, 1}, {1, -1, 1, -1, 1, -1, 1, -1}, {1, -1, 1, -1, 1, -1, 1, 1}, {1,
-1, 1, -1, 1, 1, -1, -1}, {1, -1, 1, -1, 1, 1, -1, 1}, {1, -1, 1, -1, 1,
1, 1, -1}, {1, -1, 1, -1, 1, 1, 1, 1}, {1, -1, 1, 1, -1, -1, -1, -1}, {1,
-1, 1, 1, -1, -1, -1, 1}, {1, -1, 1, 1, -1, -1, 1, -1}, {1, -1, 1, 1, -1,
-1, 1, 1}, {1, -1, 1, 1, -1, 1, -1, -1}, {1, -1, 1, 1, -1, 1, -1, 1}, {1,
-1, 1, 1, -1, 1, 1, -1}, {1, -1, 1, 1, -1, 1, 1, 1}, {1, -1, 1, 1, 1, -1,
-1, -1}, {1, -1, 1, 1, 1, -1, -1, 1}, {1, -1, 1, 1, 1, -1, 1, -1}, {1,
-1, 1, 1, 1, -1, 1, 1}, {1, -1, 1, 1, 1, 1, -1, -1}, {1, -1, 1, 1, 1, 1,
-1, 1}, {1, -1, 1, 1, 1, 1, 1, -1}, {1, -1, 1, 1, 1, 1, 1, 1}, {1, 1, -1,
-1, -1, -1, -1, -1}, {1, 1, -1, -1, -1, -1, -1, 1}, {1, 1, -1, -1, -1,
-1, 1, -1}, {1, 1, -1, -1, -1, -1, 1, 1}, {1, 1, -1, -1, -1, 1, -1, -1},
{1, 1, -1, -1, -1, 1, -1, 1}, {1, 1, -1, -1, -1, 1, 1, -1}, {1, 1, -1,
-1, -1, 1, 1, 1}, {1, 1, -1, -1, 1, -1, -1, -1}, {1, 1, -1, -1, 1, -1,
-1, 1}, {1, 1, -1, -1, 1, -1, 1, -1}, {1, 1, -1, -1, 1, -1, 1, 1}, {1, 1,
-1, -1, 1, 1, -1, -1}, {1, 1, -1, -1, 1, 1, -1, 1}, {1, 1, -1, -1, 1, 1,
1, -1}, {1, 1, -1, -1, 1, 1, 1, 1}, {1, 1, -1, 1, -1, -1, -1, -1}, {1, 1,
-1, 1, -1, -1, -1, 1}, {1, 1, -1, 1, -1, -1, 1, -1}, {1, 1, -1, 1, -1,
-1, 1, 1}, {1, 1, -1, 1, -1, 1, -1, -1}, {1, 1, -1, 1, -1, 1, -1, 1}, {1,
1, -1, 1, -1, 1, 1, -1}, {1, 1, -1, 1, -1, 1, 1, 1}, {1, 1, -1, 1, 1, -1,
-1, -1}, {1, 1, -1, 1, 1, -1, -1, 1}, {1, 1, -1, 1, 1, -1, 1, -1}, {1, 1,
-1, 1, 1, -1, 1, 1}, {1, 1, -1, 1, 1, 1, -1, -1}, {1, 1, -1, 1, 1, 1, -1,
1}, {1, 1, -1, 1, 1, 1, 1, -1}, {1, 1, -1, 1, 1, 1, 1, 1}, {1, 1, 1, -1,
-1, -1, -1, -1}, {1, 1, 1, -1, -1, -1, -1, 1}, {1, 1, 1, -1, -1, -1, 1,
-1}, {1, 1, 1, -1, -1, -1, 1, 1}, {1, 1, 1, -1, -1, 1, -1, -1}, {1, 1, 1,
-1, -1, 1, -1, 1}, {1, 1, 1, -1, -1, 1, 1, -1}, {1, 1, 1, -1, -1, 1, 1,
1}, {1, 1, 1, -1, 1, -1, -1, -1}, {1, 1, 1, -1, 1, -1, -1, 1}, {1, 1, 1,
-1, 1, -1, 1, -1}, {1, 1, 1, -1, 1, -1, 1, 1}, {1, 1, 1, -1, 1, 1, -1,
-1}, {1, 1, 1, -1, 1, 1, -1, 1}, {1, 1, 1, -1, 1, 1, 1, -1}, {1, 1, 1,
-1, 1, 1, 1, 1}, {1, 1, 1, 1, -1, -1, -1, -1}, {1, 1, 1, 1, -1, -1, -1,
1}, {1, 1, 1, 1, -1, -1, 1, -1}, {1, 1, 1, 1, -1, -1, 1, 1}, {1, 1, 1, 1,
-1, 1, -1, -1}, {1, 1, 1, 1, -1, 1, -1, 1}, {1, 1, 1, 1, -1, 1, 1, -1},
{1, 1, 1, 1, -1, 1, 1, 1}, {1, 1, 1, 1, 1, -1, -1, -1}, {1, 1, 1, 1, 1,
-1, -1, 1}, {1, 1, 1, 1, 1, -1, 1, -1}, {1, 1, 1, 1, 1, -1, 1, 1}, {1, 1,
1, 1, 1, 1, -1, -1}, {1, 1, 1, 1, 1, 1, -1, 1}, {1, 1, 1, 1, 1, 1, 1,
-1}, {1, 1, 1, 1, 1, 1, 1, 1}};
// Denominators: spins, colors and identical particles
const int denominators[nprocesses] = {72, 72};
ntry = ntry + 1;
// Reset the matrix elements
for(int i = 0; i < nprocesses; i++ )
{
matrix_element[i] = 0.;
}
// Define permutation
int perm[nexternal];
for(int i = 0; i < nexternal; i++ )
{
perm[i] = i;
}
if (sum_hel == 0 || ntry < 10)
{
// Calculate the matrix element for all helicities
for(int ihel = 0; ihel < ncomb; ihel++ )
{
if (goodhel[ihel] || ntry < 2)
{
calculate_wavefunctions(perm, helicities[ihel]);
t[0] = matrix_ds_wmusssx_wm_mumvmx();
// Mirror initial state momenta for mirror process
perm[0] = 1;
perm[1] = 0;
// Calculate wavefunctions
calculate_wavefunctions(perm, helicities[ihel]);
// Mirror back
perm[0] = 0;
perm[1] = 1;
// Calculate matrix elements
t[1] = matrix_ds_wmusssx_wm_mumvmx();
double tsum = 0;
for(int iproc = 0; iproc < nprocesses; iproc++ )
{
matrix_element[iproc] += t[iproc];
tsum += t[iproc];
}
// Store which helicities give non-zero result
if (tsum != 0. && !goodhel[ihel])
{
goodhel[ihel] = true;
ngood++;
igood[ngood] = ihel;
}
}
}
jhel = 0;
sum_hel = min(sum_hel, ngood);
}
else
{
// Only use the "good" helicities
for(int j = 0; j < sum_hel; j++ )
{
jhel++;
if (jhel >= ngood)
jhel = 0;
double hwgt = double(ngood)/double(sum_hel);
int ihel = igood[jhel];
calculate_wavefunctions(perm, helicities[ihel]);
t[0] = matrix_ds_wmusssx_wm_mumvmx();
// Mirror initial state momenta for mirror process
perm[0] = 1;
perm[1] = 0;
// Calculate wavefunctions
calculate_wavefunctions(perm, helicities[ihel]);
// Mirror back
perm[0] = 0;
perm[1] = 1;
// Calculate matrix elements
t[1] = matrix_ds_wmusssx_wm_mumvmx();
for(int iproc = 0; iproc < nprocesses; iproc++ )
{
matrix_element[iproc] += t[iproc] * hwgt;
}
}
}
for (int i = 0; i < nprocesses; i++ )
matrix_element[i] /= denominators[i];
}
//--------------------------------------------------------------------------
// Evaluate |M|^2, including incoming flavour dependence.
double P0_Sigma_sm_ds_mumvmxusssx_W_4j::sigmaHat()
{
// Select between the different processes
if(id1 == 1 && id2 == 3)
{
// Add matrix elements for processes with beams (1, 3)
return matrix_element[0];
}
else if(id1 == 3 && id2 == 1)
{
// Add matrix elements for processes with beams (3, 1)
return matrix_element[1];
}
else
{
// Return 0 if not correct initial state assignment
return 0.;
}
}
//==========================================================================
// Private class member functions
//--------------------------------------------------------------------------
// Evaluate |M|^2 for each subprocess
void P0_Sigma_sm_ds_mumvmxusssx_W_4j::calculate_wavefunctions(const int perm[], const int hel[])
{
// Calculate wavefunctions for all processes
int i, j;
// Calculate all wavefunctions
ixxxxx(p[perm[0]], mME[0], hel[0], +1, w[0]);
ixxxxx(p[perm[1]], mME[1], hel[1], +1, w[1]);
oxxxxx(p[perm[2]], mME[2], hel[2], +1, w[2]);
ixxxxx(p[perm[3]], mME[3], hel[3], -1, w[3]);
FFV2_3(w[3], w[2], pars->GC_100, pars->MW, pars->WW, w[4]);
oxxxxx(p[perm[4]], mME[4], hel[4], +1, w[5]);
oxxxxx(p[perm[5]], mME[5], hel[5], +1, w[6]);
oxxxxx(p[perm[6]], mME[6], hel[6], +1, w[7]);
ixxxxx(p[perm[7]], mME[7], hel[7], -1, w[8]);
FFV2_2(w[0], w[4], pars->GC_100, pars->ZERO, pars->ZERO, w[9]);
FFV1_3(w[1], w[6], pars->GC_11, pars->ZERO, pars->ZERO, w[10]);
FFV1_3(w[9], w[5], pars->GC_11, pars->ZERO, pars->ZERO, w[11]);
FFV1_1(w[7], w[10], pars->GC_11, pars->ZERO, pars->ZERO, w[12]);
FFV1_2(w[8], w[10], pars->GC_11, pars->ZERO, pars->ZERO, w[13]);
FFV1_3(w[8], w[7], pars->GC_11, pars->ZERO, pars->ZERO, w[14]);
FFV1_2(w[9], w[10], pars->GC_11, pars->ZERO, pars->ZERO, w[15]);
FFV1_2(w[9], w[14], pars->GC_11, pars->ZERO, pars->ZERO, w[16]);
FFV1_3(w[1], w[7], pars->GC_11, pars->ZERO, pars->ZERO, w[17]);
FFV1_1(w[6], w[17], pars->GC_11, pars->ZERO, pars->ZERO, w[18]);
FFV1_2(w[8], w[17], pars->GC_11, pars->ZERO, pars->ZERO, w[19]);
FFV1_3(w[8], w[6], pars->GC_11, pars->ZERO, pars->ZERO, w[20]);
FFV1_2(w[9], w[17], pars->GC_11, pars->ZERO, pars->ZERO, w[21]);
FFV1_2(w[9], w[20], pars->GC_11, pars->ZERO, pars->ZERO, w[22]);
FFV1_2(w[1], w[20], pars->GC_11, pars->ZERO, pars->ZERO, w[23]);
FFV1_1(w[7], w[20], pars->GC_11, pars->ZERO, pars->ZERO, w[24]);
FFV1_2(w[1], w[14], pars->GC_11, pars->ZERO, pars->ZERO, w[25]);
FFV1_1(w[6], w[14], pars->GC_11, pars->ZERO, pars->ZERO, w[26]);
FFV2_1(w[5], w[4], pars->GC_100, pars->ZERO, pars->ZERO, w[27]);
FFV1_3(w[0], w[27], pars->GC_11, pars->ZERO, pars->ZERO, w[28]);
FFV1_2(w[0], w[10], pars->GC_11, pars->ZERO, pars->ZERO, w[29]);
FFV1_2(w[0], w[14], pars->GC_11, pars->ZERO, pars->ZERO, w[30]);
FFV1_1(w[5], w[14], pars->GC_11, pars->ZERO, pars->ZERO, w[31]);
FFV1_1(w[5], w[10], pars->GC_11, pars->ZERO, pars->ZERO, w[32]);
FFV1_2(w[0], w[17], pars->GC_11, pars->ZERO, pars->ZERO, w[33]);
FFV1_2(w[0], w[20], pars->GC_11, pars->ZERO, pars->ZERO, w[34]);
FFV1_1(w[5], w[20], pars->GC_11, pars->ZERO, pars->ZERO, w[35]);
FFV1_1(w[5], w[17], pars->GC_11, pars->ZERO, pars->ZERO, w[36]);
// Calculate all amplitudes
// Amplitude(s) for diagram number 0
FFV1_0(w[8], w[12], w[11], pars->GC_11, amp[0]);
FFV1_0(w[13], w[7], w[11], pars->GC_11, amp[1]);
FFV1_0(w[15], w[5], w[14], pars->GC_11, amp[2]);
VVV1_0(w[10], w[14], w[11], pars->GC_10, amp[3]);
FFV1_0(w[16], w[5], w[10], pars->GC_11, amp[4]);
FFV1_0(w[8], w[18], w[11], pars->GC_11, amp[5]);
FFV1_0(w[19], w[6], w[11], pars->GC_11, amp[6]);
FFV1_0(w[21], w[5], w[20], pars->GC_11, amp[7]);
VVV1_0(w[17], w[20], w[11], pars->GC_10, amp[8]);
FFV1_0(w[22], w[5], w[17], pars->GC_11, amp[9]);
FFV1_0(w[23], w[7], w[11], pars->GC_11, amp[10]);
FFV1_0(w[1], w[24], w[11], pars->GC_11, amp[11]);
FFV1_0(w[25], w[6], w[11], pars->GC_11, amp[12]);
FFV1_0(w[1], w[26], w[11], pars->GC_11, amp[13]);
FFV1_0(w[8], w[12], w[28], pars->GC_11, amp[14]);
FFV1_0(w[13], w[7], w[28], pars->GC_11, amp[15]);
FFV1_0(w[29], w[27], w[14], pars->GC_11, amp[16]);
VVV1_0(w[10], w[14], w[28], pars->GC_10, amp[17]);
FFV1_0(w[30], w[27], w[10], pars->GC_11, amp[18]);
FFV2_0(w[29], w[31], w[4], pars->GC_100, amp[19]);
FFV2_0(w[30], w[32], w[4], pars->GC_100, amp[20]);
FFV1_0(w[8], w[18], w[28], pars->GC_11, amp[21]);
FFV1_0(w[19], w[6], w[28], pars->GC_11, amp[22]);
FFV1_0(w[33], w[27], w[20], pars->GC_11, amp[23]);
VVV1_0(w[17], w[20], w[28], pars->GC_10, amp[24]);
FFV1_0(w[34], w[27], w[17], pars->GC_11, amp[25]);
FFV2_0(w[33], w[35], w[4], pars->GC_100, amp[26]);
FFV2_0(w[34], w[36], w[4], pars->GC_100, amp[27]);
FFV1_0(w[23], w[7], w[28], pars->GC_11, amp[28]);
FFV1_0(w[1], w[24], w[28], pars->GC_11, amp[29]);
FFV1_0(w[25], w[6], w[28], pars->GC_11, amp[30]);
FFV1_0(w[1], w[26], w[28], pars->GC_11, amp[31]);
}
double P0_Sigma_sm_ds_mumvmxusssx_W_4j::matrix_ds_wmusssx_wm_mumvmx()
{
int i, j;
// Local variables
const int ngraphs = 32;
const int ncolor = 6;
std::complex<double> ztemp;
std::complex<double> jamp[ncolor];
// The color matrix;
static const double denom[ncolor] = {1, 1, 1, 1, 1, 1};
static const double cf[ncolor][ncolor] = {{27, 9, 9, 3, 3, 9}, {9, 27, 3, 9,
9, 3}, {9, 3, 27, 9, 9, 3}, {3, 9, 9, 27, 3, 9}, {3, 9, 9, 3, 27, 9}, {9,
3, 3, 9, 9, 27}};
// Calculate color flows
jamp[0] = +1./4. * (-1./9. * amp[0] - 1./9. * amp[1] - 1./9. * amp[2] - 1./9.
* amp[4] - 1./3. * amp[5] - 1./3. * amp[6] - 1./3. * amp[10] - 1./3. *
amp[11] - 1./9. * amp[12] - 1./9. * amp[13] - 1./9. * amp[14] - 1./9. *
amp[15] - 1./9. * amp[16] - 1./9. * amp[18] - 1./9. * amp[19] - 1./9. *
amp[20] - 1./3. * amp[21] - 1./3. * amp[22] - 1./3. * amp[28] - 1./3. *
amp[29] - 1./9. * amp[30] - 1./9. * amp[31]);
jamp[1] = +1./4. * (+1./3. * amp[0] + 1./3. * amp[1] + 1./9. * amp[5] + 1./9.
* amp[6] + 1./9. * amp[7] + 1./9. * amp[9] + 1./9. * amp[10] + 1./9. *
amp[11] + 1./3. * amp[12] + 1./3. * amp[13] + 1./3. * amp[14] + 1./3. *
amp[15] + 1./9. * amp[21] + 1./9. * amp[22] + 1./9. * amp[23] + 1./9. *
amp[25] + 1./9. * amp[26] + 1./9. * amp[27] + 1./9. * amp[28] + 1./9. *
amp[29] + 1./3. * amp[30] + 1./3. * amp[31]);
jamp[2] = +1./4. * (+1./3. * amp[2] + 1./3. * amp[4] + amp[6] -
std::complex<double> (0, 1) * amp[8] + amp[9] + amp[11] + 1./3. * amp[12]
+ 1./3. * amp[13] + 1./3. * amp[16] + 1./3. * amp[18] + 1./3. * amp[19] +
1./3. * amp[20] + amp[22] - std::complex<double> (0, 1) * amp[24] +
amp[25] + amp[27] + amp[29] + 1./3. * amp[30] + 1./3. * amp[31]);
jamp[3] = +1./4. * (-amp[1] + std::complex<double> (0, 1) * amp[3] - amp[4] -
1./3. * amp[7] - 1./3. * amp[9] - 1./3. * amp[10] - 1./3. * amp[11] -
amp[13] - amp[15] + std::complex<double> (0, 1) * amp[17] - amp[18] -
amp[20] - 1./3. * amp[23] - 1./3. * amp[25] - 1./3. * amp[26] - 1./3. *
amp[27] - 1./3. * amp[28] - 1./3. * amp[29] - amp[31]);
jamp[4] = +1./4. * (-amp[0] - amp[2] - std::complex<double> (0, 1) * amp[3] -
1./3. * amp[5] - 1./3. * amp[6] - 1./3. * amp[7] - 1./3. * amp[9] -
amp[12] - amp[14] - amp[16] - std::complex<double> (0, 1) * amp[17] -
amp[19] - 1./3. * amp[21] - 1./3. * amp[22] - 1./3. * amp[23] - 1./3. *
amp[25] - 1./3. * amp[26] - 1./3. * amp[27] - amp[30]);
jamp[5] = +1./4. * (+1./3. * amp[0] + 1./3. * amp[1] + 1./3. * amp[2] + 1./3.
* amp[4] + amp[5] + amp[7] + std::complex<double> (0, 1) * amp[8] +
amp[10] + 1./3. * amp[14] + 1./3. * amp[15] + 1./3. * amp[16] + 1./3. *
amp[18] + 1./3. * amp[19] + 1./3. * amp[20] + amp[21] + amp[23] +
std::complex<double> (0, 1) * amp[24] + amp[26] + amp[28]);
// Sum and square the color flows to get the matrix element
double matrix = 0;
for(i = 0; i < ncolor; i++ )
{
ztemp = 0.;
for(j = 0; j < ncolor; j++ )
ztemp = ztemp + cf[i][j] * jamp[j];
matrix = matrix + real(ztemp * conj(jamp[i]))/denom[i];
}
// Store the leading color flows for choice of color
for(i = 0; i < ncolor; i++ )
jamp2[0][i] += real(jamp[i] * conj(jamp[i]));
return matrix;
}
| [
"Matthias.Komm@cern.ch"
] | Matthias.Komm@cern.ch |
783d054229a3be63c9755ba1c5e37759cb5781b8 | d45993f95238e4d56a9b6ad2294db40ad1aee799 | /eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/examples/PotentiometerPID/src/Robot.cpp | 14a6d31abead097cb0dae8a596978fd5a3c1d899 | [] | no_license | Talos4757/allwpilib | d47d0aa71ae6ccc685029f9193d13ad420fe90d9 | f0e3bb51642acae7e7a002c0072538dd94743432 | refs/heads/master | 2021-01-16T18:02:13.606677 | 2015-07-15T00:01:42 | 2015-07-30T15:55:28 | 40,710,547 | 1 | 0 | null | 2015-08-14T10:52:26 | 2015-08-14T10:52:25 | null | UTF-8 | C++ | false | false | 2,710 | cpp | #include "WPILib.h"
/**
* This is a sample program to demonstrate how to use a soft potentiometer and a PID
* Controller to reach and maintain position setpoints on an elevator mechanism.
*
* WARNING: While it may look like a good choice to use for your code if you're inexperienced,
* don't. Unless you know what you are doing, complex code will be much more difficult under
* this system. Use IterativeRobot or Command-Based instead if you're new.
*/
class Robot: public SampleRobot {
const int potChannel = 1; //analog input pin
const int motorChannel = 7; //PWM channel
const int joystickChannel = 0; //usb number in DriverStation
const int buttonNumber = 4; //button on joystick
const double setPoints[3] = { 1.0, 2.6, 4.3 }; //bottom, middle, and top elevator setpoints
//proportional, integral, and derivative speed constants; motor inverted
//DANGER: when tuning PID constants, high/inappropriate values for pGain, iGain,
//and dGain may cause dangerous, uncontrollable, or undesired behavior!
const double pGain = -5.0, iGain = -0.02, dGain = -2.0; //these may need to be positive for a non-inverted motor
PIDController *pidController;
AnalogInput *potentiometer;
Victor *elevatorMotor;
Joystick *joystick;
public:
Robot() :
SampleRobot()
{
//make objects for potentiometer, the elevator motor controller, and the joystick
potentiometer = new AnalogInput(potChannel);
elevatorMotor = new Victor(motorChannel);
joystick = new Joystick(joystickChannel);
//potentiometer (AnalogInput) and elevatorMotor (Victor) can be used as a
//PIDSource and PIDOutput respectively
pidController = new PIDController(pGain, iGain, dGain, potentiometer,
elevatorMotor);
}
/**
* Runs during autonomous.
*/
void Autonomous() {
}
/**
* Uses a PIDController and an array of setpoints to switch and maintain elevator positions.
* The elevator setpoint is selected by a joystick button.
*/
void OperatorControl() {
pidController->SetInputRange(0, 5); //0 to 5V
pidController->SetSetpoint(setPoints[0]); //set to first setpoint
int index = 0;
bool currentValue;
bool previousValue = false;
while (IsOperatorControl() && IsEnabled()) {
pidController->Enable(); //begin PID control
//when the button is pressed once, the selected elevator setpoint is incremented
currentValue = joystick->GetRawButton(buttonNumber);
if (currentValue && !previousValue) {
pidController->SetSetpoint(setPoints[index]);
index = (index + 1) % (sizeof(setPoints)/8); //index of elevator setpoint wraps around
}
previousValue = currentValue;
}
}
/**
* Runs during test mode.
*/
void Test() {
}
};
START_ROBOT_CLASS(Robot);
| [
"jagresta2@gmail.com"
] | jagresta2@gmail.com |
6e449d413682a6c2b21a0fece5656600761af5ae | 7380cbd4efa56bfc3aa63d373916d98b2f205a5e | /w1_shaper_fireflies copy/src/Firefly.h | b65955529c38a9e08b3443ad0abb7f79af1fdfcd | [] | no_license | friej715/jane_algo2012 | 3ecf7fd028f4ffa6b3dc3262ac86d26449403ea8 | a9bd5284499b1360d02a6aa933491e1243ba54c8 | refs/heads/master | 2016-09-06T16:23:00.441598 | 2012-12-18T20:07:51 | 2012-12-18T20:07:51 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 756 | h | //
// Firefly.h
// emptyExample
//
// Created by Jane Friedhoff on 9/15/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#ifndef emptyExample_Firefly_h
#define emptyExample_Firefly_h
#include "ofMain.h"
class Firefly {
public:
ofPoint pos;
ofColor col;
int w;
int h;
int expanse;
float angle;
bool isMovingClockwise;
bool isSpeedingUp;
ofPoint followPoint;
float pct;
float shaper;
int alpha;
int followAlpha;
void setup();
void update();
void draw();
void changeDir();
void interpolateByPct(float myPct);
vector<ofPoint> previousPoints;
int interval;
int startTime;
};
#endif
| [
"friej715@newschool.edu"
] | friej715@newschool.edu |
b4b2855cc7594bbb15889e6025c51ecd4828a747 | 75ad6ead84fe8e853c4431458fcb165559fe3e1c | /QuanLiCanBo.h | d1113423ab6c190e171f295ba487b5f8def6f8d5 | [] | no_license | ScraggyDuck/OOP-Officer | e89381447be4e242dcf77ca80a14c1c8272f3ffc | c4f146119244f34d6ca5f2d53b11547b5a6c2665 | refs/heads/master | 2020-05-30T11:04:01.641584 | 2019-06-01T05:54:57 | 2019-06-01T05:54:57 | 189,689,862 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 271 | h | #pragma once
#include "GiangVien.h"
#include "NhanVienHanhChinh.h"
#include <vector>
class QuanLiCanBo
{
private:
vector<CanBo*> list;
public:
QuanLiCanBo();
~QuanLiCanBo();
void menu();
void nhap();
void xuat();
int tongLuong();
void canBoLuongThapNhat();
};
| [
"Quocvietcoi2000@gmail.com"
] | Quocvietcoi2000@gmail.com |
cbaa5fa4b279bf37e45e39256ccc921f5e7ee959 | e3e314f0d3d45fd98784f7aa9fc108a31b8e9ff9 | /server/router.h | c7a6f1255cae63663f95a9ba6b621006bb50ebf6 | [] | no_license | anhptvolga/a2stp | 63c35c6ab8a1601d2009d810a86ff011febf4868 | 44be22dadd0fabcc01b6661f6d74fbe60481ce14 | refs/heads/master | 2021-01-16T00:49:53.361814 | 2017-08-17T01:13:42 | 2017-08-17T01:13:42 | 99,983,440 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 320 | h | #ifndef __router_h__
#define __router_h__
#include <iostream>
#include <fstream>
#include <string>
#include <ctime>
#include <utility>
#include "bitlib/bitlib.h"
#include "utils/su.h"
#include "utils/const.h"
#include "validator.h"
/**
* route message
*/
void route_message(signal_unit signal, time_t time);
#endif
| [
"anhptvolga@yandex.ru"
] | anhptvolga@yandex.ru |
b472fb39ef64700120dc1a7113d0ce62a8e60260 | 0cb85cd0c88a9b9f0cca4472742c2bf9febef2d8 | /ParentalControl/UrlFlt/task.h | f135d26c0bff2bc845305c566acc978b1f7a59ed | [] | no_license | seth1002/antivirus-1 | 9dfbadc68e16e51f141ac8b3bb283c1d25792572 | 3752a3b20e1a8390f0889f6192ee6b851e99e8a4 | refs/heads/master | 2020-07-15T00:30:19.131934 | 2016-07-21T13:59:11 | 2016-07-21T13:59:11 | null | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 19,424 | h | // AVP Prague stamp begin( Interface header, )
// -------- ANSI C++ Code Generator 1.0 --------
// -------- Wednesday, 04 April 2007, 19:51 --------
// -------------------------------------------
// Copyright © Kaspersky Lab 1996-2006.
// -------------------------------------------
// Project -- Kaspersky Anti-Virus
// Sub project -- Not defined
// Purpose -- Not defined
// Author -- Nechaev
// File Name -- task.cpp
// -------------------------------------------
// AVP Prague stamp end
// AVP Prague stamp begin( Header ifndef, )
#if !defined( __task_cpp__814c5c2a_17fc_4717_8b6b_7cac387c15db )
#define __task_cpp__814c5c2a_17fc_4717_8b6b_7cac387c15db
// AVP Prague stamp end
// AVP Prague stamp begin( Header includes, )
#include <Prague/prague.h>
#include <Prague/pr_vtbl.h>
#include <Prague/iface/i_reg.h>
#include <Prague/iface/i_root.h>
#include <ParentalControl/plugin/p_urlflt.h>
// AVP Prague stamp end
#include <Prague/iface/i_csect.h>
#include <Prague/iface/i_threadpool.h>
#include <Prague/iface/i_token.h>
#include <ParentalControl/structs/s_urlflt.h>
#include "..\..\Components\Updater\Transport\PragueTransport\i_transport.h"
#include "..\..\Components\Updater\Transport\ProxyServerAddressDetector\i_proxyserveraddressdetector.h"
#include "db.h"
#define prMAKEWORD(h, l) ((tWORD)(((tBYTE)((tDWORD)(l) & 0xff)) | ((tWORD)((tBYTE)((tDWORD)(h) & 0xff))) << 8))
#define prLOBYTE(w) ((tBYTE)((tDWORD)(w) & 0xff))
#define prHIBYTE(w) ((tBYTE)((tDWORD)(w) >> 8))
//////////////////////////////////////////////////////////////////////////
// AVP Prague stamp begin( C++ class declaration, )
struct pr_novtable UrlFlt : public cTask
{
private:
// Internal function declarations
tERROR pr_call ObjectInit();
tERROR pr_call ObjectInitDone();
tERROR pr_call ObjectPreClose();
tERROR pr_call MsgReceive( tDWORD p_msg_cls_id, tDWORD p_msg_id, hOBJECT p_send_point, hOBJECT p_ctx, hOBJECT p_receive_point, tVOID* p_par_buf, tDWORD* p_par_buf_len );
// Property function declarations
public:
// External function declarations
tERROR pr_call SetSettings( const cSerializable* p_settings );
tERROR pr_call GetSettings( cSerializable* p_settings );
tERROR pr_call AskAction( tActionId p_actionId, cSerializable* p_actionInfo );
tERROR pr_call SetState( tTaskRequestState p_state );
tERROR pr_call GetStatistics( cSerializable* p_statistics );
// Data declaration
hTASKMANAGER m_hTM; // --
tTaskState m_nTaskState; // --
tDWORD m_nTaskSessionId; // --
tDWORD m_nTaskId; // --
tDWORD m_nTaskParentId; // --
hREGISTRY m_hPersData; // --
// AVP Prague stamp end
public:
///
/// tEnabledStrItemsList struct
///
struct tEnabledStrItemsList: public CUrlListCache::tExtList
{
tEnabledStrItemsList(cVector<cEnabledStrItem>& _p) : m_p(_p) { s_strobj = 1; }
tDWORD count() const { return m_p.size(); }
void item(tDWORD idx, CUrlListCache::tExtListItem& item) const
{
const cEnabledStrItem& _i = m_p[idx];
item.s_name = (tPTR)&_i.m_sName;
item.s_len = _i.m_sName.size();
item.s_data = 0;
item.s_enabled = _i.m_bEnabled;
}
cVector<cEnabledStrItem>& m_p;
};
///
/// tUser struct
///
struct tUser
{
tUser() : m_nProfileId(-1), m_bFixProfile(0) {}
cStrObj m_user;
tDWORD m_nProfileId;
unsigned m_bFixProfile : 1;
};
typedef cVectorSimple(tUser) tUsers;
///
/// tRefObj struct
///
struct tRefObj
{
public:
tRefObj() : m_ref(1) {}
virtual ~tRefObj() {}
tLONG m_ref;
void addRef() { PrInterlockedIncrement(&m_ref); }
void release() { if( !PrInterlockedDecrement(&m_ref) ) delete this; }
};
///
/// tProfile struct
///
struct tProfile: public tRefObj
{
public:
static tProfile * _new(tDWORD nId = 0) { return new tProfile(nId); }
static void _clear_a(cVectorSimple(tProfile *)& _a) { for(tDWORD i = 0; i < _a.size(); i++) _a[i]->release(); _a.clear(); }
public:
tProfile(tDWORD nId = 0) :
m_nId(nId), m_bUseCommonFilter(0), m_nLevel(SETTINGS_LEVEL_DEFAULT),
m_LastQueryTime(0), m_nDayTime(0),
m_nDayTimeLimit(0xFFFFFFFF),
m_bUseDayTimeSpace( 0 ),
m_bUseDayTimeLimit( 0 )
{
m_urlsWhite.owner() = m_urlsBlack.owner() = (hOBJECT)g_root;
}
tERROR Build( hOBJECT tracer, cUrlFltFilter& _flt )
{
tERROR err = m_urlsWhite.Build( tracer, tEnabledStrItemsList( _flt.m_vWhiteList ) );
if( PR_FAIL(err) )
return err;
err = m_urlsBlack.Build( tracer, tEnabledStrItemsList( _flt.m_vBlackList ) );
if( PR_FAIL(err) )
return err;
m_nDenyCategoriesMask = _flt.m_nDenyCategoriesMask;
return errOK;
}
tERROR CheckUrl(const CUrlListCache::tURL& p_url, ReportInfo& info ) const
{
info.SetPrefix( "Profile: white list: %s => ", p_url.m_url );
bool found = m_urlsWhite.Find( p_url, info );
info.ClearPrefix();
if( found )
{
return errOK_DECIDED;
}
info.SetPrefix( "Profile: black list: %s => ", p_url.m_url );
found = m_urlsBlack.Find( p_url, info );
info.ClearPrefix();
if ( found )
{
return errACCESS_DENIED;
}
return errOK;
}
void Clear()
{
m_urlsWhite.Free();
m_urlsBlack.Free();
}
tERROR DataSet(cUrlFltProfileData& _d, bool bTo)
{
if( bTo )
{
_d.m_nId = m_nId;
_d.m_tmLastQuery = m_LastQueryTime;
_d.m_nCurDayTime = m_nDayTime;
_d.m_nDayTimeLimit = m_nDayTimeLimit;
}
else
{
m_nId = _d.m_nId;
m_LastQueryTime = _d.m_tmLastQuery;
m_nDayTime = _d.m_nCurDayTime;
m_nDayTimeLimit = _d.m_nDayTimeLimit;
}
return errOK;
}
tDWORD m_nId;
cStrObj m_strName;
tDWORD m_nLevel;
unsigned m_bUseCommonFilter : 1;
unsigned m_bDenyDetected : 1;
CUrlListCache m_urlsWhite;
CUrlListCache m_urlsBlack;
tQWORD m_nDenyCategoriesMask;
tDWORD m_bUseDayTimeSpace : 1;
tUrlFltTimeSpace m_nDayTimeSpace;
unsigned m_bUseDayTimeLimit : 1;
tDWORD m_nDayTimeLimit;
time_t m_LastQueryTime;
tDWORD m_nDayTime;
cUrlFltStatData m_stat;
};
typedef cVectorSimple(tProfile *) tProfiles;
///
/// tCasheObj struct
///
struct tCasheObj
{
tCasheObj():
m_err(0),
//m_err_deny(0) {}
m_analyzed(0),
m_URLDetectType(0)
{
}
tERROR DataSet(cUrlFltCacheData& _d, bool bTo)
{
if( bTo )
{
{
_d.m_strUrl.resize(m_url.size());
if( _d.m_strUrl.size() != m_url.size() )
return errNOT_ENOUGH_MEMORY;
if( _d.m_strUrl.size() )
memcpy(&_d.m_strUrl[0], m_url.c_str(), _d.m_strUrl.size());
}
{
tDWORD i = 0, n = m_dbRes.size();
_d.m_Res.resize(n);
if( _d.m_Res.size() != n )
return errNOT_ENOUGH_MEMORY;
for(; i < n; i++)
{
CParctlDb::ResultCatg& _c = m_dbRes[i];
_d.m_Res[i] = prMAKEWORD(_c.m_id, _c.m_weight <= 100 ? _c.m_weight : 100);
}
}
_d.m_nTime = m_time;
//_d.m_nFlags = (m_err ? cUrlFltCacheData::fErr : 0)|(m_err_deny ? cUrlFltCacheData::fErrDeny : 0);
_d.m_nFlags =
( m_err ? cUrlFltCacheData::fErr : 0 )
|
( m_analyzed ? cUrlFltCacheData::fAnalyzed : 0 );
}
else
{
{
m_url.resize(_d.m_strUrl.size());
if( m_url.size() != _d.m_strUrl.size() )
return errNOT_ENOUGH_MEMORY;
if( m_url.size() )
memcpy(&m_url[0], &_d.m_strUrl[0], m_url.size());
}
{
tDWORD i = 0, n = _d.m_Res.size();
m_dbRes.resize(n);
if( m_dbRes.size() != n )
return errNOT_ENOUGH_MEMORY;
for(; i < n; i++)
{
CParctlDb::ResultCatg& _c = m_dbRes[i];
tWORD& _w = _d.m_Res[i];
_c.m_id = prHIBYTE(_w);
_c.m_weight = prLOBYTE(_w);
}
}
m_time = _d.m_nTime;
m_err = _d.m_nFlags & cUrlFltCacheData::fErr;
//m_err_deny = _d.m_nFlags & cUrlFltCacheData::fErrDeny;
m_analyzed = _d.m_nFlags & cUrlFltCacheData::fAnalyzed;
}
return errOK;
}
std::string m_url;
CParctlDb::Result m_dbRes;
time_t m_time;
unsigned m_err : 1;
//unsigned m_err_deny : 1;
unsigned m_analyzed : 1;
unsigned m_URLDetectType;
};
typedef cVectorSimple(tCasheObj) tCasheObjs;
///
/// Results of searching in cache
///
//enum eCacheRes {eCrProcess, eCrProcessWait, eCrFound};
enum eCacheRes
{
eCacheNone, // Item is not found
eCacheFound, // Item is found
eCacheNotAnalyzed // Item is found but it was not analyzed before placing in cache
};
///
/// tHeurObj struct
///
struct tHeurObj: public tRefObj
{
static tHeurObj * _new() { return new tHeurObj(); }
tHeurObj() : m_complete(0), m_deny(0) {}
std::string m_url;
CParctlDb::Result m_dbRes;
volatile unsigned m_complete : 1;
unsigned m_deny : 1;
};
typedef cVectorSimple(tHeurObj *) tHeurObjs;
///
/// tTrObj struct
///
struct tTrObj
{
tTrObj() : m_used(1) {}
cAutoObj<cTransport> m_tr;
volatile unsigned m_used : 1;
};
typedef cVectorSimple(tTrObj) tTrObjs;
///
/// tHeurPrm struct
///
struct tHeurPrm
{
tHeurPrm() : m_fHeuristicContentDescr(1), m_fHeuristicContentUrls(1) {}
tDWORD m_nMaxDataSize;
tDWORD m_nTranspNetTimeout;
cStrObj m_strTranspUserAgent;
unsigned m_fHeuristicContentDescr : 1;
unsigned m_fHeuristicContentUrls : 1;
};
public:
UrlFlt();
tERROR Reinit(cUrlFltSettings * p_settings);
tERROR ProcessObject(cUrlFilteringRequest * pUrlFlt, hIO content);
tERROR SwitchProfile(const cStrObj& strUserId, tDWORD nProfileId);
bool CheckProxyChanged();
tERROR IdleWork(tDWORD counter);
tERROR DataProfilesSet(bool bWrite);
tERROR DataCacheSet(bool bWrite);
// lockLoadBasesMutex [in] - indicates whether bases mutex shold be locked,
// Note: it should not be locked if pm_COMPONENT_PREINSTALLED message received, because updater locks the mutex itself
tERROR _ReloadDb(const cStrObj& strDbFile, const bool lockLoadBasesMutex);
tERROR _GetUserByPID(tULONG nPID, cToken ** pToken, cStrObj& szUser, tDWORD& nType);
void _Clear();
void _ClearHeurCache();
public:
tUser * _GetUser(const cStrObj& strUserId, bool bCreate = false, tDWORD * pPos = NULL);
tProfile * _GetProfile(tDWORD nId, bool bCreate = false, tDWORD * pPos = NULL);
tProfile * _GetUserProfile(const cStrObj& strUserId);
bool _CheckTimeLimit(tProfile * _profile);
///
/// Perform heuristic analyze
///
tERROR _HeuristicAnalyze
(
const cStrObj& strSiteURL,
hIO content,
const cUrlFilteringRequest& request,
tHeurPrm& _Prm,
//cToken * pToken,
CParctlDb::SearchResult& searchRes
);
tERROR _GetHeuristicErrorImportance(tERROR errHeuristic);
private:
///
/// Perform transport-related objects initialization
///
tERROR _TrMgr_Init();
///
/// Perform transport-related objects cleaning
///
void _TrMgr_DeInit();
///
/// Get transport object for use
///
//tERROR _TrMgr_GetObj(cTransport ** ppTransp, tDWORD nTranspNetTimeout, const cStrObj& strUserAgent);
tERROR _TrMgr_GetObj(cTransport ** ppTransp );
///
/// Release transport object when there is no need for it
///
void _TrMgr_ReleaseObj(cTransport * pTransp);
///
/// Perform emergency cleaning of transport-related objects
///
void _TrMgr_AbortJobs();
private:
///
/// Perform processing of the given content
///
tERROR DoProcessing
(
const cUrlFilteringRequest* pUrlFlt,
hIO content,
const tProfile* _profile,
const tQWORD& nDenyCategoriesMask,
cToken* pToken,
cUrlFltReportEvent& _Evt
);
///
/// Analyze the given content
///
tERROR AnalyzeObject
(
const cUrlFilteringRequest* pUrlFlt,
hIO content,
const tProfile* _profile,
const tQWORD& nDenyCategoriesMask,
const CUrlListCache::tURL& url,
cUrlFltReportEvent& _Evt,
CParctlDb::Result& _dbRes
);
private:
///
/// Check the given URL in cache
///
/// @param strFullURL - full URL
/// @param _Evt - event with results of checking
/// @param errCode - error code
/// @param _dbRes - output category results for the given URL
/// @param analyzed - true if the given item was analyzed,
/// false - the item was not analyzed (any error occurred)
/// @param lock - true if the call should be performed under lock
/// @return true if the given URL is found in cache, false - otherwise
///
eCacheRes findInCache
(
const cStrObj& strFullURL,
cUrlFltReportEvent& _Evt,
tERROR& err,
CParctlDb::Result& _dbRes,
bool lock
);
///
/// Add the given URL to the cache
///
/// @param strFullURL - full URL
/// @param _Evt - event with results of checking
/// @param errCode - error code
/// @param _dbRes - output category results for the given URL
/// @param analyzed - true if the given item was analyzed,
/// false - the item was not analyzed (any error occurred)
///
void addToCache
(
const cStrObj& strFullURL,
cUrlFltReportEvent& _Evt,
tERROR& err,
CParctlDb::Result& _dbRes,
bool analyzed
);
///
/// Check if there are ancient records in the cache is about to be removed
///
tERROR checkForCacheCleaning( tDWORD counter );
private:
///
/// Convert the given URL to the standard appearance
///
/// @param sURL - given URL is about to be converted
/// @param buf - string buffer
/// @param url - output url with standard appearance
/// @param resolve - true if it is required to resolve IP address when given
/// @return error code
///
tERROR normalizeUrl
(
const cStrObj& sURL,
cStrBuff& buf,
CUrlListCache::tURL& url,
bool checkForIp
);
private:
///
/// Perform analyzing of given the description words
///
void analyzeWords
(
const std::vector< std::wstring >& descriptionWords,
CParctlDb::SearchResult& searchRes
);
private:
///
/// Join the currently accumulated results with the main results
///
/// @param dbSubRes - currently accumulated results
/// @param stats - statistics for currently accumulated results
/// @param dbRes - main results
/// @param totalCount - total count of processed objects to accumulate results
///
void joinDBResults
(
CParctlDb::Result& dbSubRes,
const std::vector< int >& stats,
CParctlDb::Result& dbRes,
int totalCount,
ReportInfo& info
);
///
/// Analyze the given results to make the final decision
///
/// @param _dbRes - category results for checking
/// @param nDenyCategoriesMask - category masks
///
tERROR checkDbRes
(
const CParctlDb::Result& _dbRes,
const tQWORD& denyCategoriesMask
);
///
/// Join database results to get the best possible one
///
/// @param dbRes1 - category results
/// @param dbRes2 - category results
///
void bestDbRes( const CParctlDb::Result& dbRes1, CParctlDb::Result& dbRes2 );
private:
///
/// Update detection statistics
///
/// @param err - detection error code
/// @param evt - detection event
/// @param profile - current profile to be updated
///
void updateStats
(
tDWORD err,
const cUrlFltReportEvent& evt,
tProfile* profile
);
private:
///
/// Get severity code
///
/// @param err - detection error code
/// @param evt - detection event
///
tDWORD GetSeverity( tDWORD errCode, const cUrlFltReportEvent& evt ) const;
private:
///
/// Load the content of the given URL
///
/// @param urlFlt - URL request information is about to be retrieved
/// @param pContent - content of the page
///
tERROR loadPage( cUrlFilteringRequest& urlFlt, hIO* pContent, cToken* pToken );
private:
///
/// Find the given URL in currently processed URL's
///
/// @param url - the given URL
/// @param lock - true if the call should be under lock
///
bool _findInProc( const cStrObj& url, bool lock );
///
/// Find the given URL in currently processed URL's
///
/// @param url - the given URL
///
bool findInProc( const cStrObj& url );
///
/// Mark the given URL as currently being processed
///
/// @param url - the given URL
///
void addToProc( const cStrObj& url );
///
/// Mark the given URL as currently not being in process
///
/// @param url - the given URL
///
void removeFromProc( const cStrObj& url );
///
/// Check if the given URL is currently in processing; if so,
/// wait until it is being processed
///
void checkInProc( const cStrObj& url );
public:
hCRITICAL_SECTION m_hCS;
/*
hCRITICAL_SECTION m_dbCS;
CParctlDb m_db;
*/
ParCtlDbManager m_dbManager;
// Cached requests
tCasheObjs m_cache;
hCRITICAL_SECTION m_cacheCS;
/*
// Pending requests for heuristic analyze
hCRITICAL_SECTION m_heurObjsCS;
tHeurObjs m_heurObjs;
*/
// Cache of URL's that are currently being processed
// It is important to mark requests as "being processed" especially for
// slow routines (for instance, that could spend enough time while retrieving
// the page with fault). In that case it will help to reduce amount of
// requests for this page (all other requests will use the cooked results
// from cache) and reduce total amount of time spending while request
// is being in process.
typedef std::vector< cStrObj > ProcCache;
struct ProcCacheType
{
///
/// Constructor
///
ProcCacheType();
ProcCache cache;
hCRITICAL_SECTION cs;
} m_procCache;
tDWORD m_nCache;
tDWORD m_nCacheTTL;
tDWORD m_nCacheErrTTL;
tDWORD m_nMaxHeuristicDataSize;
hOBJECT m_hHTTP;
time_t m_SystemStartTime;
tDWORD m_TimeZone;
cProxySettings m_ProxySettings;
tUsers m_users;
tUser m_defUser;
tProfiles m_profiles;
tProfile m_common;
cStrObj m_sDatabase;
cStrObj m_sDatabaseUpdCat;
tDWORD m_nFilterMsgClass;
cAskObjectAction m_AskActionDef;
unsigned m_fHeuristicSuccess : 1;
unsigned m_fHeuristic : 1;
unsigned m_fHeuristicOnly : 1;
unsigned m_fHeuristicContentDescr : 1;
unsigned m_fHeuristicContentUrls : 1;
unsigned m_fProfiles : 1;
unsigned m_fAskAction : 1;
unsigned m_fCheckMainPage : 1;
unsigned m_fUseReportFile : 1;
hCRITICAL_SECTION m_hCsTrMgr;
cAutoObj<cProxyServerAddressDetector> m_proxydetect;
tTrObjs m_TrObjs;
tDWORD m_nTrMax;
tDWORD m_nTranspNetTimeout;
unsigned m_fTrMgrWork : 1;
#ifdef _DEBUG
cThreadPoolBase m_ThreadTest;
#endif // _DEBUG
typedef UrlFltTTLCache< std::string, std::string > DnsCache;
DnsCache m_dnsCache;
hCRITICAL_SECTION m_dnsCacheCS;
// AVP Prague stamp begin( C++ class declaration end, )
public:
mDECLARE_INITIALIZATION(UrlFlt)
};
// AVP Prague stamp end
///
/// Constructor
///
inline
UrlFlt::ProcCacheType::ProcCacheType():
cache(),
cs( NULL )
{
}
// AVP Prague stamp begin( Header endif, )
#endif // task_cpp
// AVP Prague stamp end
| [
"idrez.mochamad@gmail.com"
] | idrez.mochamad@gmail.com |
37e1c80c487142dd7f63b2f2f9a55b8f96b42db1 | d99ab6e8586f76c6e6bdec1b2fba73e7d892f5e8 | /STL/bitset.cpp | df3136a6f9e61ac00eb111ee600eac27c3ead124 | [] | no_license | jindalshivam09/cppcodes | 661d368c77793a0c8170397711c1eec9eeff1e27 | c2913c4d3e144de7a0a60749b675e2f661d5b07b | refs/heads/master | 2021-05-16T02:39:47.452998 | 2020-07-26T18:45:42 | 2020-07-26T18:45:42 | 23,185,118 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 315 | cpp | #include<iostream>
#include<bitset>
using namespace std;
main() {
bitset<8> b(string("10011"));
cout << b.to_ulong() << endl;
cout << b.to_string() << endl;
cout << boolalpha << b.any();
cout << endl;
bitset<8> v = b <<1;
cout << v << endl;
//b <<= 1;
cout << b << endl;
b=b|v;
cout << b << endl;
}
| [
"jindalshivam09@gmail.com"
] | jindalshivam09@gmail.com |
9b91eac6a1b5c7c2596ae0ce68a92d42923e7e5f | 80b70f2b7fc6898f49049810781c6afda00868c7 | /No Category/Medium/Triple-Sum.cpp | 6e90fb4a173cc6a0d97d0eef654fb82b22381bf5 | [
"MIT"
] | permissive | Justin-Teng/HackerRank | b41552a35c611fa6b1687ade5b21d4afb8007d59 | bb501715d4fb0322ccffa70b75c4d6df1463a334 | refs/heads/master | 2020-03-25T00:47:38.140314 | 2019-06-13T15:24:33 | 2019-06-13T15:24:33 | 143,206,178 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,919 | cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
// Complete the triplets function below.
long triplets(vector<int> a, vector<int> b, vector<int> c) {
sort(a.begin(), a.end());
sort(b.begin(), b.end());
sort(c.begin(), c.end());
// Remove duplicates
a.erase(unique(a.begin(), a.end()), a.end());
b.erase(unique(b.begin(), b.end()), b.end());
c.erase(unique(c.begin(), c.end()), c.end());
long count = 0;
int a_i = a.size()-1;
int c_i = c.size()-1;
for (int b_i = b.size()-1; b_i >= 0; b_i--) {
int b_val = b[b_i];
while (a[a_i] > b_val) {
a_i--;
if (a_i < 0)
return count;
}
while (c[c_i] > b_val) {
c_i--;
if (c_i < 0)
return count;
}
count += static_cast<long>(a_i+1) * (c_i+1);
}
return count;
}
int main()
{
ofstream fout(getenv("OUTPUT_PATH"));
string lenaLenbLenc_temp;
getline(cin, lenaLenbLenc_temp);
vector<string> lenaLenbLenc = split_string(lenaLenbLenc_temp);
int lena = stoi(lenaLenbLenc[0]);
int lenb = stoi(lenaLenbLenc[1]);
int lenc = stoi(lenaLenbLenc[2]);
string arra_temp_temp;
getline(cin, arra_temp_temp);
vector<string> arra_temp = split_string(arra_temp_temp);
vector<int> arra(lena);
for (int i = 0; i < lena; i++) {
int arra_item = stoi(arra_temp[i]);
arra[i] = arra_item;
}
string arrb_temp_temp;
getline(cin, arrb_temp_temp);
vector<string> arrb_temp = split_string(arrb_temp_temp);
vector<int> arrb(lenb);
for (int i = 0; i < lenb; i++) {
int arrb_item = stoi(arrb_temp[i]);
arrb[i] = arrb_item;
}
string arrc_temp_temp;
getline(cin, arrc_temp_temp);
vector<string> arrc_temp = split_string(arrc_temp_temp);
vector<int> arrc(lenc);
for (int i = 0; i < lenc; i++) {
int arrc_item = stoi(arrc_temp[i]);
arrc[i] = arrc_item;
}
long ans = triplets(arra, arrb, arrc);
fout << ans << "\n";
fout.close();
return 0;
}
vector<string> split_string(string input_string) {
string::iterator new_end = unique(input_string.begin(), input_string.end(), [] (const char &x, const char &y) {
return x == y and x == ' ';
});
input_string.erase(new_end, input_string.end());
while (input_string[input_string.length() - 1] == ' ') {
input_string.pop_back();
}
vector<string> splits;
char delimiter = ' ';
size_t i = 0;
size_t pos = input_string.find(delimiter);
while (pos != string::npos) {
splits.push_back(input_string.substr(i, pos - i));
i = pos + 1;
pos = input_string.find(delimiter, i);
}
splits.push_back(input_string.substr(i, min(pos, input_string.length()) - i + 1));
return splits;
}
| [
"noreply@github.com"
] | noreply@github.com |
dcce6afe8b49215f01e4268d9194bcbf57a6e8fa | 5fe634e7327f5f62bcafa356e76d46f07b794b36 | /CPPPrimer/src/06-function/6-1.cpp | fc8a1973811419e454da6e0ce6fcdfa790a2b985 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | MarsonShine/Books | 8433bc1a5757e6d85e9cd649347926cfac59af08 | 7265c8a6226408ae687c796f604b35320926ed79 | refs/heads/master | 2023-08-31T05:32:35.202491 | 2023-08-30T10:29:26 | 2023-08-30T10:29:26 | 131,323,678 | 29 | 3 | Apache-2.0 | 2022-12-07T13:01:31 | 2018-04-27T17:00:17 | C# | UTF-8 | C++ | false | false | 1,310 | cpp | #include<stdio.h>
#include<iostream>
// 局部静态变量
// 其生命周期是跟随程序的终止而结束(销毁)
size_t count_calls() {
static size_t ctr = 0;
return ++ctr;
}
size_t count_calls2() {
size_t ctr = 0;
return ++ctr;
}
// 函数申明
// 与函数定义不同,函数申明只需要定义名称和签名,无需函数体。
// 一般是在头文件.h中函数申明,这样能确保同一函数名一致。
// 详见 ./head/example.h
// 分离式编译(separate compilation),允许把程序分割到几个文件中去,每个文件独立编译。
// CC factMain.cc fact.cc # generates factMain.exe or a.out
// CC factMain.cc fact.cc -o main # generates main or main.exe
// 然后编译器负责把对象文件链接到一起形成可执行文件。
// 完整编译执行过程
// CC -c factMain.cc # generates factMain.o
// CC -c fact.cc # generates fact.o
// CC factMain.o fact.o # generates factMain.exe or a.out
// CC factMain.o fact.o -o main # generates main or main.exe
int main()
{
for (size_t i = 0; i != 10; ++i)
{
std::cout << count_calls() << std::endl;
}
std::cout << "局部变量" << std::endl;
for (size_t i = 0; i != 10; ++i)
{
std::cout << count_calls2() << std::endl;
}
return 0;
} | [
"ms27946@outlook.com"
] | ms27946@outlook.com |
24912d6f810e7fdc99cbb94c7d894bfa9f07db95 | 4ff5cb35b392e8f17d99c2f395fc054b583b7b6c | /multipleFiles/multipleFiles.ino | 0f1ce39bb01f967fc70f30adabc015c8aae0ea60 | [] | no_license | brjathu/arduino_codes | f07518ce16cb358a3d0f7ed6e2874e122198f6e8 | f6ae7e20918a645282137e38b04982c3515b0695 | refs/heads/master | 2021-07-09T14:50:58.047403 | 2017-10-10T07:41:20 | 2017-10-10T07:41:20 | 106,384,433 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 191 | ino | #include "support.h"
int x=5;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
printFun();
}
| [
"brjathu@gmail.com"
] | brjathu@gmail.com |
8d4002157c8a1a42a714a92a46ced5345c204e23 | 068505e9db9c96e2bb5768cf503fd5a0308e2c79 | /CrackingTheCodingInterview/Version6/LinkedLists/PalindromeList.cpp | d43652811295f66dffe62f17761df6dfe214bd41 | [
"MIT"
] | permissive | naruse/challenges | 1cdbf31a33a57e0de1f99f918c560619176b2ecc | 52baab6c5ad95c4774f737034073149efa3fa613 | refs/heads/master | 2021-05-06T21:40:06.265852 | 2020-07-23T20:03:13 | 2020-07-23T20:03:13 | 112,553,120 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,096 | cpp | // Implement a function to check if a linked list is a palindrome.
//APPROACH:
//have 2 pointers one move 1 node the other moves 2 nodes each time and start
//storing values on a stack for the 1rst node. When the 2nd pointer reaches
//the end start popping from the stack and compare.
#include <iostream>
#include <stack>
class Node {
public:
int data;
Node* next;
Node(int _d) { data = _d; next = nullptr; }
Node* AddToTail(int ds) {
Node* current = this;
Node* nodeToAdd = new Node(ds);
while(current->next != nullptr)
current = current->next;
current->next = nodeToAdd;
return nodeToAdd;
}
};
void Print(Node* head) {
if(head == nullptr)
return;
Node* current = head;
while(current != nullptr) {
std::cout << current->data << " -> ";
current = current->next;
}
std::cout << std::endl;
}
bool IsPalindrome(Node* head) {
if(head == nullptr)
return false;
Node* slow = head;
Node* fast = head->next;
std::stack<int> detectedValues;
bool needToMove = false;
//lets get to the middle of the list.
while(fast != nullptr) {
std::cout << "\nAdding: " << slow->data;
detectedValues.push(slow->data);
slow = slow->next;
fast = fast->next;
if(fast != nullptr) {
needToMove = true;
fast = fast->next;
} else
needToMove = false;
}
//by here we are in the middle of the list
if(needToMove)
slow = slow->next;
//now lets start checking if its a palindrome
while(slow != nullptr) {
if(detectedValues.top() != slow->data)
return false;
slow = slow->next;
detectedValues.pop();
}
return true;
}
int main() {
Node* head = new Node(4);
head->AddToTail(3);
head->AddToTail(3);
//head->AddToTail(66);
head->AddToTail(4);
std::cout << "List to check:\n";
Print(head);
std::cout << "Is palindrome: " << (IsPalindrome(head) ? "true" : "false") << "\n";
}
| [
"naruse@gmail.com"
] | naruse@gmail.com |
38e82f9b6344c821e844309ce642dccc583cc8ea | 63b780d4f90e6c7c051d516bf380f596809161a1 | /FreeEarthSDK/src/FeKits/cockPit/meter/MeterManager.cpp | c20527a2fb7dbb4005293f502f4772e8634b9b72 | [] | no_license | hewuhun/OSG | 44f4a0665b4a20756303be21e71f0e026e384486 | cfea9a84711ed29c0ca0d0bfec633ec41d8b8cec | refs/heads/master | 2022-09-05T00:44:54.244525 | 2020-05-26T14:44:03 | 2020-05-26T14:44:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,622 | cpp | #include <FeKits/cockPit/meter/MeterManager.h>
#include <cstring>
CMeterManager::CMeterManager(void) :
FeUtil::TiXmlDocument()
{
}
CMeterManager::CMeterManager( const char* cDocumentName ) :
FeUtil::TiXmlDocument(cDocumentName)
{
if (LoadFile(cDocumentName))
{
InitializeMeters();
}
}
CMeterManager::~CMeterManager(void)
{
}
void CMeterManager::InitializeMeters()
{
FeUtil::TiXmlElement* pRoot = this->RootElement();
if (!pRoot)
{
return;
}
collectMeterXmlNode(pRoot);
collectLoadingMeterID(pRoot);
createMeterAttibuteList(UnValueMeter);
}
void CMeterManager::collectMeterXmlNode( FeUtil::TiXmlElement* pRoot )
{
#ifndef METERNODETYPE
#define METERNODETYPE
#define METER "Meter"
#endif
if (!pRoot)
{
return;
}
FeUtil::TiXmlElement* pChild = pRoot->FirstChildElement(METER);
while(pChild)
{
m_vecMeterXmlNode.push_back(pChild);
pChild = pChild->NextSiblingElement(METER);
}
}
void CMeterManager::collectLoadingMeterID( FeUtil::TiXmlElement* pRoot )
{
#ifndef METERID
#define METERID
#define LAOD_METER_ID "LoadMeterID"
#define METER_ID "MeterID"
#endif
if (!pRoot)
{
return;
}
FeUtil::TiXmlElement* pLoadMeterIDlist = pRoot->FirstChildElement(LAOD_METER_ID);
if (!pLoadMeterIDlist)
{
return;
}
FeUtil::TiXmlElement* pLoadMeterID = pLoadMeterIDlist->FirstChildElement(METER_ID);
while(pLoadMeterID)
{
m_setLoadMeterID.insert((MeterType)(atoi(pLoadMeterID->FirstChild()->Value())));
pLoadMeterID = pLoadMeterID->NextSiblingElement(METER_ID);
}
}
bool CMeterManager::LoadMeterNodeToScene( bool bflag, MeterType ID, ... )
{
if (!bflag)
{
return false;
}
else
{
va_list vap;
va_start(vap, ID);
while(ID != UnValueMeter)
{
createMeterAttibuteList(ID);
ID = va_arg(vap, MeterType);
}
va_end(vap);
}
return true;
}
bool CMeterManager::createMeterAttibuteList( MeterType ID )
{
if (m_setLoadMeterID.size() <= 0)
{
return false;
}
if (m_vecMeterXmlNode.size() <= 0)
{
return false;
}
//创建仪表信息列表
for (int i=0; i< m_vecMeterXmlNode.size(); i++)
{
FeUtil::TiXmlElement* pTemp = m_vecMeterXmlNode.at(i);
RecordMeterAttribute(pTemp);
}
return true;
}
void CMeterManager::RecordMeterAttribute( FeUtil::TiXmlElement* pTixmlElement )
{
#ifndef METER_ATTRIBUTE
#define METER_ATTRIBUTE
#define OBJECT_NAME "object-name"
#define POS "position"
#define SCALE "scale"
#endif
SMeterAttribute sMeterAttribute;
SXYZ sXYZ;
FeUtil::TiXmlElement* pObjectNameAttri = pTixmlElement->FirstChildElement(OBJECT_NAME);
FeUtil::TiXmlElement* pPosAttri = pTixmlElement->FirstChildElement(POS);
FeUtil::TiXmlElement* pScaleAttri = pTixmlElement->FirstChildElement(SCALE);
if (pObjectNameAttri)
{
sMeterAttribute.strMeterName = pObjectNameAttri->FirstChild()->Value();
}
if (pPosAttri)
{
sXYZ.x = atof(pPosAttri->FirstChild("x")->FirstChild()->Value());
sXYZ.y = atof(pPosAttri->FirstChild("y")->FirstChild()->Value());
sXYZ.z = atof(pPosAttri->FirstChild("z")->FirstChild()->Value());
sMeterAttribute.position = sXYZ;
}
if (pScaleAttri)
{
sXYZ.x = atof(pScaleAttri->FirstChild("x")->FirstChild()->Value());
sXYZ.y = atof(pScaleAttri->FirstChild("y")->FirstChild()->Value());
sXYZ.z = atof(pScaleAttri->FirstChild("z")->FirstChild()->Value());
sMeterAttribute.scale = sXYZ;
}
m_vecMeterAttributeList.push_back(sMeterAttribute);
}
int CMeterManager::ReturnMeterIndex( std::string strMeterName )
{
for (int i=0; i<m_vecMeterAttributeList.size(); i++)
{
if (std::strcmp(strMeterName.c_str(), m_vecMeterAttributeList.at(i).strMeterName.c_str()) == 0)
{
return i;
}
}
return 0;
}
| [
"Wang_123456"
] | Wang_123456 |
61271f2ad590e49ec4726a08880e02be66129e08 | ba929abc82b0553dfd6b624407fd6f1e02108b50 | /Matrice/include/Matrice/algs/similarity/_icgn_impl.h | 895932f8977db40978947dbbef51f3e6f9784da1 | [] | no_license | sdongem/matrice_preview | d8d5b02a82694249bec58bbfa2b84be82061cb17 | 6c41e1be9484c54e9998aba8126b341cb9da09d5 | refs/heads/master | 2020-04-08T04:40:48.898925 | 2018-11-25T07:52:36 | 2018-11-25T07:52:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,396 | h | /*********************************************************************
This file is part of Matrice, an effcient and elegant C++ library.
Copyright(C) 2018, Zhilong(Dgelom) Su, all rights reserved.
This program is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.If not, see <http://www.gnu.org/licenses/>.
***********************************************************************/
#pragma once
#include "../../core/matrix.h"
#include "../../core/vector.h"
#include "../../core/solver.h"
#include "../../core/tensor.h"
#include "_similarity_traits.h"
MATRICE_ALGS_BEGIN
template<size_t _Options> struct _Iterative_conv_options
{
// \interpolation type
enum { options = _Options };
// \subset radius, default value is 10
size_t _My_radius = 10;
// \spacing between adjacent nodes, valid only for regular lattice
size_t _My_stride = 7;
// \maximum iterations, default is 50
size_t _My_maxits = 50;
// \termination tolerance condition of refinement iteration
default_type _My_epsilon = 1.0E-6;
MATRICE_GLOBAL_FINL auto& operator()() { return (_My_radius); }
MATRICE_GLOBAL_FINL const auto& operator()() const { return (_My_radius); }
MATRICE_GLOBAL_FINL operator default_type() { return _My_epsilon; }
};
namespace detail {
// \TEMPLATE base class for Gaussian-Newton algorithm [thread-safe]
template<typename _Derived> class _Iterative_conv_base
{
using _Mydt = _Derived;
using _Mytraits = internal::conv_solver_traits<_Mydt>;
using value_type = typename _Mytraits::value_type;
protected:
enum {DOF = _Mytraits::order*6}; //DOF
using stack_vector = Vec_<value_type, DOF>;
using stack_matrix = Matrix_<value_type, DOF, DOF>;
using matrix_type = Matrix<value_type>;
using const_matrix_reference = const std::add_lvalue_reference_t<matrix_type>;
using param_type = stack_vector;
using linear_op = linear_alg_op::Auto<matrix_type>;
using options_type = _Iterative_conv_options<_Mytraits::interp>;
using interp_type = typename interpolation<value_type, _Mytraits::interp>::type;
struct status_type
{
bool _Is_success = false;
value_type _Value_1 = std::numeric_limits<value_type>::quiet_NaN();
value_type _Value_2 = std::numeric_limits<value_type>::quiet_NaN();
};
public:
using value_t = typename matrix_type::value_t;
using pointer = std::add_pointer_t<value_t>;
using point_t = Vec_<value_t, internal::static_size<2>::value>;
_Iterative_conv_base(
const multi_matrix<value_type>& _F,
const std::shared_ptr<interp_type>& _Itp,
const point_t& _Initpos,
const options_type& _Opts)
:m_reference(_F), _Myitp(_Itp),
m_pos(_Initpos), m_options(_Opts),
m_ksize(_Opts() << 1 | 1),
m_current(matrix_type(m_ksize, m_ksize, 0.)) {
_Myhess.format = symm;
}
// \set initial pos
MATRICE_HOST_FINL auto& pos() { return (m_pos); }
// \get refined pos
MATRICE_HOST_FINL const auto& pos() const { return (m_pos); }
protected:
// \engine for iterative solver
template<typename... _Args>
MATRICE_HOST_FINL auto _Solve(_Args... _Args) {
return static_cast<_Mydt*>(this)->_Impl(_Args...);
}
MATRICE_HOST_FINL auto _Update_subset(const param_type& _P);
// \feature position: m_pos[new] <-- m_pos[old] + delta_pos
point_t m_pos;
// \options for iterative refinement
options_type m_options;
// \kernel size
std::size_t m_ksize;
// \current image buffer: G
matrix_type m_current;
// \view of reference image and its gradients: F, dFdx, dFdy
const multi_matrix<value_type>& m_reference;
// \precomputed interpolation coeff.
std::shared_ptr<interp_type> _Myitp;
// \Jacobian
tensor<value_type, 1, DOF> _Myjaco;
// \Hessian
stack_matrix _Myhess;
};
// TEMPLATE impl class for IC-GN optimization [thread-safe]
template<typename _Ty = float,
std::size_t _Itp = bcspline, std::size_t _Ord = 1>
class _Invcomp_conv_impl MATRICE_NONHERITABLE
: public _Iterative_conv_base<_Invcomp_conv_impl<_Ty, _Itp, _Ord>>
{
using _Myt = _Invcomp_conv_impl;
using _Mybase = _Iterative_conv_base<_Myt>;
using typename _Mybase::options_type;
using typename _Mybase::const_matrix_reference;
using typename _Mybase::param_type;
using typename _Mybase::stack_vector;
using typename _Mybase::interp_type;
using value_type = typename _Mybase::value_t;
public:
enum { options = options_type::options };
using value_t = value_type;
using options_t = options_type;
using param_t = param_type;
using typename _Mybase::point_t;
MATRICE_HOST_FINL _Invcomp_conv_impl(const multi_matrix<value_t>& _Ref, const std::shared_ptr<interp_type>& _Itp, point_t _Initp, options_t _Opts = options_t()) noexcept
: _Mybase(_Ref, _Itp, _Initp, _Opts) {
_Init();
}
MATRICE_HOST_FINL auto _Impl(param_type& _Params);
private:
MATRICE_HOST_FINL auto _Init();
MATRICE_HOST_FINL auto _Update();
value_type m_favg = 0, m_fssd = 0;
using _Mybase::m_ksize;
using _Mybase::m_current;
};
}
MATRICE_ALGS_END
#include "inline\_iterative_conv_impl.inl"
| [
"su-zl@seu.edu.cn"
] | su-zl@seu.edu.cn |
35acb1074ed0440b0dcc9209e8b4467095a0dfbc | d91272f7ce1549b1e08f4d7dd05ecc2ce85bab96 | /841/B.cpp | b5445f754776d98357798079d9d67de20f653a0b | [] | no_license | Ar-Sibi/Competitive-Programming | 81672229d870763292b2e010b62b899952bdc6dc | df4ed257140909755d8b639649e19c325f4619f6 | refs/heads/master | 2022-04-16T13:31:26.989506 | 2020-04-12T16:24:46 | 2020-04-12T16:24:46 | 159,475,953 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 445 | cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
cin.tie(NULL);
ios_base::sync_with_stdio( false );
int x;
long long sum=0;
cin>>x;
bool oddpresent = false;
while(x--){
int y;
cin>>y;
if(y%2==1)
oddpresent=true;
sum+=y;
}
if(sum%2==0){
if(oddpresent)
cout<<"First";
else
cout<<"Second";
}else{
cout<<"First";
}
} | [
"getgoingwithsibi@gmail.com"
] | getgoingwithsibi@gmail.com |
6ba15e2d73462aec61b7f4d723728f4c9dd11931 | 21d31bd5be404b5507b5b06c7cd1c2a961589891 | /dmaps/diffusion_map.cpp | d4f7d20d77ce614a1d7d10ce7f82ff07c2cacf91 | [
"MIT"
] | permissive | Markusjsommer/dmaps | 7448f2a11404a2da12027112737599575ffb32e6 | e260724727cc14423b7ef09975649e274c004fc0 | refs/heads/master | 2020-04-26T05:46:33.112065 | 2018-08-28T17:42:40 | 2018-08-28T17:42:40 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,434 | cpp | #include <stdexcept>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <Eigen/Core>
#include <spectra/GenEigsSolver.h>
#include "diffusion_map.h"
#include "distance_matrix.h"
#ifdef _OPENMP
#include <omp.h>
#endif
using namespace Spectra;
namespace dmaps
{
diffusion_map::diffusion_map(const matrix_t& d, const vector_t& w, int num_threads) :
dint_(d), d_(dint_), w_(w)
{
check_params();
#ifdef _OPENMP
if(num_threads) omp_set_num_threads(num_threads);
#endif
}
diffusion_map::diffusion_map(const distance_matrix& dm, const vector_t& w, int num_threads) :
d_(dm.get_distances()), w_(w)
{
check_params();
#ifdef _OPENMP
if(num_threads) omp_set_num_threads(num_threads);
#endif
}
void diffusion_map::check_params()
{
if(d_.cols() != d_.rows())
throw std::invalid_argument("Distance matrix must be square.");
if(w_.size() == 0)
w_ = vector_t::Ones(d_.cols());
else if(w_.size() != d_.cols())
throw std::invalid_argument("Weights vector length must match distance matrix size.");
}
void diffusion_map::set_kernel_bandwidth(f_type eps)
{
if(eps <= 0)
throw std::invalid_argument("Kernel bandwidth must be positive.");
eps_ = eps;
}
f_type diffusion_map::get_kernel_bandwidth() const
{
return eps_;
}
f_type diffusion_map::sum_similarity_matrix(f_type eps, f_type alpha) const
{
matrix_t wwt = w_*w_.transpose();
return ((-0.5/eps*d_.array().square().pow(alpha)).exp()*wwt.array()).sum();
}
/*
void diffusion_map::estimate_local_scale(int k)
{
// Default choice of k.
if(k == 0) k = static_cast<int>(std::sqrt(d_.rows()));
// Set local epsilon scale for each entry.
#ifdef _OPENMP
#pragma omp parallel
#endif
{
// Create sort indexer.
std::vector<size_t> idx(d_.rows());
std::iota(std::begin(idx), std::end(idx), static_cast<size_t>(0));
#ifdef _OPENMP
#pragma for schedule(static)
#endif
for(size_t i = 0; i < eps_.size(); ++i)
{
const vector_t& dist = d_.row(i);
// Get indices of sorted distances (ascending).
std::sort(std::begin(idx), std::end(idx),
[&](size_t a, size_t b) { return dist[a] < dist[b]; }
);
// Sum and determine weight.
// We skip the first element which is itself.
f_type sum = 0.;
for(size_t j = 1; j < idx.size(); ++j)
{
sum += w_[idx[j]];
// Break at k value.
if(sum >= k)
{
eps_[i] = dist[idx[j]];
break;
}
}
}
}
}
*/
void diffusion_map::compute(int n, f_type alpha, f_type beta)
{
if(eps_ == 0)
throw std::runtime_error("Kernel bandwidth must be defined before computing diffusion coordinates.");
if(alpha <= 0 || alpha > 1)
throw std::invalid_argument("Distance scaling must be in the interval (0,1].");
// Compute similarity matrix and row normalize
// to get right stochastic matrix.
k_ = -0.5/eps_*d_.array().square().pow(alpha);
k_.array() = k_.array().exp();
k_.array() *= (w_*w_.transpose()).array();
// Density normalization.
vector_t rsum = k_.rowwise().sum().array().pow(-beta);
k_ = rsum.asDiagonal()*k_*rsum.asDiagonal();
// Right stochastic matrix.
rsum = k_.rowwise().sum().array().cwiseInverse();
k_ = rsum.asDiagonal()*k_;
// Define eigensolver.
DenseGenMatProd<f_type> op(k_);
GenEigsSolver <f_type, LARGEST_MAGN, DenseGenMatProd<f_type>> eigs(&op, n, 2*n);
// Solve.
eigs.init();
eigs.compute();
if(eigs.info() != SUCCESSFUL)
throw std::runtime_error("Eigensolver did not converge.");
dvals_ = eigs.eigenvalues().real();
dvecs_ = eigs.eigenvectors().real();
}
vector_t diffusion_map::nystrom(const vector_t& distances, f_type alpha, f_type beta)
{
if(dvals_.size() == 0)
throw std::runtime_error("Eigenvectors must be computed first.");
vector_t k = -0.5/eps_*distances.array().square().pow(alpha);
k.array() = k.array().exp();
k /= k.sum();
vector_t point(dvals_.size());
for(int i = 0; i < dvals_.size(); ++i)
point[i] = 1./dvals_[i]*(k.array()*dvecs_.col(i).array()).sum();
return point;
}
const matrix_t& diffusion_map::get_eigenvectors() const
{
return dvecs_;
}
const vector_t& diffusion_map::get_eigenvalues() const
{
return dvals_;
}
const matrixc_t& diffusion_map::get_kernel_matrix() const
{
return k_;
}
} | [
"sidky@outlook.com"
] | sidky@outlook.com |
d10bde1b6a492d06b5b86bc59939a162e96cebfc | 003d8fea3077ede86e4785411424a5acf622252f | /example/txpl/vm/scope1.cpp | edb0f0d91dac8189a184cac6f181b525ba22f843 | [
"BSL-1.0"
] | permissive | ptomulik/txpl | c43f961f160dcdee968fc214b5196b934a4ca514 | 109b5847abe0d46c598ada46f411f98ebe8dc4c8 | refs/heads/master | 2021-06-20T02:01:54.072229 | 2015-05-19T07:14:38 | 2015-05-19T07:14:38 | 31,542,106 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,444 | cpp | // Copyright (C) 2015, Pawel Tomulik <ptomulik@meil.pw.edu.pl>
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/** // doc: txpl/vm/scope1.cpp {{{
* \file txpl/vm/scope1.cpp
* \example txpl/vm/scope1.cpp
* \brief Usage example for \ref txpl::vm::scope "vm::scope<>"
*/ // }}}
// [Code]
#include <txpl/vm/scope.hpp>
#include <txpl/vm/scope_insert.hpp>
#include <txpl/vm/scope_lookup.hpp>
#include <txpl/vm/basic_types.hpp>
#include <txpl/vm/io.hpp>
#include <boost/variant/get.hpp>
#include <iostream>
void print_symbol(int no, txpl::vm::symbol<> const& sym)
{
using namespace txpl::vm;
value<> const* vp = boost::get<value<> >(&sym);
if(vp)
std::cout << no << ": " << *vp << std::endl;
else
std::cout << no << ": not a value" << std::endl;
}
int main()
{
using namespace txpl::vm;
typedef scope<>::key_type K;
scope<> global;
symbol<> sym;
scope_insert(global, K("var"), value<>('a'));
scope_insert(global, K("ns1::var"), value<>('b'));
scope_insert(global, K("ns1::ns2::var"), value<>('c'));
// 1: lookup for "var" in global scope
if(scope_lookup(global, K(""), K("var"), sym))
print_symbol(1, sym);
else
std::cout << "1: error" << std::endl;
// 2: lookup for "ns1::var" in global scope
if(scope_lookup(global, K(""), K("ns1::var"), sym))
print_symbol(2, sym);
else
std::cout << "2: error" << std::endl;
// 3: lookup for "ns2::var" in global scope (shall not be found)
if(scope_lookup(global, K(""), K("ns2::var"), sym))
print_symbol(3, sym);
else
std::cout << "3: error" << std::endl;
// 4: lookup for "ns1::ns2::var" in global scope
if(scope_lookup(global, K(""), K("ns1::ns2::var"), sym))
print_symbol(4, sym);
else
std::cout << "4: error" << std::endl;
// 5: lookup for "var" starting from "ns1" scope
if(scope_lookup(global, K("ns1"), K("var"), sym))
print_symbol(5, sym);
else
std::cout << "5: error" << std::endl;
// 6: lookup for "var" starting from "ns1::ns2" scope
if(scope_lookup(global, K("ns1::ns2"), K("var"), sym))
print_symbol(6, sym);
else
std::cout << "6: error" << std::endl;
// 7: lookup for "ns1::var" starting from "ns1:ns2" scope
if(scope_lookup(global, K("ns1::ns2"), K("ns1::var"), sym))
print_symbol(7, sym);
else
std::cout << "7: error" << std::endl;
// 8: lookup for "::var" (absolute name!)
if(scope_lookup(global, K("ns1::ns2"), K("::var"), sym))
print_symbol(8, sym);
else
std::cout << "8: error" << std::endl;
// 9: lookup for "abc::xyx" in global scope (shall not be found!)
if(scope_lookup(global, K(""), K("abc::xyz"), sym))
print_symbol(9, sym);
else
std::cout << "9: error" << std::endl;
// 10: lookup for "var" starting from "abc" scope (shall not be found!)
if(scope_lookup(global, K("abc"), K("var"), sym))
print_symbol(10, sym);
else
std::cout << "10: error" << std::endl;
// 11: lookup for "ns2" starting from "ns1" scope (shall find a scope)
if(scope_lookup(global, K("ns1"), K("ns2"), sym))
print_symbol(11, sym);
else
std::cout << "11: error" << std::endl;
return 0;
}
// [Code]
/* [Output] *
1: a
2: b
3: error
4: c
5: b
6: c
7: b
8: a
9: error
10: error
11: not a value
* [Output] */
// vim: set expandtab tabstop=2 shiftwidth=2:
// vim: set foldmethod=marker foldcolumn=4:
| [
"ptomulik@meil.pw.edu.pl"
] | ptomulik@meil.pw.edu.pl |
901a421feb8ddb3566a32394ef2b35e37d06e202 | 76d02d9f63c90f36a74f0c9fb2ee00d7838001c2 | /src/ias/network/util.h | 2c1f0e2955f87aee9059a1833f57e1d68d8bb119 | [
"Apache-2.0"
] | permissive | JoeriHermans/Intelligent-Automation-System | 7630d33922fbef87ee3a673282da0b7809643c19 | b09c9f2b0c018ac5d12ab01d25297a0a92724e4c | refs/heads/master | 2020-12-20T07:42:22.062147 | 2016-04-12T09:31:39 | 2016-04-12T09:31:39 | 22,039,895 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 3,145 | h | /**
* A set of network utility functions.
*
* @date December 13, 2014
* @author Joeri HERMANS
* @version 0.1
*
* Copyright 2014 Joeri HERMANS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef NETWORK_UTIL_H_
#define NETWORK_UTIL_H_
// BEGIN Includes. ///////////////////////////////////////////////////
// System dependencies.
#include <string>
// END Includes. /////////////////////////////////////////////////////
/**
* A function which connect tries to connect to the specified address and port.
*
* @pre The specified address cannot be equal to the empty string, and the
* specified port has to be larger than 0.
* @param address
* The address of the remote host, this can be an IP address or a FQDN.
* @param port
* A 16-bit port identifier, which is larger than 0.
* @return >= 0: A file descriptor associated with the connection.
* -1: Could not connect to the remote host.
*/
int connect( const std::string & address, const std::size_t port );
/**
* Connects to the specified host through the specified SOCKS proxy.
*
* @pre The specified addresses cannot be empty and the specified ports
* has to be larger than 0.
* @param proxyAddress
* The address of the SOCKS proxy.
* @param proxyPort
* The port of the SOCKS proxy.
* @param address
* The address of the host we wish to connect to.
* @param port
* The port of the host we wish to connect to.
* @return >= 0: A file descriptor associated with the connection.
* -1: Could not connect to the remote host.
*/
int connectToSocks( const std::string & proxyAddress,
const std::size_t proxyPort,
const std::string & address,
const std::size_t port );
/**
* Enables the SO_KEEPALIVE methodology of the specified socket.
*
* @pre The specified parameter needs to be larger or equal to zero.
* @param fd
* The file descriptor we will be manipulating.
* @return True, if the KEEPALIVE probes for the specified file descriptor is
* enabled. False in any other case.
*/
bool enableKeepAlive( const int fd );
/**
* Disables Nagle's algorithm (enabled TCP_NODELAY).
*
* @pre The specified parameter needs to be larger or equal to zero.
* @param fd
* The file descriptor we will be manipulating.
* @return True, if the TCP_NODELAY option could be set. False in any other
* case.
*/
bool disableNagle( const int fd );
#endif /* NETWORK_UTIL_H_ */
| [
"joeri@joerihermans.com"
] | joeri@joerihermans.com |
690b0a0a97aef2c1e688b9a2cc9d2ce101333699 | 27f401a4b87f164e11c881251121084762c60ee6 | /DataStructures/Model/Structures/Linear/Array.hpp | ee7116b98076e3035c1b4e48bada21bab1390d00 | [] | no_license | brandonwreich/DataStructures | 7ce08e92b8353926818da13dd939e606471c98d1 | 288e6588c9cd33c2bd1d126cee0586251ce5fef5 | refs/heads/master | 2021-05-08T23:11:07.753884 | 2018-05-29T14:53:08 | 2018-05-29T14:53:08 | 119,700,122 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,896 | hpp | //
// Array.hpp
// DataStructures
//
// Created by Reich, Brandon on 2/2/18.
// Copyright © 2018 CTEC. All rights reserved.
//
#ifndef Array_hpp
#define Array_hpp
#include <assert.h>
#include <iostream>
using namespace std;
template <class Type>
class Array
{
private:
Type * internalArray;
int size;
public:
// Contructor
Array<Type>(int size);
// Copy constructor
Array<Type>(const Array<Type> & toCopy);
// Destructor
// How you take memory away from an object
~Array<Type>();
// Operators
Array<Type> & operator = (const Array<Type> & toReplace);
Type& operator [] (int index);
Type operator [] (int index) const;
// Methods
int getSize() const;
Type getFromIndex(int index);
void setAtIndex(int index, Type data);
};
/**
Constructor that takes an int as a parameter
*/
template <class Type>
Array<Type> :: Array(int size)
{
assert(size > 0);
this -> size = size;
internalArray = new Type[size];
}
template <class Type>
Array<Type> :: Array(const Array<Type> & toCopy)
{
this -> size = toCopy.getSize();
// Build data structure
internalArray = new Type[size];
for (int index = 0; index < size; index++)
{
internalArray[index] = toCopy[index];
}
}
template <class Type>
Array<Type> :: ~Array()
{
cout << "About to delete the structure" << endl;
// Deletes the array
delete [] internalArray;
cout << "Interal array deleted" << endl;
}
template <class Type>
Array<Type> & Array<Type> :: operator = (const Array<Type> & toAssign)
{
if (&toAssign != this)
{
if (size != toAssign.getSize())
{
delete [] internalArray;
size = toAssign.getSize();
internalArray = new Type [size];
}
for (int index = 0; index < size; index++)
{
internalArray[index] = toAssign[index];
}
}
return * this;
}
template <class Type> // Left hand of = sign -- assigns to reference
Type & Array<Type> :: operator [] (int index)
{
assert(index >= 0 && index < size);
return internalArray[index];
}
template <class Type> // Right hand of = sign -- copy
Type Array<Type> :: operator [] (int index) const
{
assert(index >= 0 && index < size);
return internalArray[index];
}
/** Gets the size of the array and returns it */
template <class Type>
int Array<Type> :: getSize() const
{
return size;
}
/** Gets the object stored at the index and returns it */
template <class Type>
Type Array<Type> :: getFromIndex(int index)
{
assert(index >= 0 && index < size);
Type value = internalArray[index];
return value;
}
template <class Type>
void Array<Type> :: setAtIndex(int pos, Type item)
{
assert(pos >= 0 && pos < size);
internalArray[pos] = item;
}
#endif /* Array_hpp */
| [
"31513789+brandonwreich@users.noreply.github.com"
] | 31513789+brandonwreich@users.noreply.github.com |
232913d01d432668ff62c8f640d3c8de2511a115 | 911ac8c14ca8cb114fad7b24a5b39616d89e540b | /week-01/day-04/Increment element/main.cpp | c247ac051cb78aac8bb8522722d4dd99fd071a3e | [] | no_license | green-fox-academy/Hordon13 | 2dc9a299754e18185ce3b20f0726248c23181177 | 3f56f0274883e3b99f6683f7dbb7dc02278973c1 | refs/heads/master | 2020-05-04T10:44:55.216285 | 2019-06-21T14:39:31 | 2019-06-21T14:39:31 | 179,094,370 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 341 | cpp | #include <iostream>
#include <string>
int main(int argc, char *args[]) {
// - Create an array variable named `t`
// with the following content: `[1, 2, 3, 4, 5]`
// - Increment the third element
// - Print the third element
int t[] = {1, 2, 3, 4, 5};
t[2]++;
std::cout << t[2] << std::endl;
return 0;
} | [
"hordonandron@gmail.com"
] | hordonandron@gmail.com |
c821b09ee5abc09640dd7ca2c86ab5d82d0929bd | db7148c33aabad259c9e1acafdf6e5c49b627d46 | /Tests/Armory/build_test_game/osx-build/Sources/src/armory/logicnode/ApplyForceNode.cpp | 65a61d0f16f304cc65ee26919ee0b71eded18197 | [] | no_license | templeblock/Animations | 18472430af796d32e3f0c9dd2df1058fdb241846 | e986fa2249b998889fad78cac6ff3cc70ad196f0 | refs/heads/master | 2020-04-23T01:23:44.200377 | 2018-06-07T14:33:43 | 2018-06-07T14:33:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | true | 5,049 | cpp | // Generated by Haxe 3.4.4
#include <hxcpp.h>
#ifndef INCLUDED_armory_logicnode_ApplyForceNode
#include <armory/logicnode/ApplyForceNode.h>
#endif
#ifndef INCLUDED_armory_logicnode_LogicNode
#include <armory/logicnode/LogicNode.h>
#endif
#ifndef INCLUDED_armory_logicnode_LogicNodeInput
#include <armory/logicnode/LogicNodeInput.h>
#endif
#ifndef INCLUDED_armory_logicnode_LogicTree
#include <armory/logicnode/LogicTree.h>
#endif
#ifndef INCLUDED_iron_Trait
#include <iron/Trait.h>
#endif
#ifndef INCLUDED_iron_math_Vec4
#include <iron/math/Vec4.h>
#endif
#ifndef INCLUDED_iron_object_Object
#include <iron/object/Object.h>
#endif
HX_DEFINE_STACK_FRAME(_hx_pos_bef6d9a77e8aa009_10_new,"armory.logicnode.ApplyForceNode","new",0xbd5c47f3,"armory.logicnode.ApplyForceNode.new","armory/logicnode/ApplyForceNode.hx",10,0x47d5015b)
HX_LOCAL_STACK_FRAME(_hx_pos_bef6d9a77e8aa009_13_run,"armory.logicnode.ApplyForceNode","run",0xbd5f5ede,"armory.logicnode.ApplyForceNode.run","armory/logicnode/ApplyForceNode.hx",13,0x47d5015b)
namespace armory{
namespace logicnode{
void ApplyForceNode_obj::__construct( ::armory::logicnode::LogicTree tree){
HX_STACKFRAME(&_hx_pos_bef6d9a77e8aa009_10_new)
HXDLIN( 10) super::__construct(tree);
}
Dynamic ApplyForceNode_obj::__CreateEmpty() { return new ApplyForceNode_obj; }
void *ApplyForceNode_obj::_hx_vtable = 0;
Dynamic ApplyForceNode_obj::__Create(hx::DynamicArray inArgs)
{
hx::ObjectPtr< ApplyForceNode_obj > _hx_result = new ApplyForceNode_obj();
_hx_result->__construct(inArgs[0]);
return _hx_result;
}
bool ApplyForceNode_obj::_hx_isInstanceOf(int inClassId) {
if (inClassId<=(int)0x038099e5) {
return inClassId==(int)0x00000001 || inClassId==(int)0x038099e5;
} else {
return inClassId==(int)0x2e933162;
}
}
void ApplyForceNode_obj::run(){
HX_STACKFRAME(&_hx_pos_bef6d9a77e8aa009_13_run)
HXLINE( 14) ::iron::object::Object object = ( ( ::iron::object::Object)(this->inputs->__get((int)1).StaticCast< ::armory::logicnode::LogicNodeInput >()->get()) );
HXLINE( 15) ::iron::math::Vec4 force = ( ( ::iron::math::Vec4)(this->inputs->__get((int)2).StaticCast< ::armory::logicnode::LogicNodeInput >()->get()) );
HXLINE( 17) if (hx::IsNull( object )) {
HXLINE( 17) return;
}
HXLINE( 24) this->super::run();
}
hx::ObjectPtr< ApplyForceNode_obj > ApplyForceNode_obj::__new( ::armory::logicnode::LogicTree tree) {
hx::ObjectPtr< ApplyForceNode_obj > __this = new ApplyForceNode_obj();
__this->__construct(tree);
return __this;
}
hx::ObjectPtr< ApplyForceNode_obj > ApplyForceNode_obj::__alloc(hx::Ctx *_hx_ctx, ::armory::logicnode::LogicTree tree) {
ApplyForceNode_obj *__this = (ApplyForceNode_obj*)(hx::Ctx::alloc(_hx_ctx, sizeof(ApplyForceNode_obj), true, "armory.logicnode.ApplyForceNode"));
*(void **)__this = ApplyForceNode_obj::_hx_vtable;
__this->__construct(tree);
return __this;
}
ApplyForceNode_obj::ApplyForceNode_obj()
{
}
hx::Val ApplyForceNode_obj::__Field(const ::String &inName,hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 3:
if (HX_FIELD_EQ(inName,"run") ) { return hx::Val( run_dyn() ); }
}
return super::__Field(inName,inCallProp);
}
#if HXCPP_SCRIPTABLE
static hx::StorageInfo *ApplyForceNode_obj_sMemberStorageInfo = 0;
static hx::StaticInfo *ApplyForceNode_obj_sStaticStorageInfo = 0;
#endif
static ::String ApplyForceNode_obj_sMemberFields[] = {
HX_HCSTRING("run","\x4b","\xe7","\x56","\x00"),
::String(null()) };
static void ApplyForceNode_obj_sMarkStatics(HX_MARK_PARAMS) {
HX_MARK_MEMBER_NAME(ApplyForceNode_obj::__mClass,"__mClass");
};
#ifdef HXCPP_VISIT_ALLOCS
static void ApplyForceNode_obj_sVisitStatics(HX_VISIT_PARAMS) {
HX_VISIT_MEMBER_NAME(ApplyForceNode_obj::__mClass,"__mClass");
};
#endif
hx::Class ApplyForceNode_obj::__mClass;
void ApplyForceNode_obj::__register()
{
hx::Object *dummy = new ApplyForceNode_obj;
ApplyForceNode_obj::_hx_vtable = *(void **)dummy;
hx::Static(__mClass) = new hx::Class_obj();
__mClass->mName = HX_HCSTRING("armory.logicnode.ApplyForceNode","\x81","\xd2","\x1e","\x4b");
__mClass->mSuper = &super::__SGetClass();
__mClass->mConstructEmpty = &__CreateEmpty;
__mClass->mConstructArgs = &__Create;
__mClass->mGetStaticField = &hx::Class_obj::GetNoStaticField;
__mClass->mSetStaticField = &hx::Class_obj::SetNoStaticField;
__mClass->mMarkFunc = ApplyForceNode_obj_sMarkStatics;
__mClass->mStatics = hx::Class_obj::dupFunctions(0 /* sStaticFields */);
__mClass->mMembers = hx::Class_obj::dupFunctions(ApplyForceNode_obj_sMemberFields);
__mClass->mCanCast = hx::TCanCast< ApplyForceNode_obj >;
#ifdef HXCPP_VISIT_ALLOCS
__mClass->mVisitFunc = ApplyForceNode_obj_sVisitStatics;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mMemberStorageInfo = ApplyForceNode_obj_sMemberStorageInfo;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mStaticStorageInfo = ApplyForceNode_obj_sStaticStorageInfo;
#endif
hx::_hx_RegisterClass(__mClass->mName, __mClass);
}
} // end namespace armory
} // end namespace logicnode
| [
"neverliberty@gmail.com"
] | neverliberty@gmail.com |
38cb1e25c8383d1d021889e87458e46e6904ca9a | 460455e7990de7257aa223a58e73069f3ef7ff43 | /src/server/game/Combat/ThreatManager.h | 5f9047defccf8f31eb7f6a138855669ab21d3791 | [] | no_license | Shkipper/wmane | 2ce69adea1eedf866921c857cbc5bd1bc6d037f0 | 2da37e1e758f17b61efb6aae8fa7343b234f3dcd | refs/heads/master | 2020-04-24T19:51:51.897587 | 2019-02-25T06:14:18 | 2019-02-25T06:14:18 | 172,225,859 | 0 | 0 | null | 2019-02-23T14:49:31 | 2019-02-23T14:49:31 | null | UTF-8 | C++ | false | false | 9,506 | h | /*
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _THREATMANAGER
#define _THREATMANAGER
#include "Common.h"
#include "SharedDefines.h"
#include "LinkedReference/Reference.h"
#include "UnitEvents.h"
#include <list>
//==============================================================
class Unit;
class Creature;
class ThreatManager;
class SpellInfo;
#define THREAT_UPDATE_INTERVAL 1 * IN_MILLISECONDS // Server should send threat update to client periodically each second
//==============================================================
// Class to calculate the real threat based
struct ThreatCalcHelper
{
static float calcThreat(Unit* hatedUnit, Unit* hatingUnit, float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL);
static bool isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellInfo const* threatSpell = NULL);
};
//==============================================================
class HostileReference : public Reference<Unit, ThreatManager>
{
public:
HostileReference(Unit* refUnit, ThreatManager* threatManager, float threat);
//=================================================
void addThreat(float modThreat);
void setThreat(float threat) { addThreat(threat - getThreat()); }
void addThreatPercent(int32 percent);
float getThreat() const { return iThreat; }
bool isOnline() const { return iOnline; }
// The Unit might be in water and the creature can not enter the water, but has range attack
// in this case online = true, but accessible = false
bool isAccessible() const { return iAccessible; }
// used for temporary setting a threat and reducting it later again.
// the threat modification is stored
void setTempThreat(float threat)
{
addTempThreat(threat - getThreat());
}
void addTempThreat(float threat)
{
iTempThreatModifier = threat;
if (iTempThreatModifier != 0.0f)
addThreat(iTempThreatModifier);
}
void resetTempThreat()
{
if (iTempThreatModifier != 0.0f)
{
addThreat(-iTempThreatModifier);
iTempThreatModifier = 0.0f;
}
}
float getTempThreatModifier() { return iTempThreatModifier; }
//=================================================
// check, if source can reach target and set the status
void updateOnlineStatus();
void setOnlineOfflineState(bool isOnline);
void setAccessibleState(bool isAccessible);
//=================================================
bool operator == (const HostileReference& hostileRef) const { return hostileRef.getUnitGuid() == getUnitGuid(); }
//=================================================
uint64 getUnitGuid() const { return iUnitGuid; }
//=================================================
// reference is not needed anymore. realy delete it !
void removeReference();
//=================================================
HostileReference* next() { return ((HostileReference*) Reference<Unit, ThreatManager>::next()); }
//=================================================
// Tell our refTo (target) object that we have a link
void targetObjectBuildLink();
// Tell our refTo (taget) object, that the link is cut
void targetObjectDestroyLink();
// Tell our refFrom (source) object, that the link is cut (Target destroyed)
void sourceObjectDestroyLink();
private:
// Inform the source, that the status of that reference was changed
void fireStatusChanged(ThreatRefStatusChangeEvent& threatRefStatusChangeEvent);
Unit* getSourceUnit();
private:
float iThreat;
float iTempThreatModifier; // used for taunt
uint64 iUnitGuid;
bool iOnline;
bool iAccessible;
};
//==============================================================
class ThreatManager;
class ThreatContainer
{
friend class ThreatManager;
public:
typedef std::list<HostileReference*> StorageType;
ThreatContainer(): iDirty(false) { }
~ThreatContainer() { clearReferences(); }
HostileReference* addThreat(Unit* victim, float threat);
void modifyThreatPercent(Unit* victim, int32 percent);
HostileReference* selectNextVictim(Creature* attacker, HostileReference* currentVictim);
void setDirty(bool isDirty) { iDirty = isDirty; }
bool isDirty() const { return iDirty; }
bool empty() const
{
return iThreatList.empty();
}
HostileReference* getMostHated()
{
return iThreatList.empty() ? NULL : iThreatList.front();
}
HostileReference* getReferenceByTarget(Unit* victim);
StorageType const & getThreatList() const { return iThreatList; }
private:
void remove(HostileReference* hostileRef)
{
iThreatList.remove(hostileRef);
}
void addReference(HostileReference* hostileRef)
{
iThreatList.push_back(hostileRef);
}
void clearReferences();
// Sort the list if necessary
void update();
StorageType iThreatList;
bool iDirty;
};
//=================================================
class ThreatManager
{
public:
friend class HostileReference;
explicit ThreatManager(Unit* owner);
~ThreatManager() { clearReferences(); }
void clearReferences();
void addThreat(Unit* victim, float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL);
void doAddThreat(Unit* victim, float threat);
void modifyThreatPercent(Unit* victim, int32 percent);
float getThreat(Unit* victim, bool alsoSearchOfflineList = false);
bool isThreatListEmpty() { return iThreatContainer.empty(); }
void processThreatEvent(ThreatRefStatusChangeEvent* threatRefStatusChangeEvent);
bool isNeedUpdateToClient(uint32 time);
HostileReference* getCurrentVictim() { return iCurrentVictim; }
Unit* getOwner() { return iOwner; }
Unit* getHostilTarget();
void tauntApply(Unit* taunter);
void tauntFadeOut(Unit* taunter);
void setCurrentVictim(HostileReference* hostileRef);
void setDirty(bool isDirty) { iThreatContainer.setDirty(isDirty); }
// Reset all aggro without modifying the threadlist.
void resetAllAggro();
// Reset all aggro of unit in threadlist satisfying the predicate.
template<class PREDICATE> void resetAggro(PREDICATE predicate)
{
ThreatContainer::StorageType &threatList = iThreatContainer.iThreatList;
if (threatList.empty())
return;
for (auto itr = threatList.begin(); itr != threatList.end(); ++itr)
{
HostileReference* ref = (*itr);
if (predicate(ref->getTarget()))
{
ref->setThreat(0);
setDirty(true);
}
}
}
// methods to access the lists from the outside to do some dirty manipulation (scriping and such)
// I hope they are used as little as possible.
ThreatContainer::StorageType const & getThreatList() const { return iThreatContainer.getThreatList(); }
ThreatContainer::StorageType const & getOfflineThreatList() const { return iThreatOfflineContainer.getThreatList(); }
ThreatContainer& getOnlineContainer() { return iThreatContainer; }
ThreatContainer& getOfflineContainer() { return iThreatOfflineContainer; }
private:
void _addThreat(Unit* victim, float threat);
HostileReference* iCurrentVictim;
Unit* iOwner;
uint32 iUpdateTimer;
ThreatContainer iThreatContainer;
ThreatContainer iThreatOfflineContainer;
};
//=================================================
namespace Trinity
{
// Binary predicate for sorting HostileReferences based on threat value
class ThreatOrderPred
{
public:
ThreatOrderPred(bool ascending = false) : m_ascending(ascending) {}
bool operator() (HostileReference const* a, HostileReference const* b) const
{
return m_ascending ? a->getThreat() < b->getThreat() : a->getThreat() > b->getThreat();
}
private:
const bool m_ascending;
};
}
#endif
| [
"felianther15@gmail.com"
] | felianther15@gmail.com |
016efa20537a9fdc6231d95205660e7c2557fab9 | 3296cab14de3ba88ba01637c634f213f2345da55 | /HSDF/ExternalLibs/GeoTools/Mathematics/ContLozenge3.h | 4b8eed7e99674420165c278038ea2fa0d492ffb0 | [] | no_license | teshaTe/HybridFrep | 63b2fe47a6ce49927309743e1f708658c2f2f18d | ded2bbb917bd1f8bc22e28b35bdf86cf6b0340a7 | refs/heads/master | 2023-03-04T01:35:36.054376 | 2021-02-18T21:36:13 | 2021-02-18T21:36:13 | 158,251,562 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,964 | h | // David Eberly, Geometric Tools, Redmond WA 98052
// Copyright (c) 1998-2020
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
// https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
// Version: 4.0.2019.08.13
#pragma once
#include <Mathematics/ApprGaussian3.h>
#include <Mathematics/DistPoint3Rectangle3.h>
#include <Mathematics/Lozenge3.h>
namespace gte
{
// Compute the plane of the lozenge rectangle using least-squares fit.
// Parallel planes are chosen close enough together so that all the data
// points lie between them. The radius is half the distance between the
// two planes. The half-cylinder and quarter-cylinder side pieces are
// chosen using a method similar to that used for fitting by capsules.
template <typename Real>
bool GetContainer(int numPoints, Vector3<Real> const* points, Lozenge3<Real>& lozenge)
{
ApprGaussian3<Real> fitter;
fitter.Fit(numPoints, points);
OrientedBox3<Real> box = fitter.GetParameters();
Vector3<Real> diff = points[0] - box.center;
Real wMin = Dot(box.axis[0], diff);
Real wMax = wMin;
Real w;
for (int i = 1; i < numPoints; ++i)
{
diff = points[i] - box.center;
w = Dot(box.axis[0], diff);
if (w < wMin)
{
wMin = w;
}
else if (w > wMax)
{
wMax = w;
}
}
Real radius = (Real)0.5 * (wMax - wMin);
Real rSqr = radius * radius;
box.center += ((Real)0.5 * (wMax + wMin)) * box.axis[0];
Real aMin = std::numeric_limits<Real>::max();
Real aMax = -aMin;
Real bMin = std::numeric_limits<Real>::max();
Real bMax = -bMin;
Real discr, radical, u, v, test;
for (int i = 0; i < numPoints; ++i)
{
diff = points[i] - box.center;
u = Dot(box.axis[2], diff);
v = Dot(box.axis[1], diff);
w = Dot(box.axis[0], diff);
discr = rSqr - w * w;
radical = std::sqrt(std::max(discr, (Real)0));
test = u + radical;
if (test < aMin)
{
aMin = test;
}
test = u - radical;
if (test > aMax)
{
aMax = test;
}
test = v + radical;
if (test < bMin)
{
bMin = test;
}
test = v - radical;
if (test > bMax)
{
bMax = test;
}
}
// The enclosing region might be a capsule or a sphere.
if (aMin >= aMax)
{
test = (Real)0.5 * (aMin + aMax);
aMin = test;
aMax = test;
}
if (bMin >= bMax)
{
test = (Real)0.5 * (bMin + bMax);
bMin = test;
bMax = test;
}
// Make correction for points inside mitered corner but outside quarter
// sphere.
for (int i = 0; i < numPoints; ++i)
{
diff = points[i] - box.center;
u = Dot(box.axis[2], diff);
v = Dot(box.axis[1], diff);
Real* aExtreme = nullptr;
Real* bExtreme = nullptr;
if (u > aMax)
{
if (v > bMax)
{
aExtreme = &aMax;
bExtreme = &bMax;
}
else if (v < bMin)
{
aExtreme = &aMax;
bExtreme = &bMin;
}
}
else if (u < aMin)
{
if (v > bMax)
{
aExtreme = &aMin;
bExtreme = &bMax;
}
else if (v < bMin)
{
aExtreme = &aMin;
bExtreme = &bMin;
}
}
if (aExtreme)
{
Real deltaU = u - *aExtreme;
Real deltaV = v - *bExtreme;
Real deltaSumSqr = deltaU * deltaU + deltaV * deltaV;
w = Dot(box.axis[0], diff);
Real wSqr = w * w;
test = deltaSumSqr + wSqr;
if (test > rSqr)
{
discr = (rSqr - wSqr) / deltaSumSqr;
Real t = -std::sqrt(std::max(discr, (Real)0));
*aExtreme = u + t * deltaU;
*bExtreme = v + t * deltaV;
}
}
}
lozenge.radius = radius;
lozenge.rectangle.axis[0] = box.axis[2];
lozenge.rectangle.axis[1] = box.axis[1];
if (aMin < aMax)
{
if (bMin < bMax)
{
// Container is a lozenge.
lozenge.rectangle.center =
box.center + aMin * box.axis[2] + bMin * box.axis[1];
lozenge.rectangle.extent[0] = (Real)0.5 * (aMax - aMin);
lozenge.rectangle.extent[1] = (Real)0.5 * (bMax - bMin);
}
else
{
// Container is a capsule.
lozenge.rectangle.center = box.center + aMin * box.axis[2] +
((Real)0.5 * (bMin + bMax)) * box.axis[1];
lozenge.rectangle.extent[0] = (Real)0.5 * (aMax - aMin);
lozenge.rectangle.extent[1] = (Real)0;
}
}
else
{
if (bMin < bMax)
{
// Container is a capsule.
lozenge.rectangle.center = box.center + bMin * box.axis[1] +
((Real)0.5 * (aMin + aMax)) * box.axis[2];
lozenge.rectangle.extent[0] = (Real)0;
lozenge.rectangle.extent[1] = (Real)0.5 * (bMax - bMin);
}
else
{
// Container is a sphere.
lozenge.rectangle.center = box.center +
((Real)0.5 * (aMin + aMax)) * box.axis[2] +
((Real)0.5 * (bMin + bMax)) * box.axis[1];
lozenge.rectangle.extent[0] = (Real)0;
lozenge.rectangle.extent[1] = (Real)0;
}
}
return true;
}
// Test for containment of a point by a lozenge.
template <typename Real>
bool InContainer(Vector3<Real> const& point, Lozenge3<Real> const& lozenge)
{
DCPQuery<Real, Vector3<Real>, Rectangle3<Real>> prQuery;
auto result = prQuery(point, lozenge.rectangle);
return result.distance <= lozenge.radius;
}
}
| [
"tereshin.tesha@gmail.com"
] | tereshin.tesha@gmail.com |
033c89b56ca0e95b2871cd43c05f6ef87e553ee5 | 95a4aaa86b716a643a9ad3ebf069697a48a0f9a8 | /c.cpp | 601d560751fbf58762c8177c371d8e1312e43e8f | [] | no_license | LGuillermoUH/Estructura-de-datos | 41edad89e3bbb81ad5b4aca18e9f7142f8d269b0 | 2ec951278ed2245ba7d7e1b0094bddf0c4122022 | refs/heads/master | 2020-05-22T17:44:00.336790 | 2019-05-13T16:24:41 | 2019-05-13T16:24:41 | null | 0 | 0 | null | null | null | null | ISO-8859-10 | C++ | false | false | 1,782 | cpp | #include <cstdlib>
#include <iostream>
#include <cstdlib>
#define max 10
typedef char tipodato;
struct Pila{
int tope;
tipodato Elementos[max];
};
typedef struct Pila TipoPila;
void inicializar(TipoPila &P){
P.tope=-1;
}
bool Vacio(TipoPila P){
return(P.tope==-1);
}
bool pilallena(TipoPila P){
if(P.tope==max-1){
return true;
}else{
return false;
}
}
void inseta(TipoPila &P, char dato){
if(pilallena(P)==true){
std::cout<<"pila llena";
}else{
P.tope++;
P.Elementos[P.tope]=dato;
}
}
tipodato quita(TipoPila &P){
tipodato x;
x = NULL;
if(Vacio(P)==true){
std::cout<<"desboradmiento de pila"<<std::endl;
}else{
x=P.Elementos[P.tope];
P.tope=P.tope-1;
}
return x;
}
int main(){
char * cadena_dinamica = NULL;
int cantidad = 0;
int opc;
tipodato e,x;
TipoPila A;
inicializar(A);
do{
std::cout<<"1 insertar"<<std::endl<<"2 imprimir"<<std::endl;
std::cin>>opc;
switch(opc){
case 1:
std::cout<< "Por favor digite el tamaņo de la frase :"<<std::endl();
std::cin>>cantidad;
cadena_dinamica = new char[cantidad];
std::cout<<"ingrese Frase"<<std::endl;
std::cin>>cadena_dinamica;
for(int n=0;n<cantidad;n++) inseta(A,cadena_dinamica[n]);
break;
case 2:
for(int i=A.tope+1;i>0;i--){
std::cout<<quita(A)<<" ";
}
std::cout<<std::endl;
break;
case 3:
delete [] cadena_dinamica; // liberamos la memoria de la cadena
cadena_dinamica = NULL;
return 0;
break;
}
}while(true);
return 0;
}
| [
"luisg1.luis@gmail.com"
] | luisg1.luis@gmail.com |
8789c78692fde8fd903151ca8dbd4c6b8b5de497 | 2e4dd073e5567b157501781965695b3e47386b17 | /shared/vkRenderers/VulkanModelRenderer.h | 4e7d07b87fc04a73fdb041c7778cc6ccfc82e97a | [
"MIT"
] | permissive | LuisAllegri/3D-Graphics-Rendering-Cookbook | e83ec09932401915ab591dadcc98a7ef6abac24e | f4343a712c8637eafad4bbc22649e0d232072a32 | refs/heads/master | 2023-08-25T20:42:16.070897 | 2021-11-07T18:36:18 | 2021-11-07T18:36:18 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,435 | h | #pragma once
#include "shared/vkRenderers/VulkanRendererBase.h"
class ModelRenderer: public RendererBase
{
public:
ModelRenderer(VulkanRenderDevice& vkDev, const char* modelFile, const char* textureFile, uint32_t uniformDataSize);
ModelRenderer(VulkanRenderDevice& vkDev, bool useDepth, VkBuffer storageBuffer, VkDeviceMemory storageBufferMemory, uint32_t vertexBufferSize, uint32_t indexBufferSize, VulkanImage texture, VkSampler textureSampler, const std::vector<const char*>& shaderFiles, uint32_t uniformDataSize, bool useGeneralTextureLayout = true, VulkanImage externalDepth = { .image = VK_NULL_HANDLE }, bool deleteMeshData = true);
virtual ~ModelRenderer();
virtual void fillCommandBuffer(VkCommandBuffer commandBuffer, size_t currentImage) override;
void updateUniformBuffer(VulkanRenderDevice& vkDev, uint32_t currentImage, const void* data, const size_t dataSize);
// HACK to allow sharing textures between multiple ModelRenderers
void freeTextureSampler() { textureSampler_ = VK_NULL_HANDLE; }
private:
bool useGeneralTextureLayout_ = false;
bool isExternalDepth_ = false;
bool deleteMeshData_ = true;
size_t vertexBufferSize_;
size_t indexBufferSize_;
// 6. Storage Buffer with index and vertex data
VkBuffer storageBuffer_;
VkDeviceMemory storageBufferMemory_;
VkSampler textureSampler_;
VulkanImage texture_;
bool createDescriptorSet(VulkanRenderDevice& vkDev, uint32_t uniformDataSize);
};
| [
"sk@linderdaum.com"
] | sk@linderdaum.com |
ee4aedf97b5b467917bfae26f22b77e0696f44f3 | 1fcdb2bc2c7f75f6aed466119a4b1c53777f0b7a | /holly_inlet_kappaepsilon_noturbulence/22/U | a66cdf60fb7a76ddd46fedb6e3be8970711a10b6 | [] | no_license | bshambaugh/openfoam-experiments3 | b32549e80836eee9fc6062873fc737155168f919 | 4bd90a951845a4bc5dda7063e91f6cc0ba730e48 | refs/heads/master | 2020-04-15T08:17:15.156512 | 2019-01-15T04:31:23 | 2019-01-15T04:31:23 | 164,518,405 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,181 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "22";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField nonuniform List<vector>
225
(
(1.18197e-14 0.852191 15.7946)
(9.14693e-15 -4.89458 12.1215)
(-3.07586e-15 -4.19551 12.1321)
(2.95573e-15 -3.60119 11.9966)
(7.9053e-16 -3.00468 11.8778)
(-1.90538e-16 -2.55319 11.6992)
(1.9925e-15 -2.20881 11.4769)
(1.90809e-16 -1.96603 11.2116)
(-1.08802e-16 -1.79855 10.916)
(1.15931e-15 -1.71238 10.5882)
(2.40065e-16 -1.83746 10.1561)
(-7.29241e-17 -2.28567 9.53762)
(-3.38668e-17 -2.513 8.96378)
(-1.0963e-16 -1.06552 8.91355)
(1.40258e-17 1.76575 7.47092)
(9.30927e-15 -5.35016 22.493)
(1.48112e-14 -14.6049 21.394)
(-6.22526e-16 -13.2708 20.3411)
(3.98515e-15 -11.7697 19.5066)
(1.53691e-15 -11.1561 18.5043)
(-8.49928e-17 -10.6594 17.5174)
(2.14857e-15 -10.0901 16.5714)
(9.10104e-16 -9.525 15.6236)
(-1.8796e-16 -8.96544 14.6638)
(6.05875e-16 -8.36731 13.6946)
(3.22142e-16 -7.75709 12.7179)
(-5.2435e-17 -7.30335 11.7194)
(5.58492e-16 -7.01705 10.6244)
(6.87846e-17 -5.73093 9.16113)
(3.51061e-18 -2.30501 4.58318)
(1.36553e-14 -7.71565 23.9801)
(1.14898e-14 -16.7731 24.6729)
(2.84804e-16 -13.7365 23.9372)
(-6.25985e-16 -12.3062 22.6249)
(1.25992e-15 -11.6447 21.2414)
(7.84844e-16 -10.814 20.0013)
(3.08429e-15 -9.94025 18.7738)
(6.0174e-16 -9.1001 17.5247)
(4.92345e-16 -8.28337 16.2654)
(-3.34539e-16 -7.47523 15.0263)
(-1.6075e-15 -6.66761 13.8176)
(3.30782e-16 -5.84164 12.4301)
(8.65493e-16 -4.81388 10.2752)
(-4.336e-17 -3.12624 6.6844)
(-2.85135e-17 -0.832137 1.68991)
(1.79908e-14 -8.50258 22.0462)
(1.60639e-14 -16.6211 24.332)
(8.41219e-16 -12.93 23.7971)
(3.87143e-15 -12.1536 21.9985)
(1.07593e-15 -11.4201 20.5028)
(1.55965e-15 -10.4936 19.1722)
(2.85809e-15 -9.63387 17.8167)
(6.90935e-16 -8.82358 16.459)
(9.44576e-16 -8.05362 15.123)
(1.63553e-15 -7.32377 13.8164)
(5.35486e-16 -6.55246 12.4394)
(3.8517e-16 -5.49086 10.583)
(7.04591e-16 -3.78523 7.50863)
(-7.5798e-18 -1.49362 2.76597)
(-7.28238e-16 0.153284 -1.773)
(1.69809e-14 -8.47615 19.748)
(1.81836e-14 -16.3601 24.312)
(1.75013e-15 -13.099 23.6602)
(3.54973e-15 -12.628 21.5365)
(9.07219e-16 -11.8565 20.0248)
(1.48061e-15 -10.9574 18.6637)
(2.85762e-15 -10.1698 17.2587)
(1.83817e-15 -9.40276 15.8711)
(1.15601e-15 -8.65257 14.5236)
(1.51069e-15 -7.9305 13.2135)
(-3.99933e-16 -7.16586 11.8292)
(1.91672e-16 -6.11612 9.99622)
(5.28126e-16 -4.42399 7.15549)
(1.55794e-15 -2.30526 3.28785)
(-7.22819e-16 -0.787187 0.317717)
(1.53756e-14 -8.02194 17.5537)
(1.67355e-14 -16.0195 24.5277)
(3.18564e-15 -13.6434 24.0461)
(2.4873e-15 -12.9943 21.7651)
(1.17206e-15 -12.1264 20.2157)
(1.53576e-15 -11.2247 18.847)
(3.34451e-15 -10.439 17.4341)
(8.91188e-16 -9.64887 16.0434)
(1.3907e-15 -8.86034 14.6933)
(9.29957e-16 -8.09323 13.3817)
(5.93007e-16 -7.29728 12.0171)
(-3.23728e-16 -6.28455 10.2817)
(1.44821e-15 -4.73296 7.72083)
(3.37083e-16 -2.75609 4.37239)
(3.7641e-16 -0.949374 1.29733)
(1.37337e-14 -7.33743 15.2535)
(1.73836e-14 -15.491 24.355)
(5.37472e-15 -14.0225 24.4218)
(2.91633e-15 -13.1278 22.0675)
(1.42212e-15 -12.1447 20.4401)
(1.56476e-15 -11.2358 19.0547)
(2.44382e-15 -10.436 17.6437)
(6.99126e-16 -9.61982 16.2576)
(1.55966e-15 -8.81014 14.9066)
(1.79939e-15 -8.02721 13.5918)
(1.02906e-15 -7.22393 12.2368)
(1.21336e-15 -6.24023 10.5488)
(3.65098e-16 -4.78747 8.10742)
(8.4994e-17 -2.91407 4.94707)
(3.21624e-15 -1.01086 1.79738)
(1.17793e-14 -6.55627 13.033)
(1.78115e-14 -14.847 23.8164)
(6.96279e-15 -14.2638 24.669)
(2.95834e-15 -13.2372 22.3215)
(1.52163e-15 -12.1674 20.5831)
(1.47363e-15 -11.2657 19.1666)
(2.34944e-15 -10.4651 17.7586)
(1.60723e-15 -9.64312 16.3765)
(1.45407e-15 -8.83492 15.0245)
(2.59922e-15 -8.05528 13.7073)
(1.16435e-15 -7.25499 12.3576)
(1.27368e-15 -6.28688 10.6995)
(1.66998e-15 -4.89098 8.33091)
(1.40855e-16 -3.0852 5.26761)
(9.82078e-16 -1.1222 2.04392)
(1.02325e-14 -5.77845 11.1239)
(1.78183e-14 -14.1745 23.0906)
(8.26507e-15 -14.4412 24.8462)
(3.04787e-15 -13.3963 22.6148)
(1.56916e-15 -12.2528 20.7553)
(1.3289e-15 -11.3493 19.2955)
(2.44726e-15 -10.5477 17.8904)
(1.7739e-15 -9.72542 16.5109)
(2.02323e-15 -8.91942 15.1561)
(1.58242e-15 -8.14022 13.8351)
(1.22896e-15 -7.33994 12.4864)
(1.87182e-15 -6.38014 10.8512)
(4.57368e-16 -5.0235 8.54668)
(1.09077e-16 -3.26576 5.55828)
(-5.18214e-16 -1.23753 2.24764)
(8.53922e-15 -5.08507 9.59944)
(1.7558e-14 -13.5192 22.3001)
(9.44403e-15 -14.5349 24.9522)
(2.88999e-15 -13.5531 22.9353)
(1.56244e-15 -12.3447 20.9698)
(1.2027e-15 -11.425 19.4566)
(2.74507e-15 -10.6174 18.0506)
(1.8513e-15 -9.79446 16.6721)
(1.24447e-15 -8.98826 15.3136)
(1.32434e-15 -8.20621 13.9873)
(1.21522e-15 -7.4047 12.6355)
(6.59257e-16 -6.45144 11.0132)
(1.22231e-15 -5.12519 8.75503)
(1.55496e-16 -3.40649 5.81946)
(-2.39373e-16 -1.31903 2.43086)
(7.15345e-15 -4.53878 8.4624)
(1.71823e-14 -12.9256 21.5505)
(1.04348e-14 -14.5348 24.9757)
(4.08372e-15 -13.6653 23.2208)
(1.62394e-15 -12.4128 21.1811)
(4.63611e-16 -11.4735 19.612)
(1.97899e-15 -10.659 18.2003)
(1.97755e-15 -9.83695 16.8209)
(1.10824e-15 -9.03207 15.4585)
(1.44889e-15 -8.24858 14.1269)
(1.28913e-15 -7.44648 12.7691)
(-7.08862e-16 -6.49772 11.1497)
(8.97266e-18 -5.19255 8.91838)
(-6.65835e-16 -3.50178 6.0104)
(-1.64875e-15 -1.3637 2.54237)
(6.42856e-15 -4.17056 7.70296)
(1.67549e-14 -12.4379 20.928)
(1.07694e-14 -14.4732 24.9365)
(4.21446e-15 -13.7314 23.4376)
(1.59e-15 -12.4591 21.3592)
(1.01295e-15 -11.5038 19.7403)
(1.91205e-15 -10.6831 18.3205)
(2.38862e-15 -9.8635 16.939)
(1.22717e-15 -9.06113 15.5728)
(1.45983e-15 -8.27761 14.2363)
(1.26953e-15 -7.47491 12.8709)
(-2.26875e-16 -6.52682 11.2465)
(2.92162e-17 -5.23303 9.02642)
(-9.46873e-16 -3.55794 6.12603)
(-1.89354e-15 -1.37727 2.57257)
(5.95553e-15 -3.97353 7.2799)
(1.62666e-14 -12.0684 20.4614)
(1.11504e-14 -14.3843 24.8626)
(4.44717e-15 -13.7598 23.5826)
(2.00904e-15 -12.4874 21.4968)
(1.06335e-15 -11.5228 19.8405)
(1.8347e-15 -10.6964 18.4119)
(2.13312e-15 -9.87979 17.0277)
(1.19057e-15 -9.08037 15.6582)
(1.39332e-15 -8.29706 14.3168)
(1.30698e-15 -7.49301 12.942)
(3.21325e-16 -6.54199 11.3059)
(1.73266e-17 -5.25082 9.08413)
(-8.32983e-16 -3.57874 6.1753)
(-1.14903e-15 -1.36521 2.53891)
(5.65478e-15 -3.90376 7.11034)
(1.59814e-14 -11.8313 20.1817)
(1.13202e-14 -14.2998 24.79)
(4.66468e-15 -13.7668 23.6685)
(2.04371e-15 -12.5019 21.5898)
(1.05845e-15 -11.532 19.9095)
(1.80606e-15 -10.7003 18.4746)
(2.12264e-15 -9.8854 17.0883)
(1.1646e-15 -9.08779 15.7171)
(1.4061e-15 -8.30391 14.3728)
(1.29134e-15 -7.49767 12.9904)
(2.75015e-16 -6.543 11.3432)
(3.52881e-17 -5.25329 9.11707)
(-8.09425e-16 -3.58367 6.20159)
(-8.40178e-16 -1.35026 2.50666)
(5.77137e-15 -4.03931 7.28646)
(1.5479e-14 -11.6269 19.9519)
(1.13294e-14 -14.1917 24.6679)
(4.86254e-15 -13.7464 23.7082)
(2.09318e-15 -12.5066 21.6737)
(1.12124e-15 -11.5393 19.9773)
(1.78473e-15 -10.6996 18.535)
(2.06688e-15 -9.88705 17.1438)
(1.23931e-15 -9.09061 15.7695)
(1.38454e-15 -8.30503 14.4183)
(1.19307e-15 -7.48998 13.0147)
(2.58966e-16 -6.51537 11.3281)
(-1.72931e-17 -5.20604 9.06124)
(-7.26342e-16 -3.50173 6.08284)
(-4.8045e-16 -1.25255 2.30733)
)
;
boundaryField
{
inletFace
{
type zeroGradient;
}
inlet
{
type fixedValue;
value uniform (0 8.7 15);
}
inletWalls
{
type noSlip;
}
outletInlet
{
type zeroGradient;
}
}
// ************************************************************************* //
| [
"brent.shambaugh@gmail.com"
] | brent.shambaugh@gmail.com | |
246e7a11d9a9a38bc26515c5352658fc877573c2 | 88ae8695987ada722184307301e221e1ba3cc2fa | /third_party/pdfium/fxjs/cjs_console.h | 5608d55a4356c9eb90dc97e6481029fbe656b59f | [
"Apache-2.0",
"LGPL-2.0-or-later",
"MIT",
"GPL-1.0-or-later",
"BSD-3-Clause"
] | permissive | iridium-browser/iridium-browser | 71d9c5ff76e014e6900b825f67389ab0ccd01329 | 5ee297f53dc7f8e70183031cff62f37b0f19d25f | refs/heads/master | 2023-08-03T16:44:16.844552 | 2023-07-20T15:17:00 | 2023-07-23T16:09:30 | 220,016,632 | 341 | 40 | BSD-3-Clause | 2021-08-13T13:54:45 | 2019-11-06T14:32:31 | null | UTF-8 | C++ | false | false | 1,347 | h | // Copyright 2014 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#ifndef FXJS_CJS_CONSOLE_H_
#define FXJS_CJS_CONSOLE_H_
#include <vector>
#include "fxjs/cjs_object.h"
#include "fxjs/js_define.h"
class CJS_Console final : public CJS_Object {
public:
static uint32_t GetObjDefnID();
static void DefineJSObjects(CFXJS_Engine* pEngine);
CJS_Console(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime);
~CJS_Console() override;
JS_STATIC_METHOD(clear, CJS_Console)
JS_STATIC_METHOD(hide, CJS_Console)
JS_STATIC_METHOD(println, CJS_Console)
JS_STATIC_METHOD(show, CJS_Console)
private:
static uint32_t ObjDefnID;
static const char kName[];
static const JSMethodSpec MethodSpecs[];
CJS_Result clear(CJS_Runtime* pRuntime,
const std::vector<v8::Local<v8::Value>>& params);
CJS_Result hide(CJS_Runtime* pRuntime,
const std::vector<v8::Local<v8::Value>>& params);
CJS_Result println(CJS_Runtime* pRuntime,
const std::vector<v8::Local<v8::Value>>& params);
CJS_Result show(CJS_Runtime* pRuntime,
const std::vector<v8::Local<v8::Value>>& params);
};
#endif // FXJS_CJS_CONSOLE_H_
| [
"jengelh@inai.de"
] | jengelh@inai.de |
fe03b3310651a18f5b230e44569f4eb2b4e9d0a9 | 5d0b1b638b1348c09dea4d8feeb59b42044f934c | /subms/Dastan Nurgumarov_90432_assignsubmission_file_/Dastan_Nurgumarov.cpp | 2a6fcdab1c4e07a5b7cbd5101b14d314bff3be14 | [] | no_license | Ondassyn/AutoClock | 84e361c20d55deb7bbd60f53c0fdfa564620dc8a | 635a501dc8cb77d9d38265c80bc6198dcc060bec | refs/heads/master | 2022-06-06T07:34:06.617595 | 2019-06-13T07:27:47 | 2019-06-13T07:27:47 | 191,712,766 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,144 | cpp | #include <iostream>
using namespace std;
class am_pm_clock {
unsigned int hours, minutes, seconds;
bool am;
public:
am_pm_clock() {
hours=12;
minutes=00;
seconds=00;
am=true;
}
am_pm_clock(unsigned int hrs, unsigned int mins,
unsigned int secs, bool am_val) {
hours=hrs;
minutes=mins;
seconds=secs;
am=am_val;
}
am_pm_clock(const am_pm_clock &clock){
hours=clock.hours;
minutes=clock.minutes;
seconds=clock.seconds;
am=clock.am;
}
const am_pm_clock& operator=(const am_pm_clock &clock) {
hours=clock.hours;
minutes=clock.minutes;
seconds=clock.seconds;
am=clock.am;
return clock;
}
void toggle_am_pm() {
if (hours>12) {
hours=hours-12;
am=false;
} else {
am=true;
}
}
void reset() {
hours=12;
minutes=00;
seconds=00;
am=false;
}
void advance_one_sec() {
seconds++;
if (seconds>59) {
seconds=0;
}
}
void advance_n_secs(unsigned int n) {
seconds=seconds+n;
if (seconds>59) {
seconds=seconds-59;
}
}
unsigned int get_hours() const {
return hours;
}
void set_hours(unsigned int hrs) {
hours=hrs;
if (hrs>12) {
throw std::invalid_argument("Invalid syntax.");
}
}
unsigned int get_minutes() const {
return minutes;
}
void set_minutes(unsigned int mins) {
minutes=mins;
if (mins>59) {
throw std::invalid_argument("Invalid value");
}
}
unsigned int get_seconds() const {
return seconds;
}
void set_seconds(unsigned int secs) {
seconds=secs;
if (secs>59) {
throw std::invalid_argument("Invalid value");
}
}
bool is_am() const {
return am;
}
void set_am(bool am_val) {
am=am_val;
}
void print(std::ostream& out) const {
char buff[11];
std::sprintf(buff, "%02d:%02d:%02d%cm", hours, minutes, seconds,
( am ? 'a' : 'p' ));
out << buff;
}
} ;
int main() {
return 0;
}
| [
"oabdrakhmanov@nu.edu.kz"
] | oabdrakhmanov@nu.edu.kz |
fe2bbdbbf9008dbeabe382d3c48e552d37b589a3 | ab1c643f224197ca8c44ebd562953f0984df321e | /cys/win32/decisionpage.cpp | 94a980e92aa5f490a564a9d2658164128e83734d | [] | no_license | KernelPanic-OpenSource/Win2K3_NT_admin | e162e0452fb2067f0675745f2273d5c569798709 | d36e522f16bd866384bec440517f954a1a5c4a4d | refs/heads/master | 2023-04-12T13:25:45.807158 | 2021-04-13T16:33:59 | 2021-04-13T16:33:59 | 357,613,696 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 4,772 | cpp | // Copyright (c) 2001 Microsoft Corporation
//
// File: DecisionPage.cpp
//
// Synopsis: Defines Decision Page for the CYS
// Wizard. This page lets the user choose
// between the custom and express paths
//
// History: 02/08/2001 JeffJon Created
#include "pch.h"
#include "resource.h"
#include "InstallationUnitProvider.h"
#include "DecisionPage.h"
static PCWSTR DECISION_PAGE_HELP = L"cys.chm::/cys_topnode.htm";
DecisionPage::DecisionPage()
:
CYSWizardPage(
IDD_DECISION_PAGE,
IDS_DECISION_TITLE,
IDS_DECISION_SUBTITLE,
DECISION_PAGE_HELP)
{
LOG_CTOR(DecisionPage);
}
DecisionPage::~DecisionPage()
{
LOG_DTOR(DecisionPage);
}
void
DecisionPage::OnInit()
{
LOG_FUNCTION(DecisionPage::OnInit);
CYSWizardPage::OnInit();
// Set the text that was too long for the resource
String tooLongText;
if (State::GetInstance().GetNICCount() > 1)
{
tooLongText = String::load(IDS_DECISION_EXPRESS_MULTIPLE_NICS);
}
else
{
tooLongText = String::load(IDS_DECISION_EXPRESS_TOO_LONG_TEXT);
}
Win::SetWindowText(
Win::GetDlgItem(
hwnd,
IDC_EXPRESS_TOO_LONG_STATIC),
tooLongText);
// NTRAID#NTBUG9-511431-2002/1/14-JeffJon
// Make the user choose which path to go down instead of providing a default
// Win::Button_SetCheck(Win::GetDlgItem(hwnd, IDC_EXPRESS_RADIO), BST_CHECKED);
}
bool
DecisionPage::OnSetActive()
{
LOG_FUNCTION(DecisionPage::OnSetActive);
bool expressChecked =
Win::Button_GetCheck(
Win::GetDlgItem(hwnd, IDC_EXPRESS_RADIO));
bool customChecked =
Win::Button_GetCheck(
Win::GetDlgItem(hwnd, IDC_CUSTOM_RADIO));
if (expressChecked ||
customChecked)
{
LOG(L"Enabling next and back");
Win::PropSheet_SetWizButtons(
Win::GetParent(hwnd),
PSWIZB_NEXT | PSWIZB_BACK);
}
else
{
LOG(L"Enabling back");
Win::PropSheet_SetWizButtons(
Win::GetParent(hwnd),
PSWIZB_BACK);
}
return true;
}
bool
DecisionPage::OnCommand(
HWND /* windowFrom */ ,
unsigned controlIDFrom,
unsigned code)
{
// LOG_FUNCTION(DecisionPage::OnCommand);
switch (controlIDFrom)
{
case IDC_EXPRESS_RADIO:
case IDC_CUSTOM_RADIO:
if (code == BN_CLICKED)
{
bool expressChecked =
Win::Button_GetCheck(
Win::GetDlgItem(hwnd, IDC_EXPRESS_RADIO));
bool customChecked =
Win::Button_GetCheck(
Win::GetDlgItem(hwnd, IDC_CUSTOM_RADIO));
if (expressChecked ||
customChecked)
{
Win::PropSheet_SetWizButtons(
Win::GetParent(hwnd),
PSWIZB_NEXT | PSWIZB_BACK);
}
else
{
Win::PropSheet_SetWizButtons(
Win::GetParent(hwnd),
PSWIZB_BACK);
}
}
break;
default:
{
// do nothing
break;
}
}
return false;
}
int
DecisionPage::Validate()
{
LOG_FUNCTION(DecisionPage::Validate);
int nextPage = -1;
if (Win::Button_GetCheck(Win::GetDlgItem(hwnd, IDC_EXPRESS_RADIO)))
{
nextPage = IDD_AD_DOMAIN_NAME_PAGE;
InstallationUnitProvider::GetInstance().SetCurrentInstallationUnit(EXPRESS_SERVER);
// Make sure all the delegated installation units know we are in the
// express path
InstallationUnitProvider::GetInstance().GetDHCPInstallationUnit().SetExpressPathInstall(true);
InstallationUnitProvider::GetInstance().GetDNSInstallationUnit().SetExpressPathInstall(true);
InstallationUnitProvider::GetInstance().GetADInstallationUnit().SetExpressPathInstall(true);
InstallationUnitProvider::GetInstance().GetRRASInstallationUnit().SetExpressPathInstall(true);
}
else if (Win::Button_GetCheck(Win::GetDlgItem(hwnd, IDC_CUSTOM_RADIO)))
{
// Make sure all the delegated installation units know we are no longer
// in the express path (if we once were)
InstallationUnitProvider::GetInstance().GetDHCPInstallationUnit().SetExpressPathInstall(false);
InstallationUnitProvider::GetInstance().GetDNSInstallationUnit().SetExpressPathInstall(false);
InstallationUnitProvider::GetInstance().GetADInstallationUnit().SetExpressPathInstall(false);
InstallationUnitProvider::GetInstance().GetRRASInstallationUnit().SetExpressPathInstall(false);
nextPage = IDD_CUSTOM_SERVER_PAGE;
}
else
{
ASSERT(false);
}
LOG(String::format(
L"nextPage = %1!d!",
nextPage));
return nextPage;
}
| [
"polarisdp@gmail.com"
] | polarisdp@gmail.com |
ea7657bc80948ec47dc7ef5d1d468663b8cc94d2 | d0fb46aecc3b69983e7f6244331a81dff42d9595 | /opensearch/src/model/PushInterventionDictionaryEntriesRequest.cc | 15c5a5ad28acf47446d690aaf5c3fb4ba1f2944c | [
"Apache-2.0"
] | permissive | aliyun/aliyun-openapi-cpp-sdk | 3d8d051d44ad00753a429817dd03957614c0c66a | e862bd03c844bcb7ccaa90571bceaa2802c7f135 | refs/heads/master | 2023-08-29T11:54:00.525102 | 2023-08-29T03:32:48 | 2023-08-29T03:32:48 | 115,379,460 | 104 | 82 | NOASSERTION | 2023-09-14T06:13:33 | 2017-12-26T02:53:27 | C++ | UTF-8 | C++ | false | false | 1,410 | cc | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/opensearch/model/PushInterventionDictionaryEntriesRequest.h>
using AlibabaCloud::OpenSearch::Model::PushInterventionDictionaryEntriesRequest;
PushInterventionDictionaryEntriesRequest::PushInterventionDictionaryEntriesRequest()
: RoaServiceRequest("opensearch", "2017-12-25") {
setResourcePath("/v4/openapi/intervention-dictionaries/[name]/entries/actions/bulk"};
setMethod(HttpRequest::Method::Post);
}
PushInterventionDictionaryEntriesRequest::~PushInterventionDictionaryEntriesRequest() {}
std::string PushInterventionDictionaryEntriesRequest::getName() const {
return name_;
}
void PushInterventionDictionaryEntriesRequest::setName(const std::string &name) {
name_ = name;
setParameter(std::string("name"), name);
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
71cf115db8989f664bc152a11992ce543884fd49 | d41b247175c739f2cfe4ac60bcc6be1effe82238 | /programming03/client/CliDirFuncs.cpp | be2ee44fb097762fa6406db8eb94a836e17e5e99 | [] | no_license | bdalgarn/networks-hw | 423c88382f78a28968cebb6a2cd9a5e0bd32eed8 | 0fcf5079bf7cc229243407f6cf96c785398775cc | refs/heads/master | 2021-08-26T04:42:02.629105 | 2017-11-21T16:05:25 | 2017-11-21T16:05:25 | 105,486,387 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,069 | cpp | #include <stdint.h>
void mdir(char *name, int32_t size){
// char buf[MAXSIZE];
// if ((size!=recv(new_s,buf,sizeof(buf),0))<0){
// fprintf(stderr,"[recv] : %s",strerror(errno));
// return -1;
// }
//
char *size = atoi(size);
char *init_msg = "";
sprintf(init_msg,"%s %s",size,name);
if (connect(sock, (struct sockaddr*)&server,sizeof(server)) == -1) {
perror("client: connect");
return EXIT_FAILURE;
}
bzero((char *)&buf, sizeof(buf));
strcpy(buf,init_msg,sizeof(init_msg));
if ((sendto(sock,buf,sizeof(buf),0,(struct sockaddr *)&server, sizeof(struct sockaddr))) < 0){
fprintf(stderr,"[Sendto] : %s",strerror(errno));
return EXIT_FAILURE;
}
if ((size=recv(sock,buf,sizeof(buf),0))<0){
fprintf(stderr,"[recv] : %s",strerror(errno));
return -1;
}
int num;
if (!strncmp(buf,"-2",2)){
fprintf(stdout,"The directory already exists on the server\n");
continue;
}else if (!strncmp(buf,"-1",2)){
fprintf(stdout,"Error making the directory\n");
continue;
}else{
fprintf(stdout,"The directory was successfully made\n");
continue;
}
}
void rdir(char *name, int32_t size){
char *size = atoi(size);
char *init_msg = "";
sprintf(init_msg,"%s %s",size,name);
if (connect(sock, (struct sockaddr*)&server,sizeof(server)) == -1) {
perror("client: connect");
return EXIT_FAILURE;
}
bzero((char *)&buf, sizeof(buf));
strcpy(buf,init_msg,sizeof(init_msg));
if ((sendto(sock,buf,sizeof(buf),0,(struct sockaddr *)&server, sizeof(struct sockaddr))) < 0){
fprintf(stderr,"[Sendto] : %s",strerror(errno));
return EXIT_FAILURE;
}
if ((size=recv(sock,buf,sizeof(buf),0))<0){
fprintf(stderr,"[recv] : %s",strerror(errno));
return -1;
}
int num;
if (!strncmp(buf,"-2",2) || !strncmp(buf,"-1",2)){
fprintf(stdout,"Failed to delete directory\n");
continue;
}else{
fprintf(stdout,"The directory was successfully deleted\n");
continue;
}
}
void cdir(char *name, int32_t size){
char *size = atoi(size);
char *init_msg = "";
sprintf(init_msg,"%s %s",size,name);
if (connect(sock, (struct sockaddr*)&server,sizeof(server)) == -1) {
perror("client: connect");
return EXIT_FAILURE;
}
bzero((char *)&buf, sizeof(buf));
strcpy(buf,init_msg,sizeof(init_msg));
if ((sendto(sock,buf,sizeof(buf),0,(struct sockaddr *)&server, sizeof(struct sockaddr))) < 0){
fprintf(stderr,"[Sendto] : %s",strerror(errno));
return EXIT_FAILURE;
}
if ((size!=recv(sock,buf,sizeof(buf),0))<0){
fprintf(stderr,"[recv] : %s",strerror(errno));
return -1;
}
if (!strncmp(buf,"-2",2)){
fprintf(stdout,"The directory does exist on the server\n");
continue;
}else if (!strncmp(buf,"-1",2)){
fprintf(stdout,"Error changing into the directory\n");
continue;
}else{
fprintf(stdout,"Successfully changed directory\n");
continue;
}
}
| [
"adifalco@nd.edu"
] | adifalco@nd.edu |
f189240242dc57d7b40ea816c6fa942ace2c9975 | c1c2bd1c9ea641b2bb947a033ae5f70f82861013 | /chap 14/eBook Collection/eBook Collection/eBook.cpp | f2d317eb5cc80a67da3530024ae3bea55a18024e | [] | no_license | mir-mirsodikov/An-Introduction-to-Programming-with-CPP | b5016b308981b08a9fb2f7d64ec33b515ecc3d2f | 0e6db865a32a0a324d1a0048b817b285e4309666 | refs/heads/master | 2020-05-28T07:14:34.611350 | 2019-05-27T22:54:44 | 2019-05-27T22:54:44 | 188,918,208 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,279 | cpp | //Mukhammad Mirsodikov - P2
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
void saveInfo();
void displayInfo();
int main() {
saveInfo();
displayInfo();
system("pause");
return 0;
}
void saveInfo() {
string title = "";
string author = "";
ofstream outFile;
outFile.open("eBooks.txt", ios::app);
if (outFile.is_open()) {
cout << "Title (-1 to stop): ";
getline(cin, title);
while (title != "-1") {
cout << "Author: ";
getline(cin, author);
outFile << title << '#' << author << endl;
cout << "Title (-1 to stop): ";
getline(cin, title);
}
outFile.close();
}
else
cout << "eBooks.txt file could not be opened" << endl;
}
void displayInfo() {
string title = "";
string author = "";
ifstream inFile;
inFile.open("eBooks.txt", ios::in);
if (inFile.is_open()) {
cout << endl << endl << "eBook Collection" << endl;
cout << "----------------" << endl;
getline(inFile, title, '#');
getline(inFile, author);
while (!inFile.eof()) {
cout << title << " by " << author << endl;
getline(inFile, title, '#');
getline(inFile, author);
}
inFile.close();
}
else
cout << "eBooks.txt file could not be opened" << endl;
} | [
"mirsodikov.mir@gmail.com"
] | mirsodikov.mir@gmail.com |
79a9ed7aad8e4a287e6d90948d5f31cf80f96028 | e2bba937bbd064bc75216e7d4f5d1a0d72a2a34c | /lab2var2/queue.h | b548b682d2dbae0541df539cddc2388ba43c4a1b | [] | no_license | FalconCanCoding/lab3 | f91bf29e42e242030e2d04bc5d5dc93627758bcb | aca1d4d34f3dfd399bd2527da2043ca42b15d61c | refs/heads/master | 2020-06-15T10:49:17.767507 | 2016-12-01T14:47:26 | 2016-12-01T14:47:26 | 75,301,226 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 287 | h | #ifndef QUEUE_H
#define QUEUE_H
#include "element.h"
class Queue
{
Element* first;
Element* last;
int count;
public:
Queue();
~Queue();
void Put(Element* e);
Element* Get();
int Sum();
void Print();
};
#endif // QUEUE_H
| [
"Sokolik_97@mail.com"
] | Sokolik_97@mail.com |
2289cc455de007edb05cf82c03042620ab447f5f | 551d15d28066bc3c56045ff2009423f147ef0d9c | /cpp/1013_canThreePartsEqualSum.cpp | fd9ccfd5cec1177e201a54a491fe109f41dc0440 | [] | no_license | tesion99/LeetCode | 6d393dcb5721f2e9df7a239b8f8823fcfba95c49 | 823d3b7d298bbbb2d72a1b0e96c8e6a20bb84e40 | refs/heads/master | 2021-07-11T12:34:11.243119 | 2020-08-22T14:51:10 | 2020-08-22T14:51:10 | 171,787,201 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,767 | cpp | /*
给你一个整数数组 A,只有可以将其划分为三个和相等的非空部分时才返回 true,否则返回 false。
形式上,如果可以找出索引 i+1 < j 且满足 (A[0] + A[1] + ... + A[i] == A[i+1] + A[i+2] + ... + A[j-1] == A[j] + A[j-1] + ... + A[A.length - 1]) 就可以将数组三等分。
示例 1:
输出:[0,2,1,-6,6,-7,9,1,2,0,1]
输出:true
解释:0 + 2 + 1 = -6 + 6 - 7 + 9 + 1 = 2 + 0 + 1
示例 2:
输入:[0,2,1,-6,6,7,9,-1,2,0,1]
输出:false
示例 3:
输入:[3,3,6,5,-2,2,5,1,-9,4]
输出:true
解释:3 + 3 = 6 = 5 - 2 + 2 + 5 + 1 - 9 + 4
提示:
3 <= A.length <= 50000
-10^4 <= A[i] <= 10^4
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/partition-array-into-three-parts-with-equal-sum
*/
// 由题意知,数组的划分区域数据连续,不是随机组合
class Solution {
public:
bool canThreePartsEqualSum(vector<int>& A) {
int sum = accumulate(A.begin(), A.end(), 0);
int avg = sum / 3;
if (sum % 3 != 0) {
return false;
}
int start = 0, end = A.size() - 1, cur = 0;
int cnt = 3;
while (start <= end) {
cur += A[start];
if (cur == avg) {
int rest = cnt - 1;
int total = sum - (3 - rest) * avg;
if (rest != 0 && (total / rest != avg || total % rest != 0)) {
return false;
}
// 防止avg为0,确保后续还有数据
if (rest == 1 && start + 1 <= end) {
return true;
}
cur = 0;
cnt = rest;
}
++start;
}
return false;
}
};
| [
"tesion@sina.cn"
] | tesion@sina.cn |
0c2980f1ac2caace21146aa3c5e41f22ce2abbca | 441876a078a3b4c6d49831b8eeadfe45fca94b75 | /PalindromicSubstringLinear.cpp | 613726ef468b6e146a0e47a3a052445b1b7a53f8 | [] | no_license | iamblizzard/CppProgramming | 0ad9fa28d71bbebe1455fe41587ee9de52d9a03d | f4a8af9acf6743226d00e6c6e17795206f9ec30a | refs/heads/master | 2021-07-14T04:17:10.515690 | 2021-06-25T04:13:29 | 2021-06-25T04:13:29 | 137,169,151 | 7 | 0 | null | 2018-06-14T16:33:23 | 2018-06-13T05:59:43 | C++ | UTF-8 | C++ | false | false | 1,157 | cpp | #include<bits/stdc++.h>
using namespace std;
// Credits: https://github.com/mission-peace
int main()
{
string s;
cout << "Enter input string:\n";
cin >> s;
string temp = "$";
for(auto x : s) {
temp += x;
temp += '$';
}
s = temp;
int n = s.size();
int palindrome_length[n] = {0};
int start = 0, end = 0;
for(int i = 0; i < n;) {
while(start > 0 && end < n-1 && s[start-1] == s[end+1]) {
--start, ++end;
}
palindrome_length[i] = end - start + 1;
if(end == n-1) {
break;
}
int new_center = end + (i%2 == 0 ? 1:0);
for(int j = i+1; j <= end; ++j) {
palindrome_length[j] = min(palindrome_length[i - (j-i)], 2*(end-j) + 1);
if(j + palindrome_length[i - (j-i)]/2 == end) {
new_center = j;
break;
}
}
i = new_center;
end = i + palindrome_length[i]/2;
start = i - palindrome_length[i]/2;
}
int max_length = 0, idx = 0;
for(int i = 0; i < n; ++i) {
if(max_length < palindrome_length[i]) {
max_length = palindrome_length[i], idx = i;
}
}
cout << max_length/2 << endl;
for(int i = idx - max_length/2; i <= idx + max_length/2; ++i) {
if(s[i] != '$')
cout << s[i];
}
cout << endl;
} | [
"nipunmittal15@gmail.com"
] | nipunmittal15@gmail.com |
0e122601727d7fcfbd125839c262d254f967f8ee | 7f77cc07625a2ec85243112ad0349c7a54683900 | /src/cost.cpp | 0dfc21a0a5d479d37d115c950c515893ada89344 | [] | no_license | wy193777/CarND-Path-Planning-Project | 3e472699539ff5b500a414301563ef20df55d3ea | 0ae98e769b5a00e96a0615881cb9d720280433a9 | refs/heads/master | 2021-09-05T18:21:35.139084 | 2018-01-30T07:08:32 | 2018-01-30T07:08:32 | 117,603,491 | 0 | 0 | null | 2018-01-15T22:46:28 | 2018-01-15T22:46:28 | null | UTF-8 | C++ | false | false | 4,984 | cpp | #include "cost.h"
#include "vehicle.h"
#include <functional>
#include <iterator>
#include <map>
#include <math.h>
//TODO: change weights for cost functions.
const float REACH_GOAL = 1;
const float EFFICIENCY = 1;
const double BUFFER = 50;
/*
Here we have provided two possible suggestions for cost functions, but feel free to use your own!
The weighted cost over all cost functions is computed in calculate_cost. The data from get_helper_data
will be very useful in your implementation of the cost functions below. Please see get_helper_data
for details on how the helper data is computed.
*/
float lane_speed(const Vehicle & self, const vector<Vehicle> & predictions, int lane) {
/*
All non ego vehicles in a lane have the same speed, so to get the speed limit for a lane,
we can just find one vehicle in that lane.
*/
for (auto vehicle : predictions) {
if (vehicle.lane == lane && self.s < vehicle.s && (vehicle.s - self.s) < BUFFER) {
return vehicle.velocity;
}
}
return -1.0;
}
map<string, float> get_helper_data(
const Vehicle & vehicle,
const vector<Vehicle> & trajectory,
const vector<Vehicle> & predictions) {
/*
Generate helper data to use in cost functions:
indended_lane: +/- 1 from the current lane if the ehicle is planning or executing a lane change.
final_lane: The lane of the vehicle at the end of the trajectory. The lane is unchanged for KL and PLCL/PLCR trajectories.
distance_to_goal: The s distance of the vehicle to the goal.
Note that indended_lane and final_lane are both included to help differentiate between planning and executing
a lane change in the cost functions.
*/
map<string, float> trajectory_data;
Vehicle trajectory_last = trajectory[1];
float intended_lane;
if (trajectory_last.state.compare("PLCL") == 0) {
intended_lane = trajectory_last.lane + 1;
} else if (trajectory_last.state.compare("PLCR") == 0) {
intended_lane = trajectory_last.lane - 1;
} else {
intended_lane = trajectory_last.lane;
}
float distance_to_goal = vehicle.goal_s - trajectory_last.s;
float final_lane = trajectory_last.lane;
trajectory_data["intended_lane"] = intended_lane;
trajectory_data["final_lane"] = final_lane;
trajectory_data["distance_to_goal"] = distance_to_goal;
return trajectory_data;
}
float goal_distance_cost(
const Vehicle & vehicle,
const vector<Vehicle> & trajectory,
const vector<Vehicle> & predictions,
map<string, float> & data) {
/*
Cost increases based on distance of intended lane (for planning a lane change) and final lane of trajectory.
Cost of being out of goal lane also becomes larger as vehicle approaches goal distance. This function is
very similar to what you have already implemented in the "Implement a Cost Function in C++" quiz.
*/
float cost;
float distance = data["distance_to_goal"];
if (distance > 0) {
cost = 1 - 2*exp(-(abs(2.0*vehicle.goal_lane - data["intended_lane"] - data["final_lane"]) / distance));
} else {
cost = 1;
}
return cost;
}
float inefficiency_cost(
const Vehicle & vehicle,
const vector<Vehicle> & trajectory,
const vector<Vehicle> & predictions,
map<string, float> & data) {
/*
Cost becomes higher for trajectories with intended lane and final lane that have traffic slower than vehicle's target speed.
You can use the lane_speed(const map<int, vector<Vehicle>> & predictions, int lane) function to determine the speed
for a lane. This function is very similar to what you have already implemented in the "Implement a Second Cost Function in C++" quiz.
*/
float proposed_speed_intended = lane_speed(vehicle, predictions, data["intended_lane"]);
//If no vehicle is in the proposed lane, we can travel at target speed.
if (proposed_speed_intended < 0) {
proposed_speed_intended = vehicle.target_speed;
}
float proposed_speed_final = lane_speed(vehicle, predictions, data["final_lane"]);
if (proposed_speed_final < 0) {
proposed_speed_final = vehicle.target_speed;
}
float cost = (2.0*vehicle.target_speed - proposed_speed_intended - proposed_speed_final)/vehicle.target_speed;
return cost;
}
float calculate_cost(
const Vehicle & vehicle,
const vector<Vehicle> & predictions,
const vector<Vehicle> & trajectory) {
/*
Sum weighted cost functions to get total cost for trajectory.
*/
map<string, float> trajectory_data = get_helper_data(vehicle, trajectory, predictions);
float cost = 0.0;
//Add additional cost functions here.
float goal_cost = REACH_GOAL * goal_distance_cost(vehicle, trajectory, predictions, trajectory_data);
float efficiency_cost = EFFICIENCY * inefficiency_cost(vehicle, trajectory, predictions, trajectory_data);
return goal_cost + efficiency_cost;
}
| [
"gaoshenghan199123@gmail.com"
] | gaoshenghan199123@gmail.com |
e41d644ea148ab59cd441e7571010916bb4910a3 | 0d5eb5bf9178f6dd6bad291f793d1ee6de364fd3 | /hip/kernel.cudafe1.cpp | 69a46b1237a7237c2e28c03423750b1ef47e8bf1 | [] | no_license | tutzr/intermediate-test | 57adecee7fe6b1e548b961dd1b406f459372445b | ab2c476c3d7e3f0f62905bdcec27cc0b46cb66d0 | refs/heads/master | 2022-12-02T04:03:58.433136 | 2020-08-21T06:01:23 | 2020-08-21T06:01:23 | 287,793,285 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 608,339 | cpp | # 1 "kernel.c"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
# 1
#pragma GCC diagnostic push
# 1
#pragma GCC diagnostic ignored "-Wunused-variable"
# 1
#pragma GCC diagnostic ignored "-Wunused-function"
# 1
static char __nv_inited_managed_rt = 0; static void **__nv_fatbinhandle_for_managed_rt; static void __nv_save_fatbinhandle_for_managed_rt(void **in){__nv_fatbinhandle_for_managed_rt = in;} static char __nv_init_managed_rt_with_module(void **); static inline void __nv_init_managed_rt(void) { __nv_inited_managed_rt = (__nv_inited_managed_rt ? __nv_inited_managed_rt : __nv_init_managed_rt_with_module(__nv_fatbinhandle_for_managed_rt));}
# 1
#pragma GCC diagnostic pop
# 1
#pragma GCC diagnostic ignored "-Wunused-variable"
# 1
#define __nv_is_extended_device_lambda_closure_type(X) false
#define __nv_is_extended_host_device_lambda_closure_type(X) false
# 1
# 61 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
#pragma GCC diagnostic push
# 64
#pragma GCC diagnostic ignored "-Wunused-function"
# 66 "/usr/local/cuda-10.1/include/device_types.h" 3
#if 0
# 66
enum cudaRoundMode {
# 68
cudaRoundNearest,
# 69
cudaRoundZero,
# 70
cudaRoundPosInf,
# 71
cudaRoundMinInf
# 72
};
#endif
# 98 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 98
struct char1 {
# 100
signed char x;
# 101
};
#endif
# 103 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 103
struct uchar1 {
# 105
unsigned char x;
# 106
};
#endif
# 109 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 109
struct __attribute((aligned(2))) char2 {
# 111
signed char x, y;
# 112
};
#endif
# 114 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 114
struct __attribute((aligned(2))) uchar2 {
# 116
unsigned char x, y;
# 117
};
#endif
# 119 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 119
struct char3 {
# 121
signed char x, y, z;
# 122
};
#endif
# 124 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 124
struct uchar3 {
# 126
unsigned char x, y, z;
# 127
};
#endif
# 129 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 129
struct __attribute((aligned(4))) char4 {
# 131
signed char x, y, z, w;
# 132
};
#endif
# 134 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 134
struct __attribute((aligned(4))) uchar4 {
# 136
unsigned char x, y, z, w;
# 137
};
#endif
# 139 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 139
struct short1 {
# 141
short x;
# 142
};
#endif
# 144 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 144
struct ushort1 {
# 146
unsigned short x;
# 147
};
#endif
# 149 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 149
struct __attribute((aligned(4))) short2 {
# 151
short x, y;
# 152
};
#endif
# 154 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 154
struct __attribute((aligned(4))) ushort2 {
# 156
unsigned short x, y;
# 157
};
#endif
# 159 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 159
struct short3 {
# 161
short x, y, z;
# 162
};
#endif
# 164 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 164
struct ushort3 {
# 166
unsigned short x, y, z;
# 167
};
#endif
# 169 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 169
struct __attribute((aligned(8))) short4 { short x; short y; short z; short w; };
#endif
# 170 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 170
struct __attribute((aligned(8))) ushort4 { unsigned short x; unsigned short y; unsigned short z; unsigned short w; };
#endif
# 172 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 172
struct int1 {
# 174
int x;
# 175
};
#endif
# 177 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 177
struct uint1 {
# 179
unsigned x;
# 180
};
#endif
# 182 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 182
struct __attribute((aligned(8))) int2 { int x; int y; };
#endif
# 183 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 183
struct __attribute((aligned(8))) uint2 { unsigned x; unsigned y; };
#endif
# 185 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 185
struct int3 {
# 187
int x, y, z;
# 188
};
#endif
# 190 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 190
struct uint3 {
# 192
unsigned x, y, z;
# 193
};
#endif
# 195 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 195
struct __attribute((aligned(16))) int4 {
# 197
int x, y, z, w;
# 198
};
#endif
# 200 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 200
struct __attribute((aligned(16))) uint4 {
# 202
unsigned x, y, z, w;
# 203
};
#endif
# 205 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 205
struct long1 {
# 207
long x;
# 208
};
#endif
# 210 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 210
struct ulong1 {
# 212
unsigned long x;
# 213
};
#endif
# 220 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 220
struct __attribute((aligned((2) * sizeof(long)))) long2 {
# 222
long x, y;
# 223
};
#endif
# 225 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 225
struct __attribute((aligned((2) * sizeof(unsigned long)))) ulong2 {
# 227
unsigned long x, y;
# 228
};
#endif
# 232 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 232
struct long3 {
# 234
long x, y, z;
# 235
};
#endif
# 237 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 237
struct ulong3 {
# 239
unsigned long x, y, z;
# 240
};
#endif
# 242 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 242
struct __attribute((aligned(16))) long4 {
# 244
long x, y, z, w;
# 245
};
#endif
# 247 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 247
struct __attribute((aligned(16))) ulong4 {
# 249
unsigned long x, y, z, w;
# 250
};
#endif
# 252 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 252
struct float1 {
# 254
float x;
# 255
};
#endif
# 274 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 274
struct __attribute((aligned(8))) float2 { float x; float y; };
#endif
# 279 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 279
struct float3 {
# 281
float x, y, z;
# 282
};
#endif
# 284 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 284
struct __attribute((aligned(16))) float4 {
# 286
float x, y, z, w;
# 287
};
#endif
# 289 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 289
struct longlong1 {
# 291
long long x;
# 292
};
#endif
# 294 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 294
struct ulonglong1 {
# 296
unsigned long long x;
# 297
};
#endif
# 299 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 299
struct __attribute((aligned(16))) longlong2 {
# 301
long long x, y;
# 302
};
#endif
# 304 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 304
struct __attribute((aligned(16))) ulonglong2 {
# 306
unsigned long long x, y;
# 307
};
#endif
# 309 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 309
struct longlong3 {
# 311
long long x, y, z;
# 312
};
#endif
# 314 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 314
struct ulonglong3 {
# 316
unsigned long long x, y, z;
# 317
};
#endif
# 319 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 319
struct __attribute((aligned(16))) longlong4 {
# 321
long long x, y, z, w;
# 322
};
#endif
# 324 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 324
struct __attribute((aligned(16))) ulonglong4 {
# 326
unsigned long long x, y, z, w;
# 327
};
#endif
# 329 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 329
struct double1 {
# 331
double x;
# 332
};
#endif
# 334 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 334
struct __attribute((aligned(16))) double2 {
# 336
double x, y;
# 337
};
#endif
# 339 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 339
struct double3 {
# 341
double x, y, z;
# 342
};
#endif
# 344 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 344
struct __attribute((aligned(16))) double4 {
# 346
double x, y, z, w;
# 347
};
#endif
# 361 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef char1
# 361
char1;
#endif
# 362 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef uchar1
# 362
uchar1;
#endif
# 363 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef char2
# 363
char2;
#endif
# 364 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef uchar2
# 364
uchar2;
#endif
# 365 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef char3
# 365
char3;
#endif
# 366 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef uchar3
# 366
uchar3;
#endif
# 367 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef char4
# 367
char4;
#endif
# 368 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef uchar4
# 368
uchar4;
#endif
# 369 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef short1
# 369
short1;
#endif
# 370 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef ushort1
# 370
ushort1;
#endif
# 371 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef short2
# 371
short2;
#endif
# 372 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef ushort2
# 372
ushort2;
#endif
# 373 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef short3
# 373
short3;
#endif
# 374 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef ushort3
# 374
ushort3;
#endif
# 375 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef short4
# 375
short4;
#endif
# 376 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef ushort4
# 376
ushort4;
#endif
# 377 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef int1
# 377
int1;
#endif
# 378 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef uint1
# 378
uint1;
#endif
# 379 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef int2
# 379
int2;
#endif
# 380 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef uint2
# 380
uint2;
#endif
# 381 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef int3
# 381
int3;
#endif
# 382 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef uint3
# 382
uint3;
#endif
# 383 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef int4
# 383
int4;
#endif
# 384 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef uint4
# 384
uint4;
#endif
# 385 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef long1
# 385
long1;
#endif
# 386 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef ulong1
# 386
ulong1;
#endif
# 387 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef long2
# 387
long2;
#endif
# 388 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef ulong2
# 388
ulong2;
#endif
# 389 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef long3
# 389
long3;
#endif
# 390 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef ulong3
# 390
ulong3;
#endif
# 391 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef long4
# 391
long4;
#endif
# 392 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef ulong4
# 392
ulong4;
#endif
# 393 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef float1
# 393
float1;
#endif
# 394 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef float2
# 394
float2;
#endif
# 395 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef float3
# 395
float3;
#endif
# 396 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef float4
# 396
float4;
#endif
# 397 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef longlong1
# 397
longlong1;
#endif
# 398 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef ulonglong1
# 398
ulonglong1;
#endif
# 399 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef longlong2
# 399
longlong2;
#endif
# 400 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef ulonglong2
# 400
ulonglong2;
#endif
# 401 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef longlong3
# 401
longlong3;
#endif
# 402 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef ulonglong3
# 402
ulonglong3;
#endif
# 403 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef longlong4
# 403
longlong4;
#endif
# 404 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef ulonglong4
# 404
ulonglong4;
#endif
# 405 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef double1
# 405
double1;
#endif
# 406 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef double2
# 406
double2;
#endif
# 407 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef double3
# 407
double3;
#endif
# 408 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef double4
# 408
double4;
#endif
# 416 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
# 416
struct dim3 {
# 418
unsigned x, y, z;
# 428
};
#endif
# 430 "/usr/local/cuda-10.1/include/vector_types.h" 3
#if 0
typedef dim3
# 430
dim3;
#endif
# 147 "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/stddef.h" 3
typedef long ptrdiff_t;
# 212 "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/stddef.h" 3
typedef unsigned long size_t;
#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__)
#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__
#endif
#include "crt/host_runtime.h"
# 189 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 189
enum cudaError {
# 196
cudaSuccess,
# 202
cudaErrorInvalidValue,
# 208
cudaErrorMemoryAllocation,
# 214
cudaErrorInitializationError,
# 221
cudaErrorCudartUnloading,
# 228
cudaErrorProfilerDisabled,
# 236
cudaErrorProfilerNotInitialized,
# 243
cudaErrorProfilerAlreadyStarted,
# 250
cudaErrorProfilerAlreadyStopped,
# 259 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorInvalidConfiguration,
# 265
cudaErrorInvalidPitchValue = 12,
# 271
cudaErrorInvalidSymbol,
# 279
cudaErrorInvalidHostPointer = 16,
# 287
cudaErrorInvalidDevicePointer,
# 293
cudaErrorInvalidTexture,
# 299
cudaErrorInvalidTextureBinding,
# 306
cudaErrorInvalidChannelDescriptor,
# 312
cudaErrorInvalidMemcpyDirection,
# 322 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorAddressOfConstant,
# 331 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorTextureFetchFailed,
# 340 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorTextureNotBound,
# 349 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorSynchronizationError,
# 355
cudaErrorInvalidFilterSetting,
# 361
cudaErrorInvalidNormSetting,
# 369
cudaErrorMixedDeviceExecution,
# 377
cudaErrorNotYetImplemented = 31,
# 386 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorMemoryValueTooLarge,
# 393
cudaErrorInsufficientDriver = 35,
# 399
cudaErrorInvalidSurface = 37,
# 405
cudaErrorDuplicateVariableName = 43,
# 411
cudaErrorDuplicateTextureName,
# 417
cudaErrorDuplicateSurfaceName,
# 427 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorDevicesUnavailable,
# 440 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorIncompatibleDriverContext = 49,
# 446
cudaErrorMissingConfiguration = 52,
# 455 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorPriorLaunchFailure,
# 462
cudaErrorLaunchMaxDepthExceeded = 65,
# 470
cudaErrorLaunchFileScopedTex,
# 478
cudaErrorLaunchFileScopedSurf,
# 493 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorSyncDepthExceeded,
# 505 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorLaunchPendingCountExceeded,
# 511
cudaErrorInvalidDeviceFunction = 98,
# 517
cudaErrorNoDevice = 100,
# 523
cudaErrorInvalidDevice,
# 528
cudaErrorStartupFailure = 127,
# 533
cudaErrorInvalidKernelImage = 200,
# 543 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorDeviceUninitilialized,
# 548
cudaErrorMapBufferObjectFailed = 205,
# 553
cudaErrorUnmapBufferObjectFailed,
# 559
cudaErrorArrayIsMapped,
# 564
cudaErrorAlreadyMapped,
# 572
cudaErrorNoKernelImageForDevice,
# 577
cudaErrorAlreadyAcquired,
# 582
cudaErrorNotMapped,
# 588
cudaErrorNotMappedAsArray,
# 594
cudaErrorNotMappedAsPointer,
# 600
cudaErrorECCUncorrectable,
# 606
cudaErrorUnsupportedLimit,
# 612
cudaErrorDeviceAlreadyInUse,
# 618
cudaErrorPeerAccessUnsupported,
# 624
cudaErrorInvalidPtx,
# 629
cudaErrorInvalidGraphicsContext,
# 635
cudaErrorNvlinkUncorrectable,
# 642
cudaErrorJitCompilerNotFound,
# 647
cudaErrorInvalidSource = 300,
# 652
cudaErrorFileNotFound,
# 657
cudaErrorSharedObjectSymbolNotFound,
# 662
cudaErrorSharedObjectInitFailed,
# 667
cudaErrorOperatingSystem,
# 674
cudaErrorInvalidResourceHandle = 400,
# 680
cudaErrorIllegalState,
# 686
cudaErrorSymbolNotFound = 500,
# 694
cudaErrorNotReady = 600,
# 702
cudaErrorIllegalAddress = 700,
# 711 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorLaunchOutOfResources,
# 722 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorLaunchTimeout,
# 728
cudaErrorLaunchIncompatibleTexturing,
# 735
cudaErrorPeerAccessAlreadyEnabled,
# 742
cudaErrorPeerAccessNotEnabled,
# 755 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorSetOnActiveProcess = 708,
# 762
cudaErrorContextIsDestroyed,
# 769
cudaErrorAssert,
# 776
cudaErrorTooManyPeers,
# 782
cudaErrorHostMemoryAlreadyRegistered,
# 788
cudaErrorHostMemoryNotRegistered,
# 797 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorHardwareStackError,
# 805
cudaErrorIllegalInstruction,
# 814 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorMisalignedAddress,
# 825 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorInvalidAddressSpace,
# 833
cudaErrorInvalidPc,
# 844 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorLaunchFailure,
# 853 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorCooperativeLaunchTooLarge,
# 858
cudaErrorNotPermitted = 800,
# 864
cudaErrorNotSupported,
# 873 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorSystemNotReady,
# 880
cudaErrorSystemDriverMismatch,
# 889 "/usr/local/cuda-10.1/include/driver_types.h" 3
cudaErrorCompatNotSupportedOnDevice,
# 894
cudaErrorStreamCaptureUnsupported = 900,
# 900
cudaErrorStreamCaptureInvalidated,
# 906
cudaErrorStreamCaptureMerge,
# 911
cudaErrorStreamCaptureUnmatched,
# 917
cudaErrorStreamCaptureUnjoined,
# 924
cudaErrorStreamCaptureIsolation,
# 930
cudaErrorStreamCaptureImplicit,
# 936
cudaErrorCapturedEvent,
# 943
cudaErrorStreamCaptureWrongThread,
# 948
cudaErrorUnknown = 999,
# 956
cudaErrorApiFailureBase = 10000
# 957
};
#endif
# 962 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 962
enum cudaChannelFormatKind {
# 964
cudaChannelFormatKindSigned,
# 965
cudaChannelFormatKindUnsigned,
# 966
cudaChannelFormatKindFloat,
# 967
cudaChannelFormatKindNone
# 968
};
#endif
# 973 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 973
struct cudaChannelFormatDesc {
# 975
int x;
# 976
int y;
# 977
int z;
# 978
int w;
# 979
cudaChannelFormatKind f;
# 980
};
#endif
# 985 "/usr/local/cuda-10.1/include/driver_types.h" 3
typedef struct cudaArray *cudaArray_t;
# 990
typedef const cudaArray *cudaArray_const_t;
# 992
struct cudaArray;
# 997
typedef struct cudaMipmappedArray *cudaMipmappedArray_t;
# 1002
typedef const cudaMipmappedArray *cudaMipmappedArray_const_t;
# 1004
struct cudaMipmappedArray;
# 1009
#if 0
# 1009
enum cudaMemoryType {
# 1011
cudaMemoryTypeUnregistered,
# 1012
cudaMemoryTypeHost,
# 1013
cudaMemoryTypeDevice,
# 1014
cudaMemoryTypeManaged
# 1015
};
#endif
# 1020 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1020
enum cudaMemcpyKind {
# 1022
cudaMemcpyHostToHost,
# 1023
cudaMemcpyHostToDevice,
# 1024
cudaMemcpyDeviceToHost,
# 1025
cudaMemcpyDeviceToDevice,
# 1026
cudaMemcpyDefault
# 1027
};
#endif
# 1034 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1034
struct cudaPitchedPtr {
# 1036
void *ptr;
# 1037
size_t pitch;
# 1038
size_t xsize;
# 1039
size_t ysize;
# 1040
};
#endif
# 1047 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1047
struct cudaExtent {
# 1049
size_t width;
# 1050
size_t height;
# 1051
size_t depth;
# 1052
};
#endif
# 1059 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1059
struct cudaPos {
# 1061
size_t x;
# 1062
size_t y;
# 1063
size_t z;
# 1064
};
#endif
# 1069 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1069
struct cudaMemcpy3DParms {
# 1071
cudaArray_t srcArray;
# 1072
cudaPos srcPos;
# 1073
cudaPitchedPtr srcPtr;
# 1075
cudaArray_t dstArray;
# 1076
cudaPos dstPos;
# 1077
cudaPitchedPtr dstPtr;
# 1079
cudaExtent extent;
# 1080
cudaMemcpyKind kind; __pad__(volatile char:8;)__pad__(volatile char:8;)__pad__(volatile char:8;)__pad__(volatile char:8;)
# 1081
};
#endif
# 1086 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1086
struct cudaMemcpy3DPeerParms {
# 1088
cudaArray_t srcArray;
# 1089
cudaPos srcPos;
# 1090
cudaPitchedPtr srcPtr;
# 1091
int srcDevice;
# 1093
cudaArray_t dstArray;
# 1094
cudaPos dstPos;
# 1095
cudaPitchedPtr dstPtr;
# 1096
int dstDevice;
# 1098
cudaExtent extent;
# 1099
};
#endif
# 1104 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1104
struct cudaMemsetParams {
# 1105
void *dst;
# 1106
size_t pitch;
# 1107
unsigned value;
# 1108
unsigned elementSize;
# 1109
size_t width;
# 1110
size_t height;
# 1111
};
#endif
# 1123 "/usr/local/cuda-10.1/include/driver_types.h" 3
typedef void (*cudaHostFn_t)(void * userData);
# 1128
#if 0
# 1128
struct cudaHostNodeParams {
# 1129
cudaHostFn_t fn;
# 1130
void *userData;
# 1131
};
#endif
# 1136 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1136
enum cudaStreamCaptureStatus {
# 1137
cudaStreamCaptureStatusNone,
# 1138
cudaStreamCaptureStatusActive,
# 1139
cudaStreamCaptureStatusInvalidated
# 1141
};
#endif
# 1147 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1147
enum cudaStreamCaptureMode {
# 1148
cudaStreamCaptureModeGlobal,
# 1149
cudaStreamCaptureModeThreadLocal,
# 1150
cudaStreamCaptureModeRelaxed
# 1151
};
#endif
# 1156 "/usr/local/cuda-10.1/include/driver_types.h" 3
struct cudaGraphicsResource;
# 1161
#if 0
# 1161
enum cudaGraphicsRegisterFlags {
# 1163
cudaGraphicsRegisterFlagsNone,
# 1164
cudaGraphicsRegisterFlagsReadOnly,
# 1165
cudaGraphicsRegisterFlagsWriteDiscard,
# 1166
cudaGraphicsRegisterFlagsSurfaceLoadStore = 4,
# 1167
cudaGraphicsRegisterFlagsTextureGather = 8
# 1168
};
#endif
# 1173 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1173
enum cudaGraphicsMapFlags {
# 1175
cudaGraphicsMapFlagsNone,
# 1176
cudaGraphicsMapFlagsReadOnly,
# 1177
cudaGraphicsMapFlagsWriteDiscard
# 1178
};
#endif
# 1183 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1183
enum cudaGraphicsCubeFace {
# 1185
cudaGraphicsCubeFacePositiveX,
# 1186
cudaGraphicsCubeFaceNegativeX,
# 1187
cudaGraphicsCubeFacePositiveY,
# 1188
cudaGraphicsCubeFaceNegativeY,
# 1189
cudaGraphicsCubeFacePositiveZ,
# 1190
cudaGraphicsCubeFaceNegativeZ
# 1191
};
#endif
# 1196 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1196
enum cudaResourceType {
# 1198
cudaResourceTypeArray,
# 1199
cudaResourceTypeMipmappedArray,
# 1200
cudaResourceTypeLinear,
# 1201
cudaResourceTypePitch2D
# 1202
};
#endif
# 1207 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1207
enum cudaResourceViewFormat {
# 1209
cudaResViewFormatNone,
# 1210
cudaResViewFormatUnsignedChar1,
# 1211
cudaResViewFormatUnsignedChar2,
# 1212
cudaResViewFormatUnsignedChar4,
# 1213
cudaResViewFormatSignedChar1,
# 1214
cudaResViewFormatSignedChar2,
# 1215
cudaResViewFormatSignedChar4,
# 1216
cudaResViewFormatUnsignedShort1,
# 1217
cudaResViewFormatUnsignedShort2,
# 1218
cudaResViewFormatUnsignedShort4,
# 1219
cudaResViewFormatSignedShort1,
# 1220
cudaResViewFormatSignedShort2,
# 1221
cudaResViewFormatSignedShort4,
# 1222
cudaResViewFormatUnsignedInt1,
# 1223
cudaResViewFormatUnsignedInt2,
# 1224
cudaResViewFormatUnsignedInt4,
# 1225
cudaResViewFormatSignedInt1,
# 1226
cudaResViewFormatSignedInt2,
# 1227
cudaResViewFormatSignedInt4,
# 1228
cudaResViewFormatHalf1,
# 1229
cudaResViewFormatHalf2,
# 1230
cudaResViewFormatHalf4,
# 1231
cudaResViewFormatFloat1,
# 1232
cudaResViewFormatFloat2,
# 1233
cudaResViewFormatFloat4,
# 1234
cudaResViewFormatUnsignedBlockCompressed1,
# 1235
cudaResViewFormatUnsignedBlockCompressed2,
# 1236
cudaResViewFormatUnsignedBlockCompressed3,
# 1237
cudaResViewFormatUnsignedBlockCompressed4,
# 1238
cudaResViewFormatSignedBlockCompressed4,
# 1239
cudaResViewFormatUnsignedBlockCompressed5,
# 1240
cudaResViewFormatSignedBlockCompressed5,
# 1241
cudaResViewFormatUnsignedBlockCompressed6H,
# 1242
cudaResViewFormatSignedBlockCompressed6H,
# 1243
cudaResViewFormatUnsignedBlockCompressed7
# 1244
};
#endif
# 1249 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1249
struct cudaResourceDesc {
# 1250
cudaResourceType resType;
# 1252
union {
# 1253
struct {
# 1254
cudaArray_t array;
# 1255
} array;
# 1256
struct {
# 1257
cudaMipmappedArray_t mipmap;
# 1258
} mipmap;
# 1259
struct {
# 1260
void *devPtr;
# 1261
cudaChannelFormatDesc desc;
# 1262
size_t sizeInBytes;
# 1263
} linear;
# 1264
struct {
# 1265
void *devPtr;
# 1266
cudaChannelFormatDesc desc;
# 1267
size_t width;
# 1268
size_t height;
# 1269
size_t pitchInBytes;
# 1270
} pitch2D;
# 1271
} res;
# 1272
};
#endif
# 1277 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1277
struct cudaResourceViewDesc {
# 1279
cudaResourceViewFormat format;
# 1280
size_t width;
# 1281
size_t height;
# 1282
size_t depth;
# 1283
unsigned firstMipmapLevel;
# 1284
unsigned lastMipmapLevel;
# 1285
unsigned firstLayer;
# 1286
unsigned lastLayer;
# 1287
};
#endif
# 1292 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1292
struct cudaPointerAttributes {
# 1302 "/usr/local/cuda-10.1/include/driver_types.h" 3
__attribute((deprecated)) cudaMemoryType memoryType;
# 1308
cudaMemoryType type;
# 1319 "/usr/local/cuda-10.1/include/driver_types.h" 3
int device;
# 1325
void *devicePointer;
# 1334 "/usr/local/cuda-10.1/include/driver_types.h" 3
void *hostPointer;
# 1341
__attribute((deprecated)) int isManaged; __pad__(volatile char:8;)__pad__(volatile char:8;)__pad__(volatile char:8;)__pad__(volatile char:8;)
# 1342
};
#endif
# 1347 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1347
struct cudaFuncAttributes {
# 1354
size_t sharedSizeBytes;
# 1360
size_t constSizeBytes;
# 1365
size_t localSizeBytes;
# 1372
int maxThreadsPerBlock;
# 1377
int numRegs;
# 1384
int ptxVersion;
# 1391
int binaryVersion;
# 1397
int cacheModeCA;
# 1404
int maxDynamicSharedSizeBytes;
# 1413 "/usr/local/cuda-10.1/include/driver_types.h" 3
int preferredShmemCarveout;
# 1414
};
#endif
# 1419 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1419
enum cudaFuncAttribute {
# 1421
cudaFuncAttributeMaxDynamicSharedMemorySize = 8,
# 1422
cudaFuncAttributePreferredSharedMemoryCarveout,
# 1423
cudaFuncAttributeMax
# 1424
};
#endif
# 1429 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1429
enum cudaFuncCache {
# 1431
cudaFuncCachePreferNone,
# 1432
cudaFuncCachePreferShared,
# 1433
cudaFuncCachePreferL1,
# 1434
cudaFuncCachePreferEqual
# 1435
};
#endif
# 1441 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1441
enum cudaSharedMemConfig {
# 1443
cudaSharedMemBankSizeDefault,
# 1444
cudaSharedMemBankSizeFourByte,
# 1445
cudaSharedMemBankSizeEightByte
# 1446
};
#endif
# 1451 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1451
enum cudaSharedCarveout {
# 1452
cudaSharedmemCarveoutDefault = (-1),
# 1453
cudaSharedmemCarveoutMaxShared = 100,
# 1454
cudaSharedmemCarveoutMaxL1 = 0
# 1455
};
#endif
# 1460 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1460
enum cudaComputeMode {
# 1462
cudaComputeModeDefault,
# 1463
cudaComputeModeExclusive,
# 1464
cudaComputeModeProhibited,
# 1465
cudaComputeModeExclusiveProcess
# 1466
};
#endif
# 1471 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1471
enum cudaLimit {
# 1473
cudaLimitStackSize,
# 1474
cudaLimitPrintfFifoSize,
# 1475
cudaLimitMallocHeapSize,
# 1476
cudaLimitDevRuntimeSyncDepth,
# 1477
cudaLimitDevRuntimePendingLaunchCount,
# 1478
cudaLimitMaxL2FetchGranularity
# 1479
};
#endif
# 1484 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1484
enum cudaMemoryAdvise {
# 1486
cudaMemAdviseSetReadMostly = 1,
# 1487
cudaMemAdviseUnsetReadMostly,
# 1488
cudaMemAdviseSetPreferredLocation,
# 1489
cudaMemAdviseUnsetPreferredLocation,
# 1490
cudaMemAdviseSetAccessedBy,
# 1491
cudaMemAdviseUnsetAccessedBy
# 1492
};
#endif
# 1497 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1497
enum cudaMemRangeAttribute {
# 1499
cudaMemRangeAttributeReadMostly = 1,
# 1500
cudaMemRangeAttributePreferredLocation,
# 1501
cudaMemRangeAttributeAccessedBy,
# 1502
cudaMemRangeAttributeLastPrefetchLocation
# 1503
};
#endif
# 1508 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1508
enum cudaOutputMode {
# 1510
cudaKeyValuePair,
# 1511
cudaCSV
# 1512
};
#endif
# 1517 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1517
enum cudaDeviceAttr {
# 1519
cudaDevAttrMaxThreadsPerBlock = 1,
# 1520
cudaDevAttrMaxBlockDimX,
# 1521
cudaDevAttrMaxBlockDimY,
# 1522
cudaDevAttrMaxBlockDimZ,
# 1523
cudaDevAttrMaxGridDimX,
# 1524
cudaDevAttrMaxGridDimY,
# 1525
cudaDevAttrMaxGridDimZ,
# 1526
cudaDevAttrMaxSharedMemoryPerBlock,
# 1527
cudaDevAttrTotalConstantMemory,
# 1528
cudaDevAttrWarpSize,
# 1529
cudaDevAttrMaxPitch,
# 1530
cudaDevAttrMaxRegistersPerBlock,
# 1531
cudaDevAttrClockRate,
# 1532
cudaDevAttrTextureAlignment,
# 1533
cudaDevAttrGpuOverlap,
# 1534
cudaDevAttrMultiProcessorCount,
# 1535
cudaDevAttrKernelExecTimeout,
# 1536
cudaDevAttrIntegrated,
# 1537
cudaDevAttrCanMapHostMemory,
# 1538
cudaDevAttrComputeMode,
# 1539
cudaDevAttrMaxTexture1DWidth,
# 1540
cudaDevAttrMaxTexture2DWidth,
# 1541
cudaDevAttrMaxTexture2DHeight,
# 1542
cudaDevAttrMaxTexture3DWidth,
# 1543
cudaDevAttrMaxTexture3DHeight,
# 1544
cudaDevAttrMaxTexture3DDepth,
# 1545
cudaDevAttrMaxTexture2DLayeredWidth,
# 1546
cudaDevAttrMaxTexture2DLayeredHeight,
# 1547
cudaDevAttrMaxTexture2DLayeredLayers,
# 1548
cudaDevAttrSurfaceAlignment,
# 1549
cudaDevAttrConcurrentKernels,
# 1550
cudaDevAttrEccEnabled,
# 1551
cudaDevAttrPciBusId,
# 1552
cudaDevAttrPciDeviceId,
# 1553
cudaDevAttrTccDriver,
# 1554
cudaDevAttrMemoryClockRate,
# 1555
cudaDevAttrGlobalMemoryBusWidth,
# 1556
cudaDevAttrL2CacheSize,
# 1557
cudaDevAttrMaxThreadsPerMultiProcessor,
# 1558
cudaDevAttrAsyncEngineCount,
# 1559
cudaDevAttrUnifiedAddressing,
# 1560
cudaDevAttrMaxTexture1DLayeredWidth,
# 1561
cudaDevAttrMaxTexture1DLayeredLayers,
# 1562
cudaDevAttrMaxTexture2DGatherWidth = 45,
# 1563
cudaDevAttrMaxTexture2DGatherHeight,
# 1564
cudaDevAttrMaxTexture3DWidthAlt,
# 1565
cudaDevAttrMaxTexture3DHeightAlt,
# 1566
cudaDevAttrMaxTexture3DDepthAlt,
# 1567
cudaDevAttrPciDomainId,
# 1568
cudaDevAttrTexturePitchAlignment,
# 1569
cudaDevAttrMaxTextureCubemapWidth,
# 1570
cudaDevAttrMaxTextureCubemapLayeredWidth,
# 1571
cudaDevAttrMaxTextureCubemapLayeredLayers,
# 1572
cudaDevAttrMaxSurface1DWidth,
# 1573
cudaDevAttrMaxSurface2DWidth,
# 1574
cudaDevAttrMaxSurface2DHeight,
# 1575
cudaDevAttrMaxSurface3DWidth,
# 1576
cudaDevAttrMaxSurface3DHeight,
# 1577
cudaDevAttrMaxSurface3DDepth,
# 1578
cudaDevAttrMaxSurface1DLayeredWidth,
# 1579
cudaDevAttrMaxSurface1DLayeredLayers,
# 1580
cudaDevAttrMaxSurface2DLayeredWidth,
# 1581
cudaDevAttrMaxSurface2DLayeredHeight,
# 1582
cudaDevAttrMaxSurface2DLayeredLayers,
# 1583
cudaDevAttrMaxSurfaceCubemapWidth,
# 1584
cudaDevAttrMaxSurfaceCubemapLayeredWidth,
# 1585
cudaDevAttrMaxSurfaceCubemapLayeredLayers,
# 1586
cudaDevAttrMaxTexture1DLinearWidth,
# 1587
cudaDevAttrMaxTexture2DLinearWidth,
# 1588
cudaDevAttrMaxTexture2DLinearHeight,
# 1589
cudaDevAttrMaxTexture2DLinearPitch,
# 1590
cudaDevAttrMaxTexture2DMipmappedWidth,
# 1591
cudaDevAttrMaxTexture2DMipmappedHeight,
# 1592
cudaDevAttrComputeCapabilityMajor,
# 1593
cudaDevAttrComputeCapabilityMinor,
# 1594
cudaDevAttrMaxTexture1DMipmappedWidth,
# 1595
cudaDevAttrStreamPrioritiesSupported,
# 1596
cudaDevAttrGlobalL1CacheSupported,
# 1597
cudaDevAttrLocalL1CacheSupported,
# 1598
cudaDevAttrMaxSharedMemoryPerMultiprocessor,
# 1599
cudaDevAttrMaxRegistersPerMultiprocessor,
# 1600
cudaDevAttrManagedMemory,
# 1601
cudaDevAttrIsMultiGpuBoard,
# 1602
cudaDevAttrMultiGpuBoardGroupID,
# 1603
cudaDevAttrHostNativeAtomicSupported,
# 1604
cudaDevAttrSingleToDoublePrecisionPerfRatio,
# 1605
cudaDevAttrPageableMemoryAccess,
# 1606
cudaDevAttrConcurrentManagedAccess,
# 1607
cudaDevAttrComputePreemptionSupported,
# 1608
cudaDevAttrCanUseHostPointerForRegisteredMem,
# 1609
cudaDevAttrReserved92,
# 1610
cudaDevAttrReserved93,
# 1611
cudaDevAttrReserved94,
# 1612
cudaDevAttrCooperativeLaunch,
# 1613
cudaDevAttrCooperativeMultiDeviceLaunch,
# 1614
cudaDevAttrMaxSharedMemoryPerBlockOptin,
# 1615
cudaDevAttrCanFlushRemoteWrites,
# 1616
cudaDevAttrHostRegisterSupported,
# 1617
cudaDevAttrPageableMemoryAccessUsesHostPageTables,
# 1618
cudaDevAttrDirectManagedMemAccessFromHost
# 1619
};
#endif
# 1625 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1625
enum cudaDeviceP2PAttr {
# 1626
cudaDevP2PAttrPerformanceRank = 1,
# 1627
cudaDevP2PAttrAccessSupported,
# 1628
cudaDevP2PAttrNativeAtomicSupported,
# 1629
cudaDevP2PAttrCudaArrayAccessSupported
# 1630
};
#endif
# 1637 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1637
struct CUuuid_st {
# 1638
char bytes[16];
# 1639
};
#endif
# 1640 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
typedef CUuuid_st
# 1640
CUuuid;
#endif
# 1642 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
typedef CUuuid_st
# 1642
cudaUUID_t;
#endif
# 1647 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1647
struct cudaDeviceProp {
# 1649
char name[256];
# 1650
cudaUUID_t uuid;
# 1651
char luid[8];
# 1652
unsigned luidDeviceNodeMask;
# 1653
size_t totalGlobalMem;
# 1654
size_t sharedMemPerBlock;
# 1655
int regsPerBlock;
# 1656
int warpSize;
# 1657
size_t memPitch;
# 1658
int maxThreadsPerBlock;
# 1659
int maxThreadsDim[3];
# 1660
int maxGridSize[3];
# 1661
int clockRate;
# 1662
size_t totalConstMem;
# 1663
int major;
# 1664
int minor;
# 1665
size_t textureAlignment;
# 1666
size_t texturePitchAlignment;
# 1667
int deviceOverlap;
# 1668
int multiProcessorCount;
# 1669
int kernelExecTimeoutEnabled;
# 1670
int integrated;
# 1671
int canMapHostMemory;
# 1672
int computeMode;
# 1673
int maxTexture1D;
# 1674
int maxTexture1DMipmap;
# 1675
int maxTexture1DLinear;
# 1676
int maxTexture2D[2];
# 1677
int maxTexture2DMipmap[2];
# 1678
int maxTexture2DLinear[3];
# 1679
int maxTexture2DGather[2];
# 1680
int maxTexture3D[3];
# 1681
int maxTexture3DAlt[3];
# 1682
int maxTextureCubemap;
# 1683
int maxTexture1DLayered[2];
# 1684
int maxTexture2DLayered[3];
# 1685
int maxTextureCubemapLayered[2];
# 1686
int maxSurface1D;
# 1687
int maxSurface2D[2];
# 1688
int maxSurface3D[3];
# 1689
int maxSurface1DLayered[2];
# 1690
int maxSurface2DLayered[3];
# 1691
int maxSurfaceCubemap;
# 1692
int maxSurfaceCubemapLayered[2];
# 1693
size_t surfaceAlignment;
# 1694
int concurrentKernels;
# 1695
int ECCEnabled;
# 1696
int pciBusID;
# 1697
int pciDeviceID;
# 1698
int pciDomainID;
# 1699
int tccDriver;
# 1700
int asyncEngineCount;
# 1701
int unifiedAddressing;
# 1702
int memoryClockRate;
# 1703
int memoryBusWidth;
# 1704
int l2CacheSize;
# 1705
int maxThreadsPerMultiProcessor;
# 1706
int streamPrioritiesSupported;
# 1707
int globalL1CacheSupported;
# 1708
int localL1CacheSupported;
# 1709
size_t sharedMemPerMultiprocessor;
# 1710
int regsPerMultiprocessor;
# 1711
int managedMemory;
# 1712
int isMultiGpuBoard;
# 1713
int multiGpuBoardGroupID;
# 1714
int hostNativeAtomicSupported;
# 1715
int singleToDoublePrecisionPerfRatio;
# 1716
int pageableMemoryAccess;
# 1717
int concurrentManagedAccess;
# 1718
int computePreemptionSupported;
# 1719
int canUseHostPointerForRegisteredMem;
# 1720
int cooperativeLaunch;
# 1721
int cooperativeMultiDeviceLaunch;
# 1722
size_t sharedMemPerBlockOptin;
# 1723
int pageableMemoryAccessUsesHostPageTables;
# 1724
int directManagedMemAccessFromHost;
# 1725
};
#endif
# 1818 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
typedef
# 1815
struct cudaIpcEventHandle_st {
# 1817
char reserved[64];
# 1818
} cudaIpcEventHandle_t;
#endif
# 1826 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
typedef
# 1823
struct cudaIpcMemHandle_st {
# 1825
char reserved[64];
# 1826
} cudaIpcMemHandle_t;
#endif
# 1831 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1831
enum cudaExternalMemoryHandleType {
# 1835
cudaExternalMemoryHandleTypeOpaqueFd = 1,
# 1839
cudaExternalMemoryHandleTypeOpaqueWin32,
# 1843
cudaExternalMemoryHandleTypeOpaqueWin32Kmt,
# 1847
cudaExternalMemoryHandleTypeD3D12Heap,
# 1851
cudaExternalMemoryHandleTypeD3D12Resource
# 1852
};
#endif
# 1862 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1862
struct cudaExternalMemoryHandleDesc {
# 1866
cudaExternalMemoryHandleType type;
# 1867
union {
# 1873
int fd;
# 1885 "/usr/local/cuda-10.1/include/driver_types.h" 3
struct {
# 1889
void *handle;
# 1894
const void *name;
# 1895
} win32;
# 1896
} handle;
# 1900
unsigned long long size;
# 1904
unsigned flags; __pad__(volatile char:8;)__pad__(volatile char:8;)__pad__(volatile char:8;)__pad__(volatile char:8;)
# 1905
};
#endif
# 1910 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1910
struct cudaExternalMemoryBufferDesc {
# 1914
unsigned long long offset;
# 1918
unsigned long long size;
# 1922
unsigned flags;
# 1923
};
#endif
# 1928 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1928
struct cudaExternalMemoryMipmappedArrayDesc {
# 1933
unsigned long long offset;
# 1937
cudaChannelFormatDesc formatDesc;
# 1941
cudaExtent extent;
# 1946
unsigned flags;
# 1950
unsigned numLevels;
# 1951
};
#endif
# 1956 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1956
enum cudaExternalSemaphoreHandleType {
# 1960
cudaExternalSemaphoreHandleTypeOpaqueFd = 1,
# 1964
cudaExternalSemaphoreHandleTypeOpaqueWin32,
# 1968
cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt,
# 1972
cudaExternalSemaphoreHandleTypeD3D12Fence
# 1973
};
#endif
# 1978 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 1978
struct cudaExternalSemaphoreHandleDesc {
# 1982
cudaExternalSemaphoreHandleType type;
# 1983
union {
# 1988
int fd;
# 1999 "/usr/local/cuda-10.1/include/driver_types.h" 3
struct {
# 2003
void *handle;
# 2008
const void *name;
# 2009
} win32;
# 2010
} handle;
# 2014
unsigned flags; __pad__(volatile char:8;)__pad__(volatile char:8;)__pad__(volatile char:8;)__pad__(volatile char:8;)
# 2015
};
#endif
# 2020 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 2020
struct cudaExternalSemaphoreSignalParams {
# 2021
union {
# 2025
struct {
# 2029
unsigned long long value;
# 2030
} fence;
# 2031
} params;
# 2035
unsigned flags;
# 2036
};
#endif
# 2041 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 2041
struct cudaExternalSemaphoreWaitParams {
# 2042
union {
# 2046
struct {
# 2050
unsigned long long value;
# 2051
} fence;
# 2052
} params;
# 2056
unsigned flags;
# 2057
};
#endif
# 2069 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
typedef cudaError
# 2069
cudaError_t;
#endif
# 2074 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
typedef struct CUstream_st *
# 2074
cudaStream_t;
#endif
# 2079 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
typedef struct CUevent_st *
# 2079
cudaEvent_t;
#endif
# 2084 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
typedef cudaGraphicsResource *
# 2084
cudaGraphicsResource_t;
#endif
# 2089 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
typedef cudaOutputMode
# 2089
cudaOutputMode_t;
#endif
# 2094 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
typedef struct CUexternalMemory_st *
# 2094
cudaExternalMemory_t;
#endif
# 2099 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
typedef struct CUexternalSemaphore_st *
# 2099
cudaExternalSemaphore_t;
#endif
# 2104 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
typedef struct CUgraph_st *
# 2104
cudaGraph_t;
#endif
# 2109 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
typedef struct CUgraphNode_st *
# 2109
cudaGraphNode_t;
#endif
# 2114 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 2114
enum cudaCGScope {
# 2115
cudaCGScopeInvalid,
# 2116
cudaCGScopeGrid,
# 2117
cudaCGScopeMultiGrid
# 2118
};
#endif
# 2123 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 2123
struct cudaLaunchParams {
# 2125
void *func;
# 2126
dim3 gridDim;
# 2127
dim3 blockDim;
# 2128
void **args;
# 2129
size_t sharedMem;
# 2130
cudaStream_t stream;
# 2131
};
#endif
# 2136 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 2136
struct cudaKernelNodeParams {
# 2137
void *func;
# 2138
dim3 gridDim;
# 2139
dim3 blockDim;
# 2140
unsigned sharedMemBytes;
# 2141
void **kernelParams;
# 2142
void **extra;
# 2143
};
#endif
# 2148 "/usr/local/cuda-10.1/include/driver_types.h" 3
#if 0
# 2148
enum cudaGraphNodeType {
# 2149
cudaGraphNodeTypeKernel,
# 2150
cudaGraphNodeTypeMemcpy,
# 2151
cudaGraphNodeTypeMemset,
# 2152
cudaGraphNodeTypeHost,
# 2153
cudaGraphNodeTypeGraph,
# 2154
cudaGraphNodeTypeEmpty,
# 2155
cudaGraphNodeTypeCount
# 2156
};
#endif
# 2161 "/usr/local/cuda-10.1/include/driver_types.h" 3
typedef struct CUgraphExec_st *cudaGraphExec_t;
# 84 "/usr/local/cuda-10.1/include/surface_types.h" 3
#if 0
# 84
enum cudaSurfaceBoundaryMode {
# 86
cudaBoundaryModeZero,
# 87
cudaBoundaryModeClamp,
# 88
cudaBoundaryModeTrap
# 89
};
#endif
# 94 "/usr/local/cuda-10.1/include/surface_types.h" 3
#if 0
# 94
enum cudaSurfaceFormatMode {
# 96
cudaFormatModeForced,
# 97
cudaFormatModeAuto
# 98
};
#endif
# 103 "/usr/local/cuda-10.1/include/surface_types.h" 3
#if 0
# 103
struct surfaceReference {
# 108
cudaChannelFormatDesc channelDesc;
# 109
};
#endif
# 114 "/usr/local/cuda-10.1/include/surface_types.h" 3
#if 0
typedef unsigned long long
# 114
cudaSurfaceObject_t;
#endif
# 84 "/usr/local/cuda-10.1/include/texture_types.h" 3
#if 0
# 84
enum cudaTextureAddressMode {
# 86
cudaAddressModeWrap,
# 87
cudaAddressModeClamp,
# 88
cudaAddressModeMirror,
# 89
cudaAddressModeBorder
# 90
};
#endif
# 95 "/usr/local/cuda-10.1/include/texture_types.h" 3
#if 0
# 95
enum cudaTextureFilterMode {
# 97
cudaFilterModePoint,
# 98
cudaFilterModeLinear
# 99
};
#endif
# 104 "/usr/local/cuda-10.1/include/texture_types.h" 3
#if 0
# 104
enum cudaTextureReadMode {
# 106
cudaReadModeElementType,
# 107
cudaReadModeNormalizedFloat
# 108
};
#endif
# 113 "/usr/local/cuda-10.1/include/texture_types.h" 3
#if 0
# 113
struct textureReference {
# 118
int normalized;
# 122
cudaTextureFilterMode filterMode;
# 126
cudaTextureAddressMode addressMode[3];
# 130
cudaChannelFormatDesc channelDesc;
# 134
int sRGB;
# 138
unsigned maxAnisotropy;
# 142
cudaTextureFilterMode mipmapFilterMode;
# 146
float mipmapLevelBias;
# 150
float minMipmapLevelClamp;
# 154
float maxMipmapLevelClamp;
# 155
int __cudaReserved[15];
# 156
};
#endif
# 161 "/usr/local/cuda-10.1/include/texture_types.h" 3
#if 0
# 161
struct cudaTextureDesc {
# 166
cudaTextureAddressMode addressMode[3];
# 170
cudaTextureFilterMode filterMode;
# 174
cudaTextureReadMode readMode;
# 178
int sRGB;
# 182
float borderColor[4];
# 186
int normalizedCoords;
# 190
unsigned maxAnisotropy;
# 194
cudaTextureFilterMode mipmapFilterMode;
# 198
float mipmapLevelBias;
# 202
float minMipmapLevelClamp;
# 206
float maxMipmapLevelClamp;
# 207
};
#endif
# 212 "/usr/local/cuda-10.1/include/texture_types.h" 3
#if 0
typedef unsigned long long
# 212
cudaTextureObject_t;
#endif
# 70 "/usr/local/cuda-10.1/include/library_types.h" 3
typedef
# 54
enum cudaDataType_t {
# 56
CUDA_R_16F = 2,
# 57
CUDA_C_16F = 6,
# 58
CUDA_R_32F = 0,
# 59
CUDA_C_32F = 4,
# 60
CUDA_R_64F = 1,
# 61
CUDA_C_64F = 5,
# 62
CUDA_R_8I = 3,
# 63
CUDA_C_8I = 7,
# 64
CUDA_R_8U,
# 65
CUDA_C_8U,
# 66
CUDA_R_32I,
# 67
CUDA_C_32I,
# 68
CUDA_R_32U,
# 69
CUDA_C_32U
# 70
} cudaDataType;
# 78
typedef
# 73
enum libraryPropertyType_t {
# 75
MAJOR_VERSION,
# 76
MINOR_VERSION,
# 77
PATCH_LEVEL
# 78
} libraryPropertyType;
# 121 "/usr/local/cuda-10.1/include/cuda_device_runtime_api.h" 3
extern "C" {
# 123
extern cudaError_t cudaDeviceGetAttribute(int * value, cudaDeviceAttr attr, int device);
# 124
extern cudaError_t cudaDeviceGetLimit(size_t * pValue, cudaLimit limit);
# 125
extern cudaError_t cudaDeviceGetCacheConfig(cudaFuncCache * pCacheConfig);
# 126
extern cudaError_t cudaDeviceGetSharedMemConfig(cudaSharedMemConfig * pConfig);
# 127
extern cudaError_t cudaDeviceSynchronize();
# 128
extern cudaError_t cudaGetLastError();
# 129
extern cudaError_t cudaPeekAtLastError();
# 130
extern const char *cudaGetErrorString(cudaError_t error);
# 131
extern const char *cudaGetErrorName(cudaError_t error);
# 132
extern cudaError_t cudaGetDeviceCount(int * count);
# 133
extern cudaError_t cudaGetDevice(int * device);
# 134
extern cudaError_t cudaStreamCreateWithFlags(cudaStream_t * pStream, unsigned flags);
# 135
extern cudaError_t cudaStreamDestroy(cudaStream_t stream);
# 136
extern cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned flags);
# 137
__attribute__((unused)) extern cudaError_t cudaStreamWaitEvent_ptsz(cudaStream_t stream, cudaEvent_t event, unsigned flags);
# 138
extern cudaError_t cudaEventCreateWithFlags(cudaEvent_t * event, unsigned flags);
# 139
extern cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream);
# 140
__attribute__((unused)) extern cudaError_t cudaEventRecord_ptsz(cudaEvent_t event, cudaStream_t stream);
# 141
extern cudaError_t cudaEventDestroy(cudaEvent_t event);
# 142
extern cudaError_t cudaFuncGetAttributes(cudaFuncAttributes * attr, const void * func);
# 143
extern cudaError_t cudaFree(void * devPtr);
# 144
extern cudaError_t cudaMalloc(void ** devPtr, size_t size);
# 145
extern cudaError_t cudaMemcpyAsync(void * dst, const void * src, size_t count, cudaMemcpyKind kind, cudaStream_t stream);
# 146
__attribute__((unused)) extern cudaError_t cudaMemcpyAsync_ptsz(void * dst, const void * src, size_t count, cudaMemcpyKind kind, cudaStream_t stream);
# 147
extern cudaError_t cudaMemcpy2DAsync(void * dst, size_t dpitch, const void * src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream);
# 148
__attribute__((unused)) extern cudaError_t cudaMemcpy2DAsync_ptsz(void * dst, size_t dpitch, const void * src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream);
# 149
extern cudaError_t cudaMemcpy3DAsync(const cudaMemcpy3DParms * p, cudaStream_t stream);
# 150
__attribute__((unused)) extern cudaError_t cudaMemcpy3DAsync_ptsz(const cudaMemcpy3DParms * p, cudaStream_t stream);
# 151
extern cudaError_t cudaMemsetAsync(void * devPtr, int value, size_t count, cudaStream_t stream);
# 152
__attribute__((unused)) extern cudaError_t cudaMemsetAsync_ptsz(void * devPtr, int value, size_t count, cudaStream_t stream);
# 153
extern cudaError_t cudaMemset2DAsync(void * devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream);
# 154
__attribute__((unused)) extern cudaError_t cudaMemset2DAsync_ptsz(void * devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream);
# 155
extern cudaError_t cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream);
# 156
__attribute__((unused)) extern cudaError_t cudaMemset3DAsync_ptsz(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream);
# 157
extern cudaError_t cudaRuntimeGetVersion(int * runtimeVersion);
# 178 "/usr/local/cuda-10.1/include/cuda_device_runtime_api.h" 3
__attribute__((unused)) extern void *cudaGetParameterBuffer(size_t alignment, size_t size);
# 206 "/usr/local/cuda-10.1/include/cuda_device_runtime_api.h" 3
__attribute__((unused)) extern void *cudaGetParameterBufferV2(void * func, dim3 gridDimension, dim3 blockDimension, unsigned sharedMemSize);
# 207
__attribute__((unused)) extern cudaError_t cudaLaunchDevice_ptsz(void * func, void * parameterBuffer, dim3 gridDimension, dim3 blockDimension, unsigned sharedMemSize, cudaStream_t stream);
# 208
__attribute__((unused)) extern cudaError_t cudaLaunchDeviceV2_ptsz(void * parameterBuffer, cudaStream_t stream);
# 226 "/usr/local/cuda-10.1/include/cuda_device_runtime_api.h" 3
__attribute__((unused)) extern cudaError_t cudaLaunchDevice(void * func, void * parameterBuffer, dim3 gridDimension, dim3 blockDimension, unsigned sharedMemSize, cudaStream_t stream);
# 227
__attribute__((unused)) extern cudaError_t cudaLaunchDeviceV2(void * parameterBuffer, cudaStream_t stream);
# 230
extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int * numBlocks, const void * func, int blockSize, size_t dynamicSmemSize);
# 231
extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int * numBlocks, const void * func, int blockSize, size_t dynamicSmemSize, unsigned flags);
# 233
__attribute__((unused)) extern unsigned long long cudaCGGetIntrinsicHandle(cudaCGScope scope);
# 234
__attribute__((unused)) extern cudaError_t cudaCGSynchronize(unsigned long long handle, unsigned flags);
# 235
__attribute__((unused)) extern cudaError_t cudaCGSynchronizeGrid(unsigned long long handle, unsigned flags);
# 236
__attribute__((unused)) extern cudaError_t cudaCGGetSize(unsigned * numThreads, unsigned * numGrids, unsigned long long handle);
# 237
__attribute__((unused)) extern cudaError_t cudaCGGetRank(unsigned * threadRank, unsigned * gridRank, unsigned long long handle);
# 238
}
# 240
template< class T> static inline cudaError_t cudaMalloc(T ** devPtr, size_t size);
# 241
template< class T> static inline cudaError_t cudaFuncGetAttributes(cudaFuncAttributes * attr, T * entry);
# 242
template< class T> static inline cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int * numBlocks, T func, int blockSize, size_t dynamicSmemSize);
# 243
template< class T> static inline cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int * numBlocks, T func, int blockSize, size_t dynamicSmemSize, unsigned flags);
# 245 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern "C" {
# 280 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceReset();
# 301 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceSynchronize();
# 386 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceSetLimit(cudaLimit limit, size_t value);
# 420 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceGetLimit(size_t * pValue, cudaLimit limit);
# 453 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceGetCacheConfig(cudaFuncCache * pCacheConfig);
# 490 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceGetStreamPriorityRange(int * leastPriority, int * greatestPriority);
# 534 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig);
# 565 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceGetSharedMemConfig(cudaSharedMemConfig * pConfig);
# 609 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config);
# 636 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceGetByPCIBusId(int * device, const char * pciBusId);
# 666 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceGetPCIBusId(char * pciBusId, int len, int device);
# 713 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t * handle, cudaEvent_t event);
# 753 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaIpcOpenEventHandle(cudaEvent_t * event, cudaIpcEventHandle_t handle);
# 796 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t * handle, void * devPtr);
# 854 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaIpcOpenMemHandle(void ** devPtr, cudaIpcMemHandle_t handle, unsigned flags);
# 889 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaIpcCloseMemHandle(void * devPtr);
# 931 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
__attribute((deprecated)) extern cudaError_t cudaThreadExit();
# 957 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
__attribute((deprecated)) extern cudaError_t cudaThreadSynchronize();
# 1006 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
__attribute((deprecated)) extern cudaError_t cudaThreadSetLimit(cudaLimit limit, size_t value);
# 1039 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
__attribute((deprecated)) extern cudaError_t cudaThreadGetLimit(size_t * pValue, cudaLimit limit);
# 1075 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
__attribute((deprecated)) extern cudaError_t cudaThreadGetCacheConfig(cudaFuncCache * pCacheConfig);
# 1122 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
__attribute((deprecated)) extern cudaError_t cudaThreadSetCacheConfig(cudaFuncCache cacheConfig);
# 1181 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetLastError();
# 1227 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaPeekAtLastError();
# 1243 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern const char *cudaGetErrorName(cudaError_t error);
# 1259 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern const char *cudaGetErrorString(cudaError_t error);
# 1288 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetDeviceCount(int * count);
# 1559 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetDeviceProperties(cudaDeviceProp * prop, int device);
# 1748 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceGetAttribute(int * value, cudaDeviceAttr attr, int device);
# 1788 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceGetP2PAttribute(int * value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice);
# 1809 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaChooseDevice(int * device, const cudaDeviceProp * prop);
# 1846 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaSetDevice(int device);
# 1867 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetDevice(int * device);
# 1898 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaSetValidDevices(int * device_arr, int len);
# 1967 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaSetDeviceFlags(unsigned flags);
# 2013 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetDeviceFlags(unsigned * flags);
# 2053 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamCreate(cudaStream_t * pStream);
# 2085 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamCreateWithFlags(cudaStream_t * pStream, unsigned flags);
# 2131 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamCreateWithPriority(cudaStream_t * pStream, unsigned flags, int priority);
# 2158 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int * priority);
# 2183 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned * flags);
# 2214 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamDestroy(cudaStream_t stream);
# 2240 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned flags);
# 2248
typedef void (*cudaStreamCallback_t)(cudaStream_t stream, cudaError_t status, void * userData);
# 2315 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void * userData, unsigned flags);
# 2339 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamSynchronize(cudaStream_t stream);
# 2364 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamQuery(cudaStream_t stream);
# 2447 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void * devPtr, size_t length = 0, unsigned flags = 4);
# 2483 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode);
# 2534 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode * mode);
# 2562 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t * pGraph);
# 2600 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus * pCaptureStatus);
# 2628 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus * pCaptureStatus, unsigned long long * pId);
# 2666 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaEventCreate(cudaEvent_t * event);
# 2703 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaEventCreateWithFlags(cudaEvent_t * event, unsigned flags);
# 2742 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream = 0);
# 2773 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaEventQuery(cudaEvent_t event);
# 2803 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaEventSynchronize(cudaEvent_t event);
# 2830 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaEventDestroy(cudaEvent_t event);
# 2873 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaEventElapsedTime(float * ms, cudaEvent_t start, cudaEvent_t end);
# 3012 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaImportExternalMemory(cudaExternalMemory_t * extMem_out, const cudaExternalMemoryHandleDesc * memHandleDesc);
# 3066 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaExternalMemoryGetMappedBuffer(void ** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc * bufferDesc);
# 3121 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t * mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc * mipmapDesc);
# 3144 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem);
# 3238 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t * extSem_out, const cudaExternalSemaphoreHandleDesc * semHandleDesc);
# 3277 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t * extSemArray, const cudaExternalSemaphoreSignalParams * paramsArray, unsigned numExtSems, cudaStream_t stream = 0);
# 3320 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t * extSemArray, const cudaExternalSemaphoreWaitParams * paramsArray, unsigned numExtSems, cudaStream_t stream = 0);
# 3342 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem);
# 3407 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaLaunchKernel(const void * func, dim3 gridDim, dim3 blockDim, void ** args, size_t sharedMem, cudaStream_t stream);
# 3464 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaLaunchCooperativeKernel(const void * func, dim3 gridDim, dim3 blockDim, void ** args, size_t sharedMem, cudaStream_t stream);
# 3563 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaLaunchCooperativeKernelMultiDevice(cudaLaunchParams * launchParamsList, unsigned numDevices, unsigned flags = 0);
# 3612 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaFuncSetCacheConfig(const void * func, cudaFuncCache cacheConfig);
# 3667 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaFuncSetSharedMemConfig(const void * func, cudaSharedMemConfig config);
# 3702 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaFuncGetAttributes(cudaFuncAttributes * attr, const void * func);
# 3741 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaFuncSetAttribute(const void * func, cudaFuncAttribute attr, int value);
# 3765 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
__attribute((deprecated)) extern cudaError_t cudaSetDoubleForDevice(double * d);
# 3789 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
__attribute((deprecated)) extern cudaError_t cudaSetDoubleForHost(double * d);
# 3855 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void * userData);
# 3910 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int * numBlocks, const void * func, int blockSize, size_t dynamicSMemSize);
# 3954 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int * numBlocks, const void * func, int blockSize, size_t dynamicSMemSize, unsigned flags);
# 4074 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMallocManaged(void ** devPtr, size_t size, unsigned flags = 1);
# 4105 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMalloc(void ** devPtr, size_t size);
# 4138 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMallocHost(void ** ptr, size_t size);
# 4181 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMallocPitch(void ** devPtr, size_t * pitch, size_t width, size_t height);
# 4227 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMallocArray(cudaArray_t * array, const cudaChannelFormatDesc * desc, size_t width, size_t height = 0, unsigned flags = 0);
# 4256 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaFree(void * devPtr);
# 4279 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaFreeHost(void * ptr);
# 4302 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaFreeArray(cudaArray_t array);
# 4325 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray);
# 4391 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaHostAlloc(void ** pHost, size_t size, unsigned flags);
# 4475 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaHostRegister(void * ptr, size_t size, unsigned flags);
# 4498 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaHostUnregister(void * ptr);
# 4543 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaHostGetDevicePointer(void ** pDevice, void * pHost, unsigned flags);
# 4565 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaHostGetFlags(unsigned * pFlags, void * pHost);
# 4604 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMalloc3D(cudaPitchedPtr * pitchedDevPtr, cudaExtent extent);
# 4743 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMalloc3DArray(cudaArray_t * array, const cudaChannelFormatDesc * desc, cudaExtent extent, unsigned flags = 0);
# 4882 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t * mipmappedArray, const cudaChannelFormatDesc * desc, cudaExtent extent, unsigned numLevels, unsigned flags = 0);
# 4911 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t * levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned level);
# 5016 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpy3D(const cudaMemcpy3DParms * p);
# 5047 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms * p);
# 5165 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpy3DAsync(const cudaMemcpy3DParms * p, cudaStream_t stream = 0);
# 5191 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms * p, cudaStream_t stream = 0);
# 5213 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemGetInfo(size_t * free, size_t * total);
# 5239 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaArrayGetInfo(cudaChannelFormatDesc * desc, cudaExtent * extent, unsigned * flags, cudaArray_t array);
# 5282 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpy(void * dst, const void * src, size_t count, cudaMemcpyKind kind);
# 5317 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpyPeer(void * dst, int dstDevice, const void * src, int srcDevice, size_t count);
# 5365 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpy2D(void * dst, size_t dpitch, const void * src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind);
# 5414 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void * src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind);
# 5463 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpy2DFromArray(void * dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind);
# 5510 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, cudaMemcpyKind kind = cudaMemcpyDeviceToDevice);
# 5553 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpyToSymbol(const void * symbol, const void * src, size_t count, size_t offset = 0, cudaMemcpyKind kind = cudaMemcpyHostToDevice);
# 5596 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpyFromSymbol(void * dst, const void * symbol, size_t count, size_t offset = 0, cudaMemcpyKind kind = cudaMemcpyDeviceToHost);
# 5652 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpyAsync(void * dst, const void * src, size_t count, cudaMemcpyKind kind, cudaStream_t stream = 0);
# 5687 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpyPeerAsync(void * dst, int dstDevice, const void * src, int srcDevice, size_t count, cudaStream_t stream = 0);
# 5749 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpy2DAsync(void * dst, size_t dpitch, const void * src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream = 0);
# 5806 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void * src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream = 0);
# 5862 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpy2DFromArrayAsync(void * dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, cudaMemcpyKind kind, cudaStream_t stream = 0);
# 5913 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpyToSymbolAsync(const void * symbol, const void * src, size_t count, size_t offset, cudaMemcpyKind kind, cudaStream_t stream = 0);
# 5964 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemcpyFromSymbolAsync(void * dst, const void * symbol, size_t count, size_t offset, cudaMemcpyKind kind, cudaStream_t stream = 0);
# 5993 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemset(void * devPtr, int value, size_t count);
# 6027 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemset2D(void * devPtr, size_t pitch, int value, size_t width, size_t height);
# 6071 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent);
# 6107 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemsetAsync(void * devPtr, int value, size_t count, cudaStream_t stream = 0);
# 6148 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemset2DAsync(void * devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream = 0);
# 6199 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream = 0);
# 6227 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetSymbolAddress(void ** devPtr, const void * symbol);
# 6254 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetSymbolSize(size_t * size, const void * symbol);
# 6324 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemPrefetchAsync(const void * devPtr, size_t count, int dstDevice, cudaStream_t stream = 0);
# 6440 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemAdvise(const void * devPtr, size_t count, cudaMemoryAdvise advice, int device);
# 6499 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemRangeGetAttribute(void * data, size_t dataSize, cudaMemRangeAttribute attribute, const void * devPtr, size_t count);
# 6538 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaMemRangeGetAttributes(void ** data, size_t * dataSizes, cudaMemRangeAttribute * attributes, size_t numAttributes, const void * devPtr, size_t count);
# 6598 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
__attribute((deprecated)) extern cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void * src, size_t count, cudaMemcpyKind kind);
# 6640 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
__attribute((deprecated)) extern cudaError_t cudaMemcpyFromArray(void * dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind);
# 6683 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
__attribute((deprecated)) extern cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, cudaMemcpyKind kind = cudaMemcpyDeviceToDevice);
# 6734 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
__attribute((deprecated)) extern cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void * src, size_t count, cudaMemcpyKind kind, cudaStream_t stream = 0);
# 6784 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
__attribute((deprecated)) extern cudaError_t cudaMemcpyFromArrayAsync(void * dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind, cudaStream_t stream = 0);
# 6950 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaPointerGetAttributes(cudaPointerAttributes * attributes, const void * ptr);
# 6991 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceCanAccessPeer(int * canAccessPeer, int device, int peerDevice);
# 7033 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned flags);
# 7055 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDeviceDisablePeerAccess(int peerDevice);
# 7118 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource);
# 7153 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned flags);
# 7192 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t * resources, cudaStream_t stream = 0);
# 7227 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t * resources, cudaStream_t stream = 0);
# 7259 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphicsResourceGetMappedPointer(void ** devPtr, size_t * size, cudaGraphicsResource_t resource);
# 7297 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t * array, cudaGraphicsResource_t resource, unsigned arrayIndex, unsigned mipLevel);
# 7326 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t * mipmappedArray, cudaGraphicsResource_t resource);
# 7397 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaBindTexture(size_t * offset, const textureReference * texref, const void * devPtr, const cudaChannelFormatDesc * desc, size_t size = ((2147483647) * 2U) + 1U);
# 7456 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaBindTexture2D(size_t * offset, const textureReference * texref, const void * devPtr, const cudaChannelFormatDesc * desc, size_t width, size_t height, size_t pitch);
# 7494 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaBindTextureToArray(const textureReference * texref, cudaArray_const_t array, const cudaChannelFormatDesc * desc);
# 7534 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaBindTextureToMipmappedArray(const textureReference * texref, cudaMipmappedArray_const_t mipmappedArray, const cudaChannelFormatDesc * desc);
# 7560 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaUnbindTexture(const textureReference * texref);
# 7589 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetTextureAlignmentOffset(size_t * offset, const textureReference * texref);
# 7619 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetTextureReference(const textureReference ** texref, const void * symbol);
# 7664 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaBindSurfaceToArray(const surfaceReference * surfref, cudaArray_const_t array, const cudaChannelFormatDesc * desc);
# 7689 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetSurfaceReference(const surfaceReference ** surfref, const void * symbol);
# 7724 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetChannelDesc(cudaChannelFormatDesc * desc, cudaArray_const_t array);
# 7754 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f);
# 7969 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaCreateTextureObject(cudaTextureObject_t * pTexObject, const cudaResourceDesc * pResDesc, const cudaTextureDesc * pTexDesc, const cudaResourceViewDesc * pResViewDesc);
# 7988 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject);
# 8008 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetTextureObjectResourceDesc(cudaResourceDesc * pResDesc, cudaTextureObject_t texObject);
# 8028 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetTextureObjectTextureDesc(cudaTextureDesc * pTexDesc, cudaTextureObject_t texObject);
# 8049 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc * pResViewDesc, cudaTextureObject_t texObject);
# 8094 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t * pSurfObject, const cudaResourceDesc * pResDesc);
# 8113 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject);
# 8132 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGetSurfaceObjectResourceDesc(cudaResourceDesc * pResDesc, cudaSurfaceObject_t surfObject);
# 8166 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaDriverGetVersion(int * driverVersion);
# 8191 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaRuntimeGetVersion(int * runtimeVersion);
# 8238 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphCreate(cudaGraph_t * pGraph, unsigned flags);
# 8335 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t * pGraphNode, cudaGraph_t graph, const cudaGraphNode_t * pDependencies, size_t numDependencies, const cudaKernelNodeParams * pNodeParams);
# 8368 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams * pNodeParams);
# 8393 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams * pNodeParams);
# 8437 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t * pGraphNode, cudaGraph_t graph, const cudaGraphNode_t * pDependencies, size_t numDependencies, const cudaMemcpy3DParms * pCopyParams);
# 8460 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms * pNodeParams);
# 8483 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms * pNodeParams);
# 8525 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t * pGraphNode, cudaGraph_t graph, const cudaGraphNode_t * pDependencies, size_t numDependencies, const cudaMemsetParams * pMemsetParams);
# 8548 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams * pNodeParams);
# 8571 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams * pNodeParams);
# 8612 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphAddHostNode(cudaGraphNode_t * pGraphNode, cudaGraph_t graph, const cudaGraphNode_t * pDependencies, size_t numDependencies, const cudaHostNodeParams * pNodeParams);
# 8635 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams * pNodeParams);
# 8658 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams * pNodeParams);
# 8696 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t * pGraphNode, cudaGraph_t graph, const cudaGraphNode_t * pDependencies, size_t numDependencies, cudaGraph_t childGraph);
# 8720 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t * pGraph);
# 8757 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t * pGraphNode, cudaGraph_t graph, const cudaGraphNode_t * pDependencies, size_t numDependencies);
# 8784 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphClone(cudaGraph_t * pGraphClone, cudaGraph_t originalGraph);
# 8812 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t * pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph);
# 8843 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType * pType);
# 8874 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t * nodes, size_t * numNodes);
# 8905 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t * pRootNodes, size_t * pNumRootNodes);
# 8939 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t * from, cudaGraphNode_t * to, size_t * numEdges);
# 8970 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t * pDependencies, size_t * pNumDependencies);
# 9002 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t * pDependentNodes, size_t * pNumDependentNodes);
# 9033 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t * from, const cudaGraphNode_t * to, size_t numDependencies);
# 9064 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t * from, const cudaGraphNode_t * to, size_t numDependencies);
# 9090 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node);
# 9126 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphInstantiate(cudaGraphExec_t * pGraphExec, cudaGraph_t graph, cudaGraphNode_t * pErrorNode, char * pLogBuffer, size_t bufferSize);
# 9160 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams * pNodeParams);
# 9185 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream);
# 9206 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec);
# 9226 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
extern cudaError_t cudaGraphDestroy(cudaGraph_t graph);
# 9231
extern cudaError_t cudaGetExportTable(const void ** ppExportTable, const cudaUUID_t * pExportTableId);
# 9476 "/usr/local/cuda-10.1/include/cuda_runtime_api.h" 3
}
# 104 "/usr/local/cuda-10.1/include/channel_descriptor.h" 3
template< class T> inline cudaChannelFormatDesc cudaCreateChannelDesc()
# 105
{
# 106
return cudaCreateChannelDesc(0, 0, 0, 0, cudaChannelFormatKindNone);
# 107
}
# 109
static inline cudaChannelFormatDesc cudaCreateChannelDescHalf()
# 110
{
# 111
int e = (((int)sizeof(unsigned short)) * 8);
# 113
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindFloat);
# 114
}
# 116
static inline cudaChannelFormatDesc cudaCreateChannelDescHalf1()
# 117
{
# 118
int e = (((int)sizeof(unsigned short)) * 8);
# 120
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindFloat);
# 121
}
# 123
static inline cudaChannelFormatDesc cudaCreateChannelDescHalf2()
# 124
{
# 125
int e = (((int)sizeof(unsigned short)) * 8);
# 127
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindFloat);
# 128
}
# 130
static inline cudaChannelFormatDesc cudaCreateChannelDescHalf4()
# 131
{
# 132
int e = (((int)sizeof(unsigned short)) * 8);
# 134
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindFloat);
# 135
}
# 137
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< char> ()
# 138
{
# 139
int e = (((int)sizeof(char)) * 8);
# 144
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
# 146
}
# 148
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< signed char> ()
# 149
{
# 150
int e = (((int)sizeof(signed char)) * 8);
# 152
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
# 153
}
# 155
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< unsigned char> ()
# 156
{
# 157
int e = (((int)sizeof(unsigned char)) * 8);
# 159
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
# 160
}
# 162
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< char1> ()
# 163
{
# 164
int e = (((int)sizeof(signed char)) * 8);
# 166
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
# 167
}
# 169
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< uchar1> ()
# 170
{
# 171
int e = (((int)sizeof(unsigned char)) * 8);
# 173
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
# 174
}
# 176
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< char2> ()
# 177
{
# 178
int e = (((int)sizeof(signed char)) * 8);
# 180
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindSigned);
# 181
}
# 183
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< uchar2> ()
# 184
{
# 185
int e = (((int)sizeof(unsigned char)) * 8);
# 187
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindUnsigned);
# 188
}
# 190
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< char4> ()
# 191
{
# 192
int e = (((int)sizeof(signed char)) * 8);
# 194
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindSigned);
# 195
}
# 197
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< uchar4> ()
# 198
{
# 199
int e = (((int)sizeof(unsigned char)) * 8);
# 201
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindUnsigned);
# 202
}
# 204
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< short> ()
# 205
{
# 206
int e = (((int)sizeof(short)) * 8);
# 208
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
# 209
}
# 211
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< unsigned short> ()
# 212
{
# 213
int e = (((int)sizeof(unsigned short)) * 8);
# 215
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
# 216
}
# 218
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< short1> ()
# 219
{
# 220
int e = (((int)sizeof(short)) * 8);
# 222
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
# 223
}
# 225
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< ushort1> ()
# 226
{
# 227
int e = (((int)sizeof(unsigned short)) * 8);
# 229
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
# 230
}
# 232
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< short2> ()
# 233
{
# 234
int e = (((int)sizeof(short)) * 8);
# 236
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindSigned);
# 237
}
# 239
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< ushort2> ()
# 240
{
# 241
int e = (((int)sizeof(unsigned short)) * 8);
# 243
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindUnsigned);
# 244
}
# 246
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< short4> ()
# 247
{
# 248
int e = (((int)sizeof(short)) * 8);
# 250
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindSigned);
# 251
}
# 253
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< ushort4> ()
# 254
{
# 255
int e = (((int)sizeof(unsigned short)) * 8);
# 257
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindUnsigned);
# 258
}
# 260
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< int> ()
# 261
{
# 262
int e = (((int)sizeof(int)) * 8);
# 264
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
# 265
}
# 267
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< unsigned> ()
# 268
{
# 269
int e = (((int)sizeof(unsigned)) * 8);
# 271
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
# 272
}
# 274
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< int1> ()
# 275
{
# 276
int e = (((int)sizeof(int)) * 8);
# 278
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
# 279
}
# 281
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< uint1> ()
# 282
{
# 283
int e = (((int)sizeof(unsigned)) * 8);
# 285
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
# 286
}
# 288
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< int2> ()
# 289
{
# 290
int e = (((int)sizeof(int)) * 8);
# 292
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindSigned);
# 293
}
# 295
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< uint2> ()
# 296
{
# 297
int e = (((int)sizeof(unsigned)) * 8);
# 299
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindUnsigned);
# 300
}
# 302
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< int4> ()
# 303
{
# 304
int e = (((int)sizeof(int)) * 8);
# 306
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindSigned);
# 307
}
# 309
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< uint4> ()
# 310
{
# 311
int e = (((int)sizeof(unsigned)) * 8);
# 313
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindUnsigned);
# 314
}
# 376 "/usr/local/cuda-10.1/include/channel_descriptor.h" 3
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< float> ()
# 377
{
# 378
int e = (((int)sizeof(float)) * 8);
# 380
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindFloat);
# 381
}
# 383
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< float1> ()
# 384
{
# 385
int e = (((int)sizeof(float)) * 8);
# 387
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindFloat);
# 388
}
# 390
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< float2> ()
# 391
{
# 392
int e = (((int)sizeof(float)) * 8);
# 394
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindFloat);
# 395
}
# 397
template<> inline cudaChannelFormatDesc cudaCreateChannelDesc< float4> ()
# 398
{
# 399
int e = (((int)sizeof(float)) * 8);
# 401
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindFloat);
# 402
}
# 79 "/usr/local/cuda-10.1/include/driver_functions.h" 3
static inline cudaPitchedPtr make_cudaPitchedPtr(void *d, size_t p, size_t xsz, size_t ysz)
# 80
{
# 81
cudaPitchedPtr s;
# 83
(s.ptr) = d;
# 84
(s.pitch) = p;
# 85
(s.xsize) = xsz;
# 86
(s.ysize) = ysz;
# 88
return s;
# 89
}
# 106 "/usr/local/cuda-10.1/include/driver_functions.h" 3
static inline cudaPos make_cudaPos(size_t x, size_t y, size_t z)
# 107
{
# 108
cudaPos p;
# 110
(p.x) = x;
# 111
(p.y) = y;
# 112
(p.z) = z;
# 114
return p;
# 115
}
# 132 "/usr/local/cuda-10.1/include/driver_functions.h" 3
static inline cudaExtent make_cudaExtent(size_t w, size_t h, size_t d)
# 133
{
# 134
cudaExtent e;
# 136
(e.width) = w;
# 137
(e.height) = h;
# 138
(e.depth) = d;
# 140
return e;
# 141
}
# 73 "/usr/local/cuda-10.1/include/vector_functions.h" 3
static inline char1 make_char1(signed char x);
# 75
static inline uchar1 make_uchar1(unsigned char x);
# 77
static inline char2 make_char2(signed char x, signed char y);
# 79
static inline uchar2 make_uchar2(unsigned char x, unsigned char y);
# 81
static inline char3 make_char3(signed char x, signed char y, signed char z);
# 83
static inline uchar3 make_uchar3(unsigned char x, unsigned char y, unsigned char z);
# 85
static inline char4 make_char4(signed char x, signed char y, signed char z, signed char w);
# 87
static inline uchar4 make_uchar4(unsigned char x, unsigned char y, unsigned char z, unsigned char w);
# 89
static inline short1 make_short1(short x);
# 91
static inline ushort1 make_ushort1(unsigned short x);
# 93
static inline short2 make_short2(short x, short y);
# 95
static inline ushort2 make_ushort2(unsigned short x, unsigned short y);
# 97
static inline short3 make_short3(short x, short y, short z);
# 99
static inline ushort3 make_ushort3(unsigned short x, unsigned short y, unsigned short z);
# 101
static inline short4 make_short4(short x, short y, short z, short w);
# 103
static inline ushort4 make_ushort4(unsigned short x, unsigned short y, unsigned short z, unsigned short w);
# 105
static inline int1 make_int1(int x);
# 107
static inline uint1 make_uint1(unsigned x);
# 109
static inline int2 make_int2(int x, int y);
# 111
static inline uint2 make_uint2(unsigned x, unsigned y);
# 113
static inline int3 make_int3(int x, int y, int z);
# 115
static inline uint3 make_uint3(unsigned x, unsigned y, unsigned z);
# 117
static inline int4 make_int4(int x, int y, int z, int w);
# 119
static inline uint4 make_uint4(unsigned x, unsigned y, unsigned z, unsigned w);
# 121
static inline long1 make_long1(long x);
# 123
static inline ulong1 make_ulong1(unsigned long x);
# 125
static inline long2 make_long2(long x, long y);
# 127
static inline ulong2 make_ulong2(unsigned long x, unsigned long y);
# 129
static inline long3 make_long3(long x, long y, long z);
# 131
static inline ulong3 make_ulong3(unsigned long x, unsigned long y, unsigned long z);
# 133
static inline long4 make_long4(long x, long y, long z, long w);
# 135
static inline ulong4 make_ulong4(unsigned long x, unsigned long y, unsigned long z, unsigned long w);
# 137
static inline float1 make_float1(float x);
# 139
static inline float2 make_float2(float x, float y);
# 141
static inline float3 make_float3(float x, float y, float z);
# 143
static inline float4 make_float4(float x, float y, float z, float w);
# 145
static inline longlong1 make_longlong1(long long x);
# 147
static inline ulonglong1 make_ulonglong1(unsigned long long x);
# 149
static inline longlong2 make_longlong2(long long x, long long y);
# 151
static inline ulonglong2 make_ulonglong2(unsigned long long x, unsigned long long y);
# 153
static inline longlong3 make_longlong3(long long x, long long y, long long z);
# 155
static inline ulonglong3 make_ulonglong3(unsigned long long x, unsigned long long y, unsigned long long z);
# 157
static inline longlong4 make_longlong4(long long x, long long y, long long z, long long w);
# 159
static inline ulonglong4 make_ulonglong4(unsigned long long x, unsigned long long y, unsigned long long z, unsigned long long w);
# 161
static inline double1 make_double1(double x);
# 163
static inline double2 make_double2(double x, double y);
# 165
static inline double3 make_double3(double x, double y, double z);
# 167
static inline double4 make_double4(double x, double y, double z, double w);
# 73 "/usr/local/cuda-10.1/include/vector_functions.hpp" 3
static inline char1 make_char1(signed char x)
# 74
{
# 75
char1 t; (t.x) = x; return t;
# 76
}
# 78
static inline uchar1 make_uchar1(unsigned char x)
# 79
{
# 80
uchar1 t; (t.x) = x; return t;
# 81
}
# 83
static inline char2 make_char2(signed char x, signed char y)
# 84
{
# 85
char2 t; (t.x) = x; (t.y) = y; return t;
# 86
}
# 88
static inline uchar2 make_uchar2(unsigned char x, unsigned char y)
# 89
{
# 90
uchar2 t; (t.x) = x; (t.y) = y; return t;
# 91
}
# 93
static inline char3 make_char3(signed char x, signed char y, signed char z)
# 94
{
# 95
char3 t; (t.x) = x; (t.y) = y; (t.z) = z; return t;
# 96
}
# 98
static inline uchar3 make_uchar3(unsigned char x, unsigned char y, unsigned char z)
# 99
{
# 100
uchar3 t; (t.x) = x; (t.y) = y; (t.z) = z; return t;
# 101
}
# 103
static inline char4 make_char4(signed char x, signed char y, signed char z, signed char w)
# 104
{
# 105
char4 t; (t.x) = x; (t.y) = y; (t.z) = z; (t.w) = w; return t;
# 106
}
# 108
static inline uchar4 make_uchar4(unsigned char x, unsigned char y, unsigned char z, unsigned char w)
# 109
{
# 110
uchar4 t; (t.x) = x; (t.y) = y; (t.z) = z; (t.w) = w; return t;
# 111
}
# 113
static inline short1 make_short1(short x)
# 114
{
# 115
short1 t; (t.x) = x; return t;
# 116
}
# 118
static inline ushort1 make_ushort1(unsigned short x)
# 119
{
# 120
ushort1 t; (t.x) = x; return t;
# 121
}
# 123
static inline short2 make_short2(short x, short y)
# 124
{
# 125
short2 t; (t.x) = x; (t.y) = y; return t;
# 126
}
# 128
static inline ushort2 make_ushort2(unsigned short x, unsigned short y)
# 129
{
# 130
ushort2 t; (t.x) = x; (t.y) = y; return t;
# 131
}
# 133
static inline short3 make_short3(short x, short y, short z)
# 134
{
# 135
short3 t; (t.x) = x; (t.y) = y; (t.z) = z; return t;
# 136
}
# 138
static inline ushort3 make_ushort3(unsigned short x, unsigned short y, unsigned short z)
# 139
{
# 140
ushort3 t; (t.x) = x; (t.y) = y; (t.z) = z; return t;
# 141
}
# 143
static inline short4 make_short4(short x, short y, short z, short w)
# 144
{
# 145
short4 t; (t.x) = x; (t.y) = y; (t.z) = z; (t.w) = w; return t;
# 146
}
# 148
static inline ushort4 make_ushort4(unsigned short x, unsigned short y, unsigned short z, unsigned short w)
# 149
{
# 150
ushort4 t; (t.x) = x; (t.y) = y; (t.z) = z; (t.w) = w; return t;
# 151
}
# 153
static inline int1 make_int1(int x)
# 154
{
# 155
int1 t; (t.x) = x; return t;
# 156
}
# 158
static inline uint1 make_uint1(unsigned x)
# 159
{
# 160
uint1 t; (t.x) = x; return t;
# 161
}
# 163
static inline int2 make_int2(int x, int y)
# 164
{
# 165
int2 t; (t.x) = x; (t.y) = y; return t;
# 166
}
# 168
static inline uint2 make_uint2(unsigned x, unsigned y)
# 169
{
# 170
uint2 t; (t.x) = x; (t.y) = y; return t;
# 171
}
# 173
static inline int3 make_int3(int x, int y, int z)
# 174
{
# 175
int3 t; (t.x) = x; (t.y) = y; (t.z) = z; return t;
# 176
}
# 178
static inline uint3 make_uint3(unsigned x, unsigned y, unsigned z)
# 179
{
# 180
uint3 t; (t.x) = x; (t.y) = y; (t.z) = z; return t;
# 181
}
# 183
static inline int4 make_int4(int x, int y, int z, int w)
# 184
{
# 185
int4 t; (t.x) = x; (t.y) = y; (t.z) = z; (t.w) = w; return t;
# 186
}
# 188
static inline uint4 make_uint4(unsigned x, unsigned y, unsigned z, unsigned w)
# 189
{
# 190
uint4 t; (t.x) = x; (t.y) = y; (t.z) = z; (t.w) = w; return t;
# 191
}
# 193
static inline long1 make_long1(long x)
# 194
{
# 195
long1 t; (t.x) = x; return t;
# 196
}
# 198
static inline ulong1 make_ulong1(unsigned long x)
# 199
{
# 200
ulong1 t; (t.x) = x; return t;
# 201
}
# 203
static inline long2 make_long2(long x, long y)
# 204
{
# 205
long2 t; (t.x) = x; (t.y) = y; return t;
# 206
}
# 208
static inline ulong2 make_ulong2(unsigned long x, unsigned long y)
# 209
{
# 210
ulong2 t; (t.x) = x; (t.y) = y; return t;
# 211
}
# 213
static inline long3 make_long3(long x, long y, long z)
# 214
{
# 215
long3 t; (t.x) = x; (t.y) = y; (t.z) = z; return t;
# 216
}
# 218
static inline ulong3 make_ulong3(unsigned long x, unsigned long y, unsigned long z)
# 219
{
# 220
ulong3 t; (t.x) = x; (t.y) = y; (t.z) = z; return t;
# 221
}
# 223
static inline long4 make_long4(long x, long y, long z, long w)
# 224
{
# 225
long4 t; (t.x) = x; (t.y) = y; (t.z) = z; (t.w) = w; return t;
# 226
}
# 228
static inline ulong4 make_ulong4(unsigned long x, unsigned long y, unsigned long z, unsigned long w)
# 229
{
# 230
ulong4 t; (t.x) = x; (t.y) = y; (t.z) = z; (t.w) = w; return t;
# 231
}
# 233
static inline float1 make_float1(float x)
# 234
{
# 235
float1 t; (t.x) = x; return t;
# 236
}
# 238
static inline float2 make_float2(float x, float y)
# 239
{
# 240
float2 t; (t.x) = x; (t.y) = y; return t;
# 241
}
# 243
static inline float3 make_float3(float x, float y, float z)
# 244
{
# 245
float3 t; (t.x) = x; (t.y) = y; (t.z) = z; return t;
# 246
}
# 248
static inline float4 make_float4(float x, float y, float z, float w)
# 249
{
# 250
float4 t; (t.x) = x; (t.y) = y; (t.z) = z; (t.w) = w; return t;
# 251
}
# 253
static inline longlong1 make_longlong1(long long x)
# 254
{
# 255
longlong1 t; (t.x) = x; return t;
# 256
}
# 258
static inline ulonglong1 make_ulonglong1(unsigned long long x)
# 259
{
# 260
ulonglong1 t; (t.x) = x; return t;
# 261
}
# 263
static inline longlong2 make_longlong2(long long x, long long y)
# 264
{
# 265
longlong2 t; (t.x) = x; (t.y) = y; return t;
# 266
}
# 268
static inline ulonglong2 make_ulonglong2(unsigned long long x, unsigned long long y)
# 269
{
# 270
ulonglong2 t; (t.x) = x; (t.y) = y; return t;
# 271
}
# 273
static inline longlong3 make_longlong3(long long x, long long y, long long z)
# 274
{
# 275
longlong3 t; (t.x) = x; (t.y) = y; (t.z) = z; return t;
# 276
}
# 278
static inline ulonglong3 make_ulonglong3(unsigned long long x, unsigned long long y, unsigned long long z)
# 279
{
# 280
ulonglong3 t; (t.x) = x; (t.y) = y; (t.z) = z; return t;
# 281
}
# 283
static inline longlong4 make_longlong4(long long x, long long y, long long z, long long w)
# 284
{
# 285
longlong4 t; (t.x) = x; (t.y) = y; (t.z) = z; (t.w) = w; return t;
# 286
}
# 288
static inline ulonglong4 make_ulonglong4(unsigned long long x, unsigned long long y, unsigned long long z, unsigned long long w)
# 289
{
# 290
ulonglong4 t; (t.x) = x; (t.y) = y; (t.z) = z; (t.w) = w; return t;
# 291
}
# 293
static inline double1 make_double1(double x)
# 294
{
# 295
double1 t; (t.x) = x; return t;
# 296
}
# 298
static inline double2 make_double2(double x, double y)
# 299
{
# 300
double2 t; (t.x) = x; (t.y) = y; return t;
# 301
}
# 303
static inline double3 make_double3(double x, double y, double z)
# 304
{
# 305
double3 t; (t.x) = x; (t.y) = y; (t.z) = z; return t;
# 306
}
# 308
static inline double4 make_double4(double x, double y, double z, double w)
# 309
{
# 310
double4 t; (t.x) = x; (t.y) = y; (t.z) = z; (t.w) = w; return t;
# 311
}
# 27 "/usr/include/string.h" 3
extern "C" {
# 42 "/usr/include/string.h" 3
extern void *memcpy(void *__restrict__ __dest, const void *__restrict__ __src, size_t __n) throw()
# 43
__attribute((__nonnull__(1, 2)));
# 46
extern void *memmove(void * __dest, const void * __src, size_t __n) throw()
# 47
__attribute((__nonnull__(1, 2)));
# 54
extern void *memccpy(void *__restrict__ __dest, const void *__restrict__ __src, int __c, size_t __n) throw()
# 56
__attribute((__nonnull__(1, 2)));
# 62
extern void *memset(void * __s, int __c, size_t __n) throw() __attribute((__nonnull__(1)));
# 65
extern int memcmp(const void * __s1, const void * __s2, size_t __n) throw()
# 66
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 70
extern "C++" {
# 72
extern void *memchr(void * __s, int __c, size_t __n) throw() __asm__("memchr")
# 73
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 74
extern const void *memchr(const void * __s, int __c, size_t __n) throw() __asm__("memchr")
# 75
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 90 "/usr/include/string.h" 3
}
# 101
extern "C++" void *rawmemchr(void * __s, int __c) throw() __asm__("rawmemchr")
# 102
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 103
extern "C++" const void *rawmemchr(const void * __s, int __c) throw() __asm__("rawmemchr")
# 104
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 112
extern "C++" void *memrchr(void * __s, int __c, size_t __n) throw() __asm__("memrchr")
# 113
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 114
extern "C++" const void *memrchr(const void * __s, int __c, size_t __n) throw() __asm__("memrchr")
# 115
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 125
extern char *strcpy(char *__restrict__ __dest, const char *__restrict__ __src) throw()
# 126
__attribute((__nonnull__(1, 2)));
# 128
extern char *strncpy(char *__restrict__ __dest, const char *__restrict__ __src, size_t __n) throw()
# 130
__attribute((__nonnull__(1, 2)));
# 133
extern char *strcat(char *__restrict__ __dest, const char *__restrict__ __src) throw()
# 134
__attribute((__nonnull__(1, 2)));
# 136
extern char *strncat(char *__restrict__ __dest, const char *__restrict__ __src, size_t __n) throw()
# 137
__attribute((__nonnull__(1, 2)));
# 140
extern int strcmp(const char * __s1, const char * __s2) throw()
# 141
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 143
extern int strncmp(const char * __s1, const char * __s2, size_t __n) throw()
# 144
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 147
extern int strcoll(const char * __s1, const char * __s2) throw()
# 148
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 150
extern size_t strxfrm(char *__restrict__ __dest, const char *__restrict__ __src, size_t __n) throw()
# 152
__attribute((__nonnull__(2)));
# 39 "/usr/include/xlocale.h" 3
typedef
# 27
struct __locale_struct {
# 30
struct __locale_data *__locales[13];
# 33
const unsigned short *__ctype_b;
# 34
const int *__ctype_tolower;
# 35
const int *__ctype_toupper;
# 38
const char *__names[13];
# 39
} *__locale_t;
# 42
typedef __locale_t locale_t;
# 162 "/usr/include/string.h" 3
extern int strcoll_l(const char * __s1, const char * __s2, __locale_t __l) throw()
# 163
__attribute((__pure__)) __attribute((__nonnull__(1, 2, 3)));
# 165
extern size_t strxfrm_l(char * __dest, const char * __src, size_t __n, __locale_t __l) throw()
# 166
__attribute((__nonnull__(2, 4)));
# 172
extern char *strdup(const char * __s) throw()
# 173
__attribute((__malloc__)) __attribute((__nonnull__(1)));
# 180
extern char *strndup(const char * __string, size_t __n) throw()
# 181
__attribute((__malloc__)) __attribute((__nonnull__(1)));
# 210 "/usr/include/string.h" 3
extern "C++" {
# 212
extern char *strchr(char * __s, int __c) throw() __asm__("strchr")
# 213
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 214
extern const char *strchr(const char * __s, int __c) throw() __asm__("strchr")
# 215
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 230 "/usr/include/string.h" 3
}
# 237
extern "C++" {
# 239
extern char *strrchr(char * __s, int __c) throw() __asm__("strrchr")
# 240
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 241
extern const char *strrchr(const char * __s, int __c) throw() __asm__("strrchr")
# 242
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 257 "/usr/include/string.h" 3
}
# 268
extern "C++" char *strchrnul(char * __s, int __c) throw() __asm__("strchrnul")
# 269
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 270
extern "C++" const char *strchrnul(const char * __s, int __c) throw() __asm__("strchrnul")
# 271
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 281
extern size_t strcspn(const char * __s, const char * __reject) throw()
# 282
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 285
extern size_t strspn(const char * __s, const char * __accept) throw()
# 286
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 289
extern "C++" {
# 291
extern char *strpbrk(char * __s, const char * __accept) throw() __asm__("strpbrk")
# 292
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 293
extern const char *strpbrk(const char * __s, const char * __accept) throw() __asm__("strpbrk")
# 294
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 309 "/usr/include/string.h" 3
}
# 316
extern "C++" {
# 318
extern char *strstr(char * __haystack, const char * __needle) throw() __asm__("strstr")
# 319
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 320
extern const char *strstr(const char * __haystack, const char * __needle) throw() __asm__("strstr")
# 321
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 336 "/usr/include/string.h" 3
}
# 344
extern char *strtok(char *__restrict__ __s, const char *__restrict__ __delim) throw()
# 345
__attribute((__nonnull__(2)));
# 350
extern char *__strtok_r(char *__restrict__ __s, const char *__restrict__ __delim, char **__restrict__ __save_ptr) throw()
# 353
__attribute((__nonnull__(2, 3)));
# 355
extern char *strtok_r(char *__restrict__ __s, const char *__restrict__ __delim, char **__restrict__ __save_ptr) throw()
# 357
__attribute((__nonnull__(2, 3)));
# 363
extern "C++" char *strcasestr(char * __haystack, const char * __needle) throw() __asm__("strcasestr")
# 364
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 365
extern "C++" const char *strcasestr(const char * __haystack, const char * __needle) throw() __asm__("strcasestr")
# 367
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 378 "/usr/include/string.h" 3
extern void *memmem(const void * __haystack, size_t __haystacklen, const void * __needle, size_t __needlelen) throw()
# 380
__attribute((__pure__)) __attribute((__nonnull__(1, 3)));
# 384
extern void *__mempcpy(void *__restrict__ __dest, const void *__restrict__ __src, size_t __n) throw()
# 386
__attribute((__nonnull__(1, 2)));
# 387
extern void *mempcpy(void *__restrict__ __dest, const void *__restrict__ __src, size_t __n) throw()
# 389
__attribute((__nonnull__(1, 2)));
# 395
extern size_t strlen(const char * __s) throw()
# 396
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 402
extern size_t strnlen(const char * __string, size_t __maxlen) throw()
# 403
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 409
extern char *strerror(int __errnum) throw();
# 434 "/usr/include/string.h" 3
extern char *strerror_r(int __errnum, char * __buf, size_t __buflen) throw()
# 435
__attribute((__nonnull__(2)));
# 441
extern char *strerror_l(int __errnum, __locale_t __l) throw();
# 447
extern void __bzero(void * __s, size_t __n) throw() __attribute((__nonnull__(1)));
# 451
extern void bcopy(const void * __src, void * __dest, size_t __n) throw()
# 452
__attribute((__nonnull__(1, 2)));
# 455
extern void bzero(void * __s, size_t __n) throw() __attribute((__nonnull__(1)));
# 458
extern int bcmp(const void * __s1, const void * __s2, size_t __n) throw()
# 459
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 463
extern "C++" {
# 465
extern char *index(char * __s, int __c) throw() __asm__("index")
# 466
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 467
extern const char *index(const char * __s, int __c) throw() __asm__("index")
# 468
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 483 "/usr/include/string.h" 3
}
# 491
extern "C++" {
# 493
extern char *rindex(char * __s, int __c) throw() __asm__("rindex")
# 494
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 495
extern const char *rindex(const char * __s, int __c) throw() __asm__("rindex")
# 496
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 511 "/usr/include/string.h" 3
}
# 519
extern int ffs(int __i) throw() __attribute((const));
# 524
extern int ffsl(long __l) throw() __attribute((const));
# 526
__extension__ extern int ffsll(long long __ll) throw()
# 527
__attribute((const));
# 532
extern int strcasecmp(const char * __s1, const char * __s2) throw()
# 533
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 536
extern int strncasecmp(const char * __s1, const char * __s2, size_t __n) throw()
# 537
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 543
extern int strcasecmp_l(const char * __s1, const char * __s2, __locale_t __loc) throw()
# 545
__attribute((__pure__)) __attribute((__nonnull__(1, 2, 3)));
# 547
extern int strncasecmp_l(const char * __s1, const char * __s2, size_t __n, __locale_t __loc) throw()
# 549
__attribute((__pure__)) __attribute((__nonnull__(1, 2, 4)));
# 555
extern char *strsep(char **__restrict__ __stringp, const char *__restrict__ __delim) throw()
# 557
__attribute((__nonnull__(1, 2)));
# 562
extern char *strsignal(int __sig) throw();
# 565
extern char *__stpcpy(char *__restrict__ __dest, const char *__restrict__ __src) throw()
# 566
__attribute((__nonnull__(1, 2)));
# 567
extern char *stpcpy(char *__restrict__ __dest, const char *__restrict__ __src) throw()
# 568
__attribute((__nonnull__(1, 2)));
# 572
extern char *__stpncpy(char *__restrict__ __dest, const char *__restrict__ __src, size_t __n) throw()
# 574
__attribute((__nonnull__(1, 2)));
# 575
extern char *stpncpy(char *__restrict__ __dest, const char *__restrict__ __src, size_t __n) throw()
# 577
__attribute((__nonnull__(1, 2)));
# 582
extern int strverscmp(const char * __s1, const char * __s2) throw()
# 583
__attribute((__pure__)) __attribute((__nonnull__(1, 2)));
# 586
extern char *strfry(char * __string) throw() __attribute((__nonnull__(1)));
# 589
extern void *memfrob(void * __s, size_t __n) throw() __attribute((__nonnull__(1)));
# 597
extern "C++" char *basename(char * __filename) throw() __asm__("basename")
# 598
__attribute((__nonnull__(1)));
# 599
extern "C++" const char *basename(const char * __filename) throw() __asm__("basename")
# 600
__attribute((__nonnull__(1)));
# 642 "/usr/include/string.h" 3
}
# 29 "/usr/include/time.h" 3
extern "C" {
# 30 "/usr/include/bits/types.h" 3
typedef unsigned char __u_char;
# 31
typedef unsigned short __u_short;
# 32
typedef unsigned __u_int;
# 33
typedef unsigned long __u_long;
# 36
typedef signed char __int8_t;
# 37
typedef unsigned char __uint8_t;
# 38
typedef signed short __int16_t;
# 39
typedef unsigned short __uint16_t;
# 40
typedef signed int __int32_t;
# 41
typedef unsigned __uint32_t;
# 43
typedef signed long __int64_t;
# 44
typedef unsigned long __uint64_t;
# 52
typedef long __quad_t;
# 53
typedef unsigned long __u_quad_t;
# 133 "/usr/include/bits/types.h" 3
typedef unsigned long __dev_t;
# 134
typedef unsigned __uid_t;
# 135
typedef unsigned __gid_t;
# 136
typedef unsigned long __ino_t;
# 137
typedef unsigned long __ino64_t;
# 138
typedef unsigned __mode_t;
# 139
typedef unsigned long __nlink_t;
# 140
typedef long __off_t;
# 141
typedef long __off64_t;
# 142
typedef int __pid_t;
# 143
typedef struct { int __val[2]; } __fsid_t;
# 144
typedef long __clock_t;
# 145
typedef unsigned long __rlim_t;
# 146
typedef unsigned long __rlim64_t;
# 147
typedef unsigned __id_t;
# 148
typedef long __time_t;
# 149
typedef unsigned __useconds_t;
# 150
typedef long __suseconds_t;
# 152
typedef int __daddr_t;
# 153
typedef int __key_t;
# 156
typedef int __clockid_t;
# 159
typedef void *__timer_t;
# 162
typedef long __blksize_t;
# 167
typedef long __blkcnt_t;
# 168
typedef long __blkcnt64_t;
# 171
typedef unsigned long __fsblkcnt_t;
# 172
typedef unsigned long __fsblkcnt64_t;
# 175
typedef unsigned long __fsfilcnt_t;
# 176
typedef unsigned long __fsfilcnt64_t;
# 179
typedef long __fsword_t;
# 181
typedef long __ssize_t;
# 184
typedef long __syscall_slong_t;
# 186
typedef unsigned long __syscall_ulong_t;
# 190
typedef __off64_t __loff_t;
# 191
typedef __quad_t *__qaddr_t;
# 192
typedef char *__caddr_t;
# 195
typedef long __intptr_t;
# 198
typedef unsigned __socklen_t;
# 30 "/usr/include/bits/time.h" 3
struct timeval {
# 32
__time_t tv_sec;
# 33
__suseconds_t tv_usec;
# 34
};
# 25 "/usr/include/bits/timex.h" 3
struct timex {
# 27
unsigned modes;
# 28
__syscall_slong_t offset;
# 29
__syscall_slong_t freq;
# 30
__syscall_slong_t maxerror;
# 31
__syscall_slong_t esterror;
# 32
int status;
# 33
__syscall_slong_t constant;
# 34
__syscall_slong_t precision;
# 35
__syscall_slong_t tolerance;
# 36
timeval time;
# 37
__syscall_slong_t tick;
# 38
__syscall_slong_t ppsfreq;
# 39
__syscall_slong_t jitter;
# 40
int shift;
# 41
__syscall_slong_t stabil;
# 42
__syscall_slong_t jitcnt;
# 43
__syscall_slong_t calcnt;
# 44
__syscall_slong_t errcnt;
# 45
__syscall_slong_t stbcnt;
# 47
int tai;
# 50
int:32; int:32; int:32; int:32;
# 51
int:32; int:32; int:32; int:32;
# 52
int:32; int:32; int:32;
# 53
};
# 90 "/usr/include/bits/time.h" 3
extern "C" {
# 93
extern int clock_adjtime(__clockid_t __clock_id, timex * __utx) throw();
# 95
}
# 59 "/usr/include/time.h" 3
typedef __clock_t clock_t;
# 75 "/usr/include/time.h" 3
typedef __time_t time_t;
# 91 "/usr/include/time.h" 3
typedef __clockid_t clockid_t;
# 103 "/usr/include/time.h" 3
typedef __timer_t timer_t;
# 120 "/usr/include/time.h" 3
struct timespec {
# 122
__time_t tv_sec;
# 123
__syscall_slong_t tv_nsec;
# 124
};
# 133
struct tm {
# 135
int tm_sec;
# 136
int tm_min;
# 137
int tm_hour;
# 138
int tm_mday;
# 139
int tm_mon;
# 140
int tm_year;
# 141
int tm_wday;
# 142
int tm_yday;
# 143
int tm_isdst;
# 146
long tm_gmtoff;
# 147
const char *tm_zone;
# 152
};
# 161
struct itimerspec {
# 163
timespec it_interval;
# 164
timespec it_value;
# 165
};
# 168
struct sigevent;
# 174
typedef __pid_t pid_t;
# 189 "/usr/include/time.h" 3
extern clock_t clock() throw();
# 192
extern time_t time(time_t * __timer) throw();
# 195
extern double difftime(time_t __time1, time_t __time0) throw()
# 196
__attribute((const));
# 199
extern time_t mktime(tm * __tp) throw();
# 205
extern size_t strftime(char *__restrict__ __s, size_t __maxsize, const char *__restrict__ __format, const tm *__restrict__ __tp) throw();
# 213
extern char *strptime(const char *__restrict__ __s, const char *__restrict__ __fmt, tm * __tp) throw();
# 223
extern size_t strftime_l(char *__restrict__ __s, size_t __maxsize, const char *__restrict__ __format, const tm *__restrict__ __tp, __locale_t __loc) throw();
# 230
extern char *strptime_l(const char *__restrict__ __s, const char *__restrict__ __fmt, tm * __tp, __locale_t __loc) throw();
# 239
extern tm *gmtime(const time_t * __timer) throw();
# 243
extern tm *localtime(const time_t * __timer) throw();
# 249
extern tm *gmtime_r(const time_t *__restrict__ __timer, tm *__restrict__ __tp) throw();
# 254
extern tm *localtime_r(const time_t *__restrict__ __timer, tm *__restrict__ __tp) throw();
# 261
extern char *asctime(const tm * __tp) throw();
# 264
extern char *ctime(const time_t * __timer) throw();
# 272
extern char *asctime_r(const tm *__restrict__ __tp, char *__restrict__ __buf) throw();
# 276
extern char *ctime_r(const time_t *__restrict__ __timer, char *__restrict__ __buf) throw();
# 282
extern char *__tzname[2];
# 283
extern int __daylight;
# 284
extern long __timezone;
# 289
extern char *tzname[2];
# 293
extern void tzset() throw();
# 297
extern int daylight;
# 298
extern long timezone;
# 304
extern int stime(const time_t * __when) throw();
# 319 "/usr/include/time.h" 3
extern time_t timegm(tm * __tp) throw();
# 322
extern time_t timelocal(tm * __tp) throw();
# 325
extern int dysize(int __year) throw() __attribute((const));
# 334 "/usr/include/time.h" 3
extern int nanosleep(const timespec * __requested_time, timespec * __remaining);
# 339
extern int clock_getres(clockid_t __clock_id, timespec * __res) throw();
# 342
extern int clock_gettime(clockid_t __clock_id, timespec * __tp) throw();
# 345
extern int clock_settime(clockid_t __clock_id, const timespec * __tp) throw();
# 353
extern int clock_nanosleep(clockid_t __clock_id, int __flags, const timespec * __req, timespec * __rem);
# 358
extern int clock_getcpuclockid(pid_t __pid, clockid_t * __clock_id) throw();
# 363
extern int timer_create(clockid_t __clock_id, sigevent *__restrict__ __evp, timer_t *__restrict__ __timerid) throw();
# 368
extern int timer_delete(timer_t __timerid) throw();
# 371
extern int timer_settime(timer_t __timerid, int __flags, const itimerspec *__restrict__ __value, itimerspec *__restrict__ __ovalue) throw();
# 376
extern int timer_gettime(timer_t __timerid, itimerspec * __value) throw();
# 380
extern int timer_getoverrun(timer_t __timerid) throw();
# 386
extern int timespec_get(timespec * __ts, int __base) throw()
# 387
__attribute((__nonnull__(1)));
# 403 "/usr/include/time.h" 3
extern int getdate_err;
# 412 "/usr/include/time.h" 3
extern tm *getdate(const char * __string);
# 426 "/usr/include/time.h" 3
extern int getdate_r(const char *__restrict__ __string, tm *__restrict__ __resbufp);
# 430
}
# 80 "/usr/local/cuda-10.1/include/crt/common_functions.h" 3
extern "C" {
# 83
extern clock_t clock() throw();
# 88
extern void *memset(void *, int, size_t) throw();
# 89
extern void *memcpy(void *, const void *, size_t) throw();
# 91
}
# 108 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern "C" {
# 192 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern int abs(int) throw();
# 193
extern long labs(long) throw();
# 194
extern long long llabs(long long) throw();
# 244 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double fabs(double x) throw();
# 285 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float fabsf(float x) throw();
# 289
extern inline int min(int, int);
# 291
extern inline unsigned umin(unsigned, unsigned);
# 292
extern inline long long llmin(long long, long long);
# 293
extern inline unsigned long long ullmin(unsigned long long, unsigned long long);
# 314 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float fminf(float x, float y) throw();
# 334 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double fmin(double x, double y) throw();
# 341
extern inline int max(int, int);
# 343
extern inline unsigned umax(unsigned, unsigned);
# 344
extern inline long long llmax(long long, long long);
# 345
extern inline unsigned long long ullmax(unsigned long long, unsigned long long);
# 366 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float fmaxf(float x, float y) throw();
# 386 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double fmax(double, double) throw();
# 430 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double sin(double x) throw();
# 463 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double cos(double x) throw();
# 482 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern void sincos(double x, double * sptr, double * cptr) throw();
# 498 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern void sincosf(float x, float * sptr, float * cptr) throw();
# 543 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double tan(double x) throw();
# 612 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double sqrt(double x) throw();
# 684 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double rsqrt(double x);
# 754 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float rsqrtf(float x);
# 810 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double log2(double x) throw();
# 835 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double exp2(double x) throw();
# 860 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float exp2f(float x) throw();
# 887 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double exp10(double x) throw();
# 910 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float exp10f(float x) throw();
# 956 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double expm1(double x) throw();
# 1001 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float expm1f(float x) throw();
# 1056 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float log2f(float x) throw();
# 1110 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double log10(double x) throw();
# 1181 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double log(double x) throw();
# 1275 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double log1p(double x) throw();
# 1372 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float log1pf(float x) throw();
# 1447 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double floor(double x) throw();
# 1486 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double exp(double x) throw();
# 1517 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double cosh(double x) throw();
# 1547 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double sinh(double x) throw();
# 1577 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double tanh(double x) throw();
# 1612 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double acosh(double x) throw();
# 1650 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float acoshf(float x) throw();
# 1666 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double asinh(double x) throw();
# 1682 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float asinhf(float x) throw();
# 1736 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double atanh(double x) throw();
# 1790 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float atanhf(float x) throw();
# 1849 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double ldexp(double x, int exp) throw();
# 1905 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float ldexpf(float x, int exp) throw();
# 1957 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double logb(double x) throw();
# 2012 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float logbf(float x) throw();
# 2042 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern int ilogb(double x) throw();
# 2072 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern int ilogbf(float x) throw();
# 2148 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double scalbn(double x, int n) throw();
# 2224 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float scalbnf(float x, int n) throw();
# 2300 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double scalbln(double x, long n) throw();
# 2376 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float scalblnf(float x, long n) throw();
# 2454 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double frexp(double x, int * nptr) throw();
# 2529 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float frexpf(float x, int * nptr) throw();
# 2543 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double round(double x) throw();
# 2560 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float roundf(float x) throw();
# 2578 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern long lround(double x) throw();
# 2596 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern long lroundf(float x) throw();
# 2614 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern long long llround(double x) throw();
# 2632 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern long long llroundf(float x) throw();
# 2684 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float rintf(float x) throw();
# 2701 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern long lrint(double x) throw();
# 2718 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern long lrintf(float x) throw();
# 2735 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern long long llrint(double x) throw();
# 2752 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern long long llrintf(float x) throw();
# 2805 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double nearbyint(double x) throw();
# 2858 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float nearbyintf(float x) throw();
# 2920 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double ceil(double x) throw();
# 2932 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double trunc(double x) throw();
# 2947 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float truncf(float x) throw();
# 2973 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double fdim(double x, double y) throw();
# 2999 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float fdimf(float x, float y) throw();
# 3035 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double atan2(double y, double x) throw();
# 3066 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double atan(double x) throw();
# 3089 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double acos(double x) throw();
# 3121 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double asin(double x) throw();
# 3167 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double hypot(double x, double y) throw();
# 3219 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double rhypot(double x, double y) throw();
# 3265 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float hypotf(float x, float y) throw();
# 3317 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float rhypotf(float x, float y) throw();
# 3361 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double norm3d(double a, double b, double c) throw();
# 3412 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double rnorm3d(double a, double b, double c) throw();
# 3461 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double norm4d(double a, double b, double c, double d) throw();
# 3517 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double rnorm4d(double a, double b, double c, double d) throw();
# 3562 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double norm(int dim, const double * t) throw();
# 3613 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double rnorm(int dim, const double * t) throw();
# 3665 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float rnormf(int dim, const float * a) throw();
# 3709 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float normf(int dim, const float * a) throw();
# 3754 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float norm3df(float a, float b, float c) throw();
# 3805 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float rnorm3df(float a, float b, float c) throw();
# 3854 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float norm4df(float a, float b, float c, float d) throw();
# 3910 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float rnorm4df(float a, float b, float c, float d) throw();
# 3997 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double cbrt(double x) throw();
# 4083 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float cbrtf(float x) throw();
# 4138 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double rcbrt(double x);
# 4188 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float rcbrtf(float x);
# 4248 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double sinpi(double x);
# 4308 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float sinpif(float x);
# 4360 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double cospi(double x);
# 4412 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float cospif(float x);
# 4442 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern void sincospi(double x, double * sptr, double * cptr);
# 4472 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern void sincospif(float x, float * sptr, float * cptr);
# 4784 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double pow(double x, double y) throw();
# 4840 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double modf(double x, double * iptr) throw();
# 4899 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double fmod(double x, double y) throw();
# 4985 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double remainder(double x, double y) throw();
# 5075 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float remainderf(float x, float y) throw();
# 5129 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double remquo(double x, double y, int * quo) throw();
# 5183 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float remquof(float x, float y, int * quo) throw();
# 5224 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double j0(double x) throw();
# 5266 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float j0f(float x) throw();
# 5327 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double j1(double x) throw();
# 5388 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float j1f(float x) throw();
# 5431 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double jn(int n, double x) throw();
# 5474 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float jnf(int n, float x) throw();
# 5526 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double y0(double x) throw();
# 5578 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float y0f(float x) throw();
# 5630 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double y1(double x) throw();
# 5682 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float y1f(float x) throw();
# 5735 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double yn(int n, double x) throw();
# 5788 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float ynf(int n, float x) throw();
# 5815 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double cyl_bessel_i0(double x) throw();
# 5841 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float cyl_bessel_i0f(float x) throw();
# 5868 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double cyl_bessel_i1(double x) throw();
# 5894 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float cyl_bessel_i1f(float x) throw();
# 5977 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double erf(double x) throw();
# 6059 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float erff(float x) throw();
# 6123 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double erfinv(double y);
# 6180 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float erfinvf(float y);
# 6219 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double erfc(double x) throw();
# 6257 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float erfcf(float x) throw();
# 6385 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double lgamma(double x) throw();
# 6448 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double erfcinv(double y);
# 6504 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float erfcinvf(float y);
# 6562 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double normcdfinv(double y);
# 6620 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float normcdfinvf(float y);
# 6663 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double normcdf(double y);
# 6706 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float normcdff(float y);
# 6781 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double erfcx(double x);
# 6856 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float erfcxf(float x);
# 6990 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float lgammaf(float x) throw();
# 7099 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double tgamma(double x) throw();
# 7208 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float tgammaf(float x) throw();
# 7221 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double copysign(double x, double y) throw();
# 7234 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float copysignf(float x, float y) throw();
# 7271 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double nextafter(double x, double y) throw();
# 7308 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float nextafterf(float x, float y) throw();
# 7324 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double nan(const char * tagp) throw();
# 7340 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float nanf(const char * tagp) throw();
# 7347
extern int __isinff(float) throw();
# 7348
extern int __isnanf(float) throw();
# 7358 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern int __finite(double) throw();
# 7359
extern int __finitef(float) throw();
# 7360
extern int __signbit(double) throw();
# 7361
extern int __isnan(double) throw();
# 7362
extern int __isinf(double) throw();
# 7365
extern int __signbitf(float) throw();
# 7524 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern double fma(double x, double y, double z) throw();
# 7682 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float fmaf(float x, float y, float z) throw();
# 7693 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern int __signbitl(long double) throw();
# 7699
extern int __finitel(long double) throw();
# 7700
extern int __isinfl(long double) throw();
# 7701
extern int __isnanl(long double) throw();
# 7751 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float acosf(float x) throw();
# 7791 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float asinf(float x) throw();
# 7831 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float atanf(float x) throw();
# 7864 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float atan2f(float y, float x) throw();
# 7888 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float cosf(float x) throw();
# 7930 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float sinf(float x) throw();
# 7972 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float tanf(float x) throw();
# 7996 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float coshf(float x) throw();
# 8037 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float sinhf(float x) throw();
# 8067 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float tanhf(float x) throw();
# 8118 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float logf(float x) throw();
# 8168 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float expf(float x) throw();
# 8219 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float log10f(float x) throw();
# 8274 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float modff(float x, float * iptr) throw();
# 8582 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float powf(float x, float y) throw();
# 8651 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float sqrtf(float x) throw();
# 8710 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float ceilf(float x) throw();
# 8782 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float floorf(float x) throw();
# 8841 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern float fmodf(float x, float y) throw();
# 8856 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
}
# 29 "/usr/include/math.h" 3
extern "C" {
# 28 "/usr/include/bits/mathdef.h" 3
typedef float float_t;
# 29
typedef double double_t;
# 54 "/usr/include/bits/mathcalls.h" 3
extern double acos(double __x) throw(); extern double __acos(double __x) throw();
# 56
extern double asin(double __x) throw(); extern double __asin(double __x) throw();
# 58
extern double atan(double __x) throw(); extern double __atan(double __x) throw();
# 60
extern double atan2(double __y, double __x) throw(); extern double __atan2(double __y, double __x) throw();
# 63
extern double cos(double __x) throw(); extern double __cos(double __x) throw();
# 65
extern double sin(double __x) throw(); extern double __sin(double __x) throw();
# 67
extern double tan(double __x) throw(); extern double __tan(double __x) throw();
# 72
extern double cosh(double __x) throw(); extern double __cosh(double __x) throw();
# 74
extern double sinh(double __x) throw(); extern double __sinh(double __x) throw();
# 76
extern double tanh(double __x) throw(); extern double __tanh(double __x) throw();
# 81
extern void sincos(double __x, double * __sinx, double * __cosx) throw(); extern void __sincos(double __x, double * __sinx, double * __cosx) throw();
# 88
extern double acosh(double __x) throw(); extern double __acosh(double __x) throw();
# 90
extern double asinh(double __x) throw(); extern double __asinh(double __x) throw();
# 92
extern double atanh(double __x) throw(); extern double __atanh(double __x) throw();
# 100
extern double exp(double __x) throw(); extern double __exp(double __x) throw();
# 103
extern double frexp(double __x, int * __exponent) throw(); extern double __frexp(double __x, int * __exponent) throw();
# 106
extern double ldexp(double __x, int __exponent) throw(); extern double __ldexp(double __x, int __exponent) throw();
# 109
extern double log(double __x) throw(); extern double __log(double __x) throw();
# 112
extern double log10(double __x) throw(); extern double __log10(double __x) throw();
# 115
extern double modf(double __x, double * __iptr) throw(); extern double __modf(double __x, double * __iptr) throw()
# 116
__attribute((__nonnull__(2)));
# 121
extern double exp10(double __x) throw(); extern double __exp10(double __x) throw();
# 123
extern double pow10(double __x) throw(); extern double __pow10(double __x) throw();
# 129
extern double expm1(double __x) throw(); extern double __expm1(double __x) throw();
# 132
extern double log1p(double __x) throw(); extern double __log1p(double __x) throw();
# 135
extern double logb(double __x) throw(); extern double __logb(double __x) throw();
# 142
extern double exp2(double __x) throw(); extern double __exp2(double __x) throw();
# 145
extern double log2(double __x) throw(); extern double __log2(double __x) throw();
# 154
extern double pow(double __x, double __y) throw(); extern double __pow(double __x, double __y) throw();
# 157
extern double sqrt(double __x) throw(); extern double __sqrt(double __x) throw();
# 163
extern double hypot(double __x, double __y) throw(); extern double __hypot(double __x, double __y) throw();
# 170
extern double cbrt(double __x) throw(); extern double __cbrt(double __x) throw();
# 179
extern double ceil(double __x) throw() __attribute((const)); extern double __ceil(double __x) throw() __attribute((const));
# 182
extern double fabs(double __x) throw() __attribute((const)); extern double __fabs(double __x) throw() __attribute((const));
# 185
extern double floor(double __x) throw() __attribute((const)); extern double __floor(double __x) throw() __attribute((const));
# 188
extern double fmod(double __x, double __y) throw(); extern double __fmod(double __x, double __y) throw();
# 193
extern int __isinf(double __value) throw() __attribute((const));
# 196
extern int __finite(double __value) throw() __attribute((const));
# 202
extern inline int isinf(double __value) throw() __attribute((const));
# 205
extern int finite(double __value) throw() __attribute((const));
# 208
extern double drem(double __x, double __y) throw(); extern double __drem(double __x, double __y) throw();
# 212
extern double significand(double __x) throw(); extern double __significand(double __x) throw();
# 218
extern double copysign(double __x, double __y) throw() __attribute((const)); extern double __copysign(double __x, double __y) throw() __attribute((const));
# 225
extern double nan(const char * __tagb) throw() __attribute((const)); extern double __nan(const char * __tagb) throw() __attribute((const));
# 231
extern int __isnan(double __value) throw() __attribute((const));
# 235
extern inline int isnan(double __value) throw() __attribute((const));
# 238
extern double j0(double) throw(); extern double __j0(double) throw();
# 239
extern double j1(double) throw(); extern double __j1(double) throw();
# 240
extern double jn(int, double) throw(); extern double __jn(int, double) throw();
# 241
extern double y0(double) throw(); extern double __y0(double) throw();
# 242
extern double y1(double) throw(); extern double __y1(double) throw();
# 243
extern double yn(int, double) throw(); extern double __yn(int, double) throw();
# 250
extern double erf(double) throw(); extern double __erf(double) throw();
# 251
extern double erfc(double) throw(); extern double __erfc(double) throw();
# 252
extern double lgamma(double) throw(); extern double __lgamma(double) throw();
# 259
extern double tgamma(double) throw(); extern double __tgamma(double) throw();
# 265
extern double gamma(double) throw(); extern double __gamma(double) throw();
# 272
extern double lgamma_r(double, int * __signgamp) throw(); extern double __lgamma_r(double, int * __signgamp) throw();
# 280
extern double rint(double __x) throw(); extern double __rint(double __x) throw();
# 283
extern double nextafter(double __x, double __y) throw() __attribute((const)); extern double __nextafter(double __x, double __y) throw() __attribute((const));
# 285
extern double nexttoward(double __x, long double __y) throw() __attribute((const)); extern double __nexttoward(double __x, long double __y) throw() __attribute((const));
# 289
extern double remainder(double __x, double __y) throw(); extern double __remainder(double __x, double __y) throw();
# 293
extern double scalbn(double __x, int __n) throw(); extern double __scalbn(double __x, int __n) throw();
# 297
extern int ilogb(double __x) throw(); extern int __ilogb(double __x) throw();
# 302
extern double scalbln(double __x, long __n) throw(); extern double __scalbln(double __x, long __n) throw();
# 306
extern double nearbyint(double __x) throw(); extern double __nearbyint(double __x) throw();
# 310
extern double round(double __x) throw() __attribute((const)); extern double __round(double __x) throw() __attribute((const));
# 314
extern double trunc(double __x) throw() __attribute((const)); extern double __trunc(double __x) throw() __attribute((const));
# 319
extern double remquo(double __x, double __y, int * __quo) throw(); extern double __remquo(double __x, double __y, int * __quo) throw();
# 326
extern long lrint(double __x) throw(); extern long __lrint(double __x) throw();
# 327
extern long long llrint(double __x) throw(); extern long long __llrint(double __x) throw();
# 331
extern long lround(double __x) throw(); extern long __lround(double __x) throw();
# 332
extern long long llround(double __x) throw(); extern long long __llround(double __x) throw();
# 336
extern double fdim(double __x, double __y) throw(); extern double __fdim(double __x, double __y) throw();
# 339
extern double fmax(double __x, double __y) throw() __attribute((const)); extern double __fmax(double __x, double __y) throw() __attribute((const));
# 342
extern double fmin(double __x, double __y) throw() __attribute((const)); extern double __fmin(double __x, double __y) throw() __attribute((const));
# 346
extern int __fpclassify(double __value) throw()
# 347
__attribute((const));
# 350
extern int __signbit(double __value) throw()
# 351
__attribute((const));
# 355
extern double fma(double __x, double __y, double __z) throw(); extern double __fma(double __x, double __y, double __z) throw();
# 364
extern double scalb(double __x, double __n) throw(); extern double __scalb(double __x, double __n) throw();
# 54 "/usr/include/bits/mathcalls.h" 3
extern float acosf(float __x) throw(); extern float __acosf(float __x) throw();
# 56
extern float asinf(float __x) throw(); extern float __asinf(float __x) throw();
# 58
extern float atanf(float __x) throw(); extern float __atanf(float __x) throw();
# 60
extern float atan2f(float __y, float __x) throw(); extern float __atan2f(float __y, float __x) throw();
# 63
extern float cosf(float __x) throw();
# 65
extern float sinf(float __x) throw();
# 67
extern float tanf(float __x) throw();
# 72
extern float coshf(float __x) throw(); extern float __coshf(float __x) throw();
# 74
extern float sinhf(float __x) throw(); extern float __sinhf(float __x) throw();
# 76
extern float tanhf(float __x) throw(); extern float __tanhf(float __x) throw();
# 81
extern void sincosf(float __x, float * __sinx, float * __cosx) throw();
# 88
extern float acoshf(float __x) throw(); extern float __acoshf(float __x) throw();
# 90
extern float asinhf(float __x) throw(); extern float __asinhf(float __x) throw();
# 92
extern float atanhf(float __x) throw(); extern float __atanhf(float __x) throw();
# 100
extern float expf(float __x) throw();
# 103
extern float frexpf(float __x, int * __exponent) throw(); extern float __frexpf(float __x, int * __exponent) throw();
# 106
extern float ldexpf(float __x, int __exponent) throw(); extern float __ldexpf(float __x, int __exponent) throw();
# 109
extern float logf(float __x) throw();
# 112
extern float log10f(float __x) throw();
# 115
extern float modff(float __x, float * __iptr) throw(); extern float __modff(float __x, float * __iptr) throw()
# 116
__attribute((__nonnull__(2)));
# 121
extern float exp10f(float __x) throw();
# 123
extern float pow10f(float __x) throw(); extern float __pow10f(float __x) throw();
# 129
extern float expm1f(float __x) throw(); extern float __expm1f(float __x) throw();
# 132
extern float log1pf(float __x) throw(); extern float __log1pf(float __x) throw();
# 135
extern float logbf(float __x) throw(); extern float __logbf(float __x) throw();
# 142
extern float exp2f(float __x) throw(); extern float __exp2f(float __x) throw();
# 145
extern float log2f(float __x) throw();
# 154
extern float powf(float __x, float __y) throw();
# 157
extern float sqrtf(float __x) throw(); extern float __sqrtf(float __x) throw();
# 163
extern float hypotf(float __x, float __y) throw(); extern float __hypotf(float __x, float __y) throw();
# 170
extern float cbrtf(float __x) throw(); extern float __cbrtf(float __x) throw();
# 179
extern float ceilf(float __x) throw() __attribute((const)); extern float __ceilf(float __x) throw() __attribute((const));
# 182
extern float fabsf(float __x) throw() __attribute((const)); extern float __fabsf(float __x) throw() __attribute((const));
# 185
extern float floorf(float __x) throw() __attribute((const)); extern float __floorf(float __x) throw() __attribute((const));
# 188
extern float fmodf(float __x, float __y) throw(); extern float __fmodf(float __x, float __y) throw();
# 193
extern int __isinff(float __value) throw() __attribute((const));
# 196
extern int __finitef(float __value) throw() __attribute((const));
# 202
extern int isinff(float __value) throw() __attribute((const));
# 205
extern int finitef(float __value) throw() __attribute((const));
# 208
extern float dremf(float __x, float __y) throw(); extern float __dremf(float __x, float __y) throw();
# 212
extern float significandf(float __x) throw(); extern float __significandf(float __x) throw();
# 218
extern float copysignf(float __x, float __y) throw() __attribute((const)); extern float __copysignf(float __x, float __y) throw() __attribute((const));
# 225
extern float nanf(const char * __tagb) throw() __attribute((const)); extern float __nanf(const char * __tagb) throw() __attribute((const));
# 231
extern int __isnanf(float __value) throw() __attribute((const));
# 235
extern int isnanf(float __value) throw() __attribute((const));
# 238
extern float j0f(float) throw(); extern float __j0f(float) throw();
# 239
extern float j1f(float) throw(); extern float __j1f(float) throw();
# 240
extern float jnf(int, float) throw(); extern float __jnf(int, float) throw();
# 241
extern float y0f(float) throw(); extern float __y0f(float) throw();
# 242
extern float y1f(float) throw(); extern float __y1f(float) throw();
# 243
extern float ynf(int, float) throw(); extern float __ynf(int, float) throw();
# 250
extern float erff(float) throw(); extern float __erff(float) throw();
# 251
extern float erfcf(float) throw(); extern float __erfcf(float) throw();
# 252
extern float lgammaf(float) throw(); extern float __lgammaf(float) throw();
# 259
extern float tgammaf(float) throw(); extern float __tgammaf(float) throw();
# 265
extern float gammaf(float) throw(); extern float __gammaf(float) throw();
# 272
extern float lgammaf_r(float, int * __signgamp) throw(); extern float __lgammaf_r(float, int * __signgamp) throw();
# 280
extern float rintf(float __x) throw(); extern float __rintf(float __x) throw();
# 283
extern float nextafterf(float __x, float __y) throw() __attribute((const)); extern float __nextafterf(float __x, float __y) throw() __attribute((const));
# 285
extern float nexttowardf(float __x, long double __y) throw() __attribute((const)); extern float __nexttowardf(float __x, long double __y) throw() __attribute((const));
# 289
extern float remainderf(float __x, float __y) throw(); extern float __remainderf(float __x, float __y) throw();
# 293
extern float scalbnf(float __x, int __n) throw(); extern float __scalbnf(float __x, int __n) throw();
# 297
extern int ilogbf(float __x) throw(); extern int __ilogbf(float __x) throw();
# 302
extern float scalblnf(float __x, long __n) throw(); extern float __scalblnf(float __x, long __n) throw();
# 306
extern float nearbyintf(float __x) throw(); extern float __nearbyintf(float __x) throw();
# 310
extern float roundf(float __x) throw() __attribute((const)); extern float __roundf(float __x) throw() __attribute((const));
# 314
extern float truncf(float __x) throw() __attribute((const)); extern float __truncf(float __x) throw() __attribute((const));
# 319
extern float remquof(float __x, float __y, int * __quo) throw(); extern float __remquof(float __x, float __y, int * __quo) throw();
# 326
extern long lrintf(float __x) throw(); extern long __lrintf(float __x) throw();
# 327
extern long long llrintf(float __x) throw(); extern long long __llrintf(float __x) throw();
# 331
extern long lroundf(float __x) throw(); extern long __lroundf(float __x) throw();
# 332
extern long long llroundf(float __x) throw(); extern long long __llroundf(float __x) throw();
# 336
extern float fdimf(float __x, float __y) throw(); extern float __fdimf(float __x, float __y) throw();
# 339
extern float fmaxf(float __x, float __y) throw() __attribute((const)); extern float __fmaxf(float __x, float __y) throw() __attribute((const));
# 342
extern float fminf(float __x, float __y) throw() __attribute((const)); extern float __fminf(float __x, float __y) throw() __attribute((const));
# 346
extern int __fpclassifyf(float __value) throw()
# 347
__attribute((const));
# 350
extern int __signbitf(float __value) throw()
# 351
__attribute((const));
# 355
extern float fmaf(float __x, float __y, float __z) throw(); extern float __fmaf(float __x, float __y, float __z) throw();
# 364
extern float scalbf(float __x, float __n) throw(); extern float __scalbf(float __x, float __n) throw();
# 54 "/usr/include/bits/mathcalls.h" 3
extern long double acosl(long double __x) throw(); extern long double __acosl(long double __x) throw();
# 56
extern long double asinl(long double __x) throw(); extern long double __asinl(long double __x) throw();
# 58
extern long double atanl(long double __x) throw(); extern long double __atanl(long double __x) throw();
# 60
extern long double atan2l(long double __y, long double __x) throw(); extern long double __atan2l(long double __y, long double __x) throw();
# 63
extern long double cosl(long double __x) throw(); extern long double __cosl(long double __x) throw();
# 65
extern long double sinl(long double __x) throw(); extern long double __sinl(long double __x) throw();
# 67
extern long double tanl(long double __x) throw(); extern long double __tanl(long double __x) throw();
# 72
extern long double coshl(long double __x) throw(); extern long double __coshl(long double __x) throw();
# 74
extern long double sinhl(long double __x) throw(); extern long double __sinhl(long double __x) throw();
# 76
extern long double tanhl(long double __x) throw(); extern long double __tanhl(long double __x) throw();
# 81
extern void sincosl(long double __x, long double * __sinx, long double * __cosx) throw(); extern void __sincosl(long double __x, long double * __sinx, long double * __cosx) throw();
# 88
extern long double acoshl(long double __x) throw(); extern long double __acoshl(long double __x) throw();
# 90
extern long double asinhl(long double __x) throw(); extern long double __asinhl(long double __x) throw();
# 92
extern long double atanhl(long double __x) throw(); extern long double __atanhl(long double __x) throw();
# 100
extern long double expl(long double __x) throw(); extern long double __expl(long double __x) throw();
# 103
extern long double frexpl(long double __x, int * __exponent) throw(); extern long double __frexpl(long double __x, int * __exponent) throw();
# 106
extern long double ldexpl(long double __x, int __exponent) throw(); extern long double __ldexpl(long double __x, int __exponent) throw();
# 109
extern long double logl(long double __x) throw(); extern long double __logl(long double __x) throw();
# 112
extern long double log10l(long double __x) throw(); extern long double __log10l(long double __x) throw();
# 115
extern long double modfl(long double __x, long double * __iptr) throw(); extern long double __modfl(long double __x, long double * __iptr) throw()
# 116
__attribute((__nonnull__(2)));
# 121
extern long double exp10l(long double __x) throw(); extern long double __exp10l(long double __x) throw();
# 123
extern long double pow10l(long double __x) throw(); extern long double __pow10l(long double __x) throw();
# 129
extern long double expm1l(long double __x) throw(); extern long double __expm1l(long double __x) throw();
# 132
extern long double log1pl(long double __x) throw(); extern long double __log1pl(long double __x) throw();
# 135
extern long double logbl(long double __x) throw(); extern long double __logbl(long double __x) throw();
# 142
extern long double exp2l(long double __x) throw(); extern long double __exp2l(long double __x) throw();
# 145
extern long double log2l(long double __x) throw(); extern long double __log2l(long double __x) throw();
# 154
extern long double powl(long double __x, long double __y) throw(); extern long double __powl(long double __x, long double __y) throw();
# 157
extern long double sqrtl(long double __x) throw(); extern long double __sqrtl(long double __x) throw();
# 163
extern long double hypotl(long double __x, long double __y) throw(); extern long double __hypotl(long double __x, long double __y) throw();
# 170
extern long double cbrtl(long double __x) throw(); extern long double __cbrtl(long double __x) throw();
# 179
extern long double ceill(long double __x) throw() __attribute((const)); extern long double __ceill(long double __x) throw() __attribute((const));
# 182
extern long double fabsl(long double __x) throw() __attribute((const)); extern long double __fabsl(long double __x) throw() __attribute((const));
# 185
extern long double floorl(long double __x) throw() __attribute((const)); extern long double __floorl(long double __x) throw() __attribute((const));
# 188
extern long double fmodl(long double __x, long double __y) throw(); extern long double __fmodl(long double __x, long double __y) throw();
# 193
extern int __isinfl(long double __value) throw() __attribute((const));
# 196
extern int __finitel(long double __value) throw() __attribute((const));
# 202
extern int isinfl(long double __value) throw() __attribute((const));
# 205
extern int finitel(long double __value) throw() __attribute((const));
# 208
extern long double dreml(long double __x, long double __y) throw(); extern long double __dreml(long double __x, long double __y) throw();
# 212
extern long double significandl(long double __x) throw(); extern long double __significandl(long double __x) throw();
# 218
extern long double copysignl(long double __x, long double __y) throw() __attribute((const)); extern long double __copysignl(long double __x, long double __y) throw() __attribute((const));
# 225
extern long double nanl(const char * __tagb) throw() __attribute((const)); extern long double __nanl(const char * __tagb) throw() __attribute((const));
# 231
extern int __isnanl(long double __value) throw() __attribute((const));
# 235
extern int isnanl(long double __value) throw() __attribute((const));
# 238
extern long double j0l(long double) throw(); extern long double __j0l(long double) throw();
# 239
extern long double j1l(long double) throw(); extern long double __j1l(long double) throw();
# 240
extern long double jnl(int, long double) throw(); extern long double __jnl(int, long double) throw();
# 241
extern long double y0l(long double) throw(); extern long double __y0l(long double) throw();
# 242
extern long double y1l(long double) throw(); extern long double __y1l(long double) throw();
# 243
extern long double ynl(int, long double) throw(); extern long double __ynl(int, long double) throw();
# 250
extern long double erfl(long double) throw(); extern long double __erfl(long double) throw();
# 251
extern long double erfcl(long double) throw(); extern long double __erfcl(long double) throw();
# 252
extern long double lgammal(long double) throw(); extern long double __lgammal(long double) throw();
# 259
extern long double tgammal(long double) throw(); extern long double __tgammal(long double) throw();
# 265
extern long double gammal(long double) throw(); extern long double __gammal(long double) throw();
# 272
extern long double lgammal_r(long double, int * __signgamp) throw(); extern long double __lgammal_r(long double, int * __signgamp) throw();
# 280
extern long double rintl(long double __x) throw(); extern long double __rintl(long double __x) throw();
# 283
extern long double nextafterl(long double __x, long double __y) throw() __attribute((const)); extern long double __nextafterl(long double __x, long double __y) throw() __attribute((const));
# 285
extern long double nexttowardl(long double __x, long double __y) throw() __attribute((const)); extern long double __nexttowardl(long double __x, long double __y) throw() __attribute((const));
# 289
extern long double remainderl(long double __x, long double __y) throw(); extern long double __remainderl(long double __x, long double __y) throw();
# 293
extern long double scalbnl(long double __x, int __n) throw(); extern long double __scalbnl(long double __x, int __n) throw();
# 297
extern int ilogbl(long double __x) throw(); extern int __ilogbl(long double __x) throw();
# 302
extern long double scalblnl(long double __x, long __n) throw(); extern long double __scalblnl(long double __x, long __n) throw();
# 306
extern long double nearbyintl(long double __x) throw(); extern long double __nearbyintl(long double __x) throw();
# 310
extern long double roundl(long double __x) throw() __attribute((const)); extern long double __roundl(long double __x) throw() __attribute((const));
# 314
extern long double truncl(long double __x) throw() __attribute((const)); extern long double __truncl(long double __x) throw() __attribute((const));
# 319
extern long double remquol(long double __x, long double __y, int * __quo) throw(); extern long double __remquol(long double __x, long double __y, int * __quo) throw();
# 326
extern long lrintl(long double __x) throw(); extern long __lrintl(long double __x) throw();
# 327
extern long long llrintl(long double __x) throw(); extern long long __llrintl(long double __x) throw();
# 331
extern long lroundl(long double __x) throw(); extern long __lroundl(long double __x) throw();
# 332
extern long long llroundl(long double __x) throw(); extern long long __llroundl(long double __x) throw();
# 336
extern long double fdiml(long double __x, long double __y) throw(); extern long double __fdiml(long double __x, long double __y) throw();
# 339
extern long double fmaxl(long double __x, long double __y) throw() __attribute((const)); extern long double __fmaxl(long double __x, long double __y) throw() __attribute((const));
# 342
extern long double fminl(long double __x, long double __y) throw() __attribute((const)); extern long double __fminl(long double __x, long double __y) throw() __attribute((const));
# 346
extern int __fpclassifyl(long double __value) throw()
# 347
__attribute((const));
# 350
extern int __signbitl(long double __value) throw()
# 351
__attribute((const));
# 355
extern long double fmal(long double __x, long double __y, long double __z) throw(); extern long double __fmal(long double __x, long double __y, long double __z) throw();
# 364
extern long double scalbl(long double __x, long double __n) throw(); extern long double __scalbl(long double __x, long double __n) throw();
# 149 "/usr/include/math.h" 3
extern int signgam;
# 191 "/usr/include/math.h" 3
enum {
# 192
FP_NAN,
# 195
FP_INFINITE,
# 198
FP_ZERO,
# 201
FP_SUBNORMAL,
# 204
FP_NORMAL
# 207
};
# 295 "/usr/include/math.h" 3
typedef
# 289
enum {
# 290
_IEEE_ = (-1),
# 291
_SVID_ = 0,
# 292
_XOPEN_,
# 293
_POSIX_,
# 294
_ISOC_
# 295
} _LIB_VERSION_TYPE;
# 300
extern _LIB_VERSION_TYPE _LIB_VERSION;
# 311 "/usr/include/math.h" 3
struct __exception {
# 316
int type;
# 317
char *name;
# 318
double arg1;
# 319
double arg2;
# 320
double retval;
# 321
};
# 324
extern int matherr(__exception * __exc) throw();
# 475 "/usr/include/math.h" 3
}
# 34 "/usr/include/stdlib.h" 3
extern "C" {
# 45 "/usr/include/bits/byteswap.h" 3
static inline unsigned __bswap_32(unsigned __bsx)
# 46
{
# 47
return __builtin_bswap32(__bsx);
# 48
}
# 109 "/usr/include/bits/byteswap.h" 3
static inline __uint64_t __bswap_64(__uint64_t __bsx)
# 110
{
# 111
return __builtin_bswap64(__bsx);
# 112
}
# 66 "/usr/include/bits/waitstatus.h" 3
union wait {
# 68
int w_status;
# 70
struct {
# 72
unsigned __w_termsig:7;
# 73
unsigned __w_coredump:1;
# 74
unsigned __w_retcode:8;
# 75
unsigned:16;
# 83
} __wait_terminated;
# 85
struct {
# 87
unsigned __w_stopval:8;
# 88
unsigned __w_stopsig:8;
# 89
unsigned:16;
# 96
} __wait_stopped;
# 97
};
# 101 "/usr/include/stdlib.h" 3
typedef
# 98
struct {
# 99
int quot;
# 100
int rem;
# 101
} div_t;
# 109
typedef
# 106
struct {
# 107
long quot;
# 108
long rem;
# 109
} ldiv_t;
# 121
__extension__ typedef
# 118
struct {
# 119
long long quot;
# 120
long long rem;
# 121
} lldiv_t;
# 139 "/usr/include/stdlib.h" 3
extern size_t __ctype_get_mb_cur_max() throw();
# 144
extern double atof(const char * __nptr) throw()
# 145
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 147
extern int atoi(const char * __nptr) throw()
# 148
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 150
extern long atol(const char * __nptr) throw()
# 151
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 157
__extension__ extern long long atoll(const char * __nptr) throw()
# 158
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 164
extern double strtod(const char *__restrict__ __nptr, char **__restrict__ __endptr) throw()
# 166
__attribute((__nonnull__(1)));
# 172
extern float strtof(const char *__restrict__ __nptr, char **__restrict__ __endptr) throw()
# 173
__attribute((__nonnull__(1)));
# 175
extern long double strtold(const char *__restrict__ __nptr, char **__restrict__ __endptr) throw()
# 177
__attribute((__nonnull__(1)));
# 183
extern long strtol(const char *__restrict__ __nptr, char **__restrict__ __endptr, int __base) throw()
# 185
__attribute((__nonnull__(1)));
# 187
extern unsigned long strtoul(const char *__restrict__ __nptr, char **__restrict__ __endptr, int __base) throw()
# 189
__attribute((__nonnull__(1)));
# 195
__extension__ extern long long strtoq(const char *__restrict__ __nptr, char **__restrict__ __endptr, int __base) throw()
# 197
__attribute((__nonnull__(1)));
# 200
__extension__ extern unsigned long long strtouq(const char *__restrict__ __nptr, char **__restrict__ __endptr, int __base) throw()
# 202
__attribute((__nonnull__(1)));
# 209
__extension__ extern long long strtoll(const char *__restrict__ __nptr, char **__restrict__ __endptr, int __base) throw()
# 211
__attribute((__nonnull__(1)));
# 214
__extension__ extern unsigned long long strtoull(const char *__restrict__ __nptr, char **__restrict__ __endptr, int __base) throw()
# 216
__attribute((__nonnull__(1)));
# 239 "/usr/include/stdlib.h" 3
extern long strtol_l(const char *__restrict__ __nptr, char **__restrict__ __endptr, int __base, __locale_t __loc) throw()
# 241
__attribute((__nonnull__(1, 4)));
# 243
extern unsigned long strtoul_l(const char *__restrict__ __nptr, char **__restrict__ __endptr, int __base, __locale_t __loc) throw()
# 246
__attribute((__nonnull__(1, 4)));
# 249
__extension__ extern long long strtoll_l(const char *__restrict__ __nptr, char **__restrict__ __endptr, int __base, __locale_t __loc) throw()
# 252
__attribute((__nonnull__(1, 4)));
# 255
__extension__ extern unsigned long long strtoull_l(const char *__restrict__ __nptr, char **__restrict__ __endptr, int __base, __locale_t __loc) throw()
# 258
__attribute((__nonnull__(1, 4)));
# 260
extern double strtod_l(const char *__restrict__ __nptr, char **__restrict__ __endptr, __locale_t __loc) throw()
# 262
__attribute((__nonnull__(1, 3)));
# 264
extern float strtof_l(const char *__restrict__ __nptr, char **__restrict__ __endptr, __locale_t __loc) throw()
# 266
__attribute((__nonnull__(1, 3)));
# 268
extern long double strtold_l(const char *__restrict__ __nptr, char **__restrict__ __endptr, __locale_t __loc) throw()
# 271
__attribute((__nonnull__(1, 3)));
# 305 "/usr/include/stdlib.h" 3
extern char *l64a(long __n) throw();
# 308
extern long a64l(const char * __s) throw()
# 309
__attribute((__pure__)) __attribute((__nonnull__(1)));
# 27 "/usr/include/sys/types.h" 3
extern "C" {
# 33
typedef __u_char u_char;
# 34
typedef __u_short u_short;
# 35
typedef __u_int u_int;
# 36
typedef __u_long u_long;
# 37
typedef __quad_t quad_t;
# 38
typedef __u_quad_t u_quad_t;
# 39
typedef __fsid_t fsid_t;
# 44
typedef __loff_t loff_t;
# 48
typedef __ino_t ino_t;
# 55
typedef __ino64_t ino64_t;
# 60
typedef __dev_t dev_t;
# 65
typedef __gid_t gid_t;
# 70
typedef __mode_t mode_t;
# 75
typedef __nlink_t nlink_t;
# 80
typedef __uid_t uid_t;
# 86
typedef __off_t off_t;
# 93
typedef __off64_t off64_t;
# 104 "/usr/include/sys/types.h" 3
typedef __id_t id_t;
# 109
typedef __ssize_t ssize_t;
# 115
typedef __daddr_t daddr_t;
# 116
typedef __caddr_t caddr_t;
# 122
typedef __key_t key_t;
# 136 "/usr/include/sys/types.h" 3
typedef __useconds_t useconds_t;
# 140
typedef __suseconds_t suseconds_t;
# 150 "/usr/include/sys/types.h" 3
typedef unsigned long ulong;
# 151
typedef unsigned short ushort;
# 152
typedef unsigned uint;
# 194 "/usr/include/sys/types.h" 3
typedef signed char int8_t __attribute((__mode__(__QI__)));
# 195
typedef short int16_t __attribute((__mode__(__HI__)));
# 196
typedef int int32_t __attribute((__mode__(__SI__)));
# 197
typedef long int64_t __attribute((__mode__(__DI__)));
# 200
typedef unsigned char u_int8_t __attribute((__mode__(__QI__)));
# 201
typedef unsigned short u_int16_t __attribute((__mode__(__HI__)));
# 202
typedef unsigned u_int32_t __attribute((__mode__(__SI__)));
# 203
typedef unsigned long u_int64_t __attribute((__mode__(__DI__)));
# 205
typedef long register_t __attribute((__mode__(__word__)));
# 23 "/usr/include/bits/sigset.h" 3
typedef int __sig_atomic_t;
# 31
typedef
# 29
struct {
# 30
unsigned long __val[(1024) / ((8) * sizeof(unsigned long))];
# 31
} __sigset_t;
# 37 "/usr/include/sys/select.h" 3
typedef __sigset_t sigset_t;
# 54 "/usr/include/sys/select.h" 3
typedef long __fd_mask;
# 75 "/usr/include/sys/select.h" 3
typedef
# 65
struct {
# 69
__fd_mask fds_bits[1024 / (8 * ((int)sizeof(__fd_mask)))];
# 75
} fd_set;
# 82
typedef __fd_mask fd_mask;
# 96 "/usr/include/sys/select.h" 3
extern "C" {
# 106 "/usr/include/sys/select.h" 3
extern int select(int __nfds, fd_set *__restrict__ __readfds, fd_set *__restrict__ __writefds, fd_set *__restrict__ __exceptfds, timeval *__restrict__ __timeout);
# 118 "/usr/include/sys/select.h" 3
extern int pselect(int __nfds, fd_set *__restrict__ __readfds, fd_set *__restrict__ __writefds, fd_set *__restrict__ __exceptfds, const timespec *__restrict__ __timeout, const __sigset_t *__restrict__ __sigmask);
# 131 "/usr/include/sys/select.h" 3
}
# 29 "/usr/include/sys/sysmacros.h" 3
extern "C" {
# 32
__extension__ extern unsigned gnu_dev_major(unsigned long long __dev) throw()
# 33
__attribute((const));
# 35
__extension__ extern unsigned gnu_dev_minor(unsigned long long __dev) throw()
# 36
__attribute((const));
# 38
__extension__ extern unsigned long long gnu_dev_makedev(unsigned __major, unsigned __minor) throw()
# 40
__attribute((const));
# 63 "/usr/include/sys/sysmacros.h" 3
}
# 228 "/usr/include/sys/types.h" 3
typedef __blksize_t blksize_t;
# 235
typedef __blkcnt_t blkcnt_t;
# 239
typedef __fsblkcnt_t fsblkcnt_t;
# 243
typedef __fsfilcnt_t fsfilcnt_t;
# 262 "/usr/include/sys/types.h" 3
typedef __blkcnt64_t blkcnt64_t;
# 263
typedef __fsblkcnt64_t fsblkcnt64_t;
# 264
typedef __fsfilcnt64_t fsfilcnt64_t;
# 60 "/usr/include/bits/pthreadtypes.h" 3
typedef unsigned long pthread_t;
# 63
union pthread_attr_t {
# 65
char __size[56];
# 66
long __align;
# 67
};
# 69
typedef pthread_attr_t pthread_attr_t;
# 79
typedef
# 75
struct __pthread_internal_list {
# 77
__pthread_internal_list *__prev;
# 78
__pthread_internal_list *__next;
# 79
} __pthread_list_t;
# 128 "/usr/include/bits/pthreadtypes.h" 3
typedef
# 91 "/usr/include/bits/pthreadtypes.h" 3
union {
# 92
struct __pthread_mutex_s {
# 94
int __lock;
# 95
unsigned __count;
# 96
int __owner;
# 98
unsigned __nusers;
# 102
int __kind;
# 104
short __spins;
# 105
short __elision;
# 106
__pthread_list_t __list;
# 125 "/usr/include/bits/pthreadtypes.h" 3
} __data;
# 126
char __size[40];
# 127
long __align;
# 128
} pthread_mutex_t;
# 134
typedef
# 131
union {
# 132
char __size[4];
# 133
int __align;
# 134
} pthread_mutexattr_t;
# 154
typedef
# 140
union {
# 142
struct {
# 143
int __lock;
# 144
unsigned __futex;
# 145
__extension__ unsigned long long __total_seq;
# 146
__extension__ unsigned long long __wakeup_seq;
# 147
__extension__ unsigned long long __woken_seq;
# 148
void *__mutex;
# 149
unsigned __nwaiters;
# 150
unsigned __broadcast_seq;
# 151
} __data;
# 152
char __size[48];
# 153
__extension__ long long __align;
# 154
} pthread_cond_t;
# 160
typedef
# 157
union {
# 158
char __size[4];
# 159
int __align;
# 160
} pthread_condattr_t;
# 164
typedef unsigned pthread_key_t;
# 168
typedef int pthread_once_t;
# 214 "/usr/include/bits/pthreadtypes.h" 3
typedef
# 175 "/usr/include/bits/pthreadtypes.h" 3
union {
# 178
struct {
# 179
int __lock;
# 180
unsigned __nr_readers;
# 181
unsigned __readers_wakeup;
# 182
unsigned __writer_wakeup;
# 183
unsigned __nr_readers_queued;
# 184
unsigned __nr_writers_queued;
# 185
int __writer;
# 186
int __shared;
# 187
unsigned long __pad1;
# 188
unsigned long __pad2;
# 191
unsigned __flags;
# 193
} __data;
# 212 "/usr/include/bits/pthreadtypes.h" 3
char __size[56];
# 213
long __align;
# 214
} pthread_rwlock_t;
# 220
typedef
# 217
union {
# 218
char __size[8];
# 219
long __align;
# 220
} pthread_rwlockattr_t;
# 226
typedef volatile int pthread_spinlock_t;
# 235
typedef
# 232
union {
# 233
char __size[32];
# 234
long __align;
# 235
} pthread_barrier_t;
# 241
typedef
# 238
union {
# 239
char __size[4];
# 240
int __align;
# 241
} pthread_barrierattr_t;
# 273 "/usr/include/sys/types.h" 3
}
# 321 "/usr/include/stdlib.h" 3
extern long random() throw();
# 324
extern void srandom(unsigned __seed) throw();
# 330
extern char *initstate(unsigned __seed, char * __statebuf, size_t __statelen) throw()
# 331
__attribute((__nonnull__(2)));
# 335
extern char *setstate(char * __statebuf) throw() __attribute((__nonnull__(1)));
# 343
struct random_data {
# 345
int32_t *fptr;
# 346
int32_t *rptr;
# 347
int32_t *state;
# 348
int rand_type;
# 349
int rand_deg;
# 350
int rand_sep;
# 351
int32_t *end_ptr;
# 352
};
# 354
extern int random_r(random_data *__restrict__ __buf, int32_t *__restrict__ __result) throw()
# 355
__attribute((__nonnull__(1, 2)));
# 357
extern int srandom_r(unsigned __seed, random_data * __buf) throw()
# 358
__attribute((__nonnull__(2)));
# 360
extern int initstate_r(unsigned __seed, char *__restrict__ __statebuf, size_t __statelen, random_data *__restrict__ __buf) throw()
# 363
__attribute((__nonnull__(2, 4)));
# 365
extern int setstate_r(char *__restrict__ __statebuf, random_data *__restrict__ __buf) throw()
# 367
__attribute((__nonnull__(1, 2)));
# 374
extern int rand() throw();
# 376
extern void srand(unsigned __seed) throw();
# 381
extern int rand_r(unsigned * __seed) throw();
# 389
extern double drand48() throw();
# 390
extern double erand48(unsigned short __xsubi[3]) throw() __attribute((__nonnull__(1)));
# 393
extern long lrand48() throw();
# 394
extern long nrand48(unsigned short __xsubi[3]) throw()
# 395
__attribute((__nonnull__(1)));
# 398
extern long mrand48() throw();
# 399
extern long jrand48(unsigned short __xsubi[3]) throw()
# 400
__attribute((__nonnull__(1)));
# 403
extern void srand48(long __seedval) throw();
# 404
extern unsigned short *seed48(unsigned short __seed16v[3]) throw()
# 405
__attribute((__nonnull__(1)));
# 406
extern void lcong48(unsigned short __param[7]) throw() __attribute((__nonnull__(1)));
# 412
struct drand48_data {
# 414
unsigned short __x[3];
# 415
unsigned short __old_x[3];
# 416
unsigned short __c;
# 417
unsigned short __init;
# 418
unsigned long long __a;
# 419
};
# 422
extern int drand48_r(drand48_data *__restrict__ __buffer, double *__restrict__ __result) throw()
# 423
__attribute((__nonnull__(1, 2)));
# 424
extern int erand48_r(unsigned short __xsubi[3], drand48_data *__restrict__ __buffer, double *__restrict__ __result) throw()
# 426
__attribute((__nonnull__(1, 2)));
# 429
extern int lrand48_r(drand48_data *__restrict__ __buffer, long *__restrict__ __result) throw()
# 431
__attribute((__nonnull__(1, 2)));
# 432
extern int nrand48_r(unsigned short __xsubi[3], drand48_data *__restrict__ __buffer, long *__restrict__ __result) throw()
# 435
__attribute((__nonnull__(1, 2)));
# 438
extern int mrand48_r(drand48_data *__restrict__ __buffer, long *__restrict__ __result) throw()
# 440
__attribute((__nonnull__(1, 2)));
# 441
extern int jrand48_r(unsigned short __xsubi[3], drand48_data *__restrict__ __buffer, long *__restrict__ __result) throw()
# 444
__attribute((__nonnull__(1, 2)));
# 447
extern int srand48_r(long __seedval, drand48_data * __buffer) throw()
# 448
__attribute((__nonnull__(2)));
# 450
extern int seed48_r(unsigned short __seed16v[3], drand48_data * __buffer) throw()
# 451
__attribute((__nonnull__(1, 2)));
# 453
extern int lcong48_r(unsigned short __param[7], drand48_data * __buffer) throw()
# 455
__attribute((__nonnull__(1, 2)));
# 465
extern void *malloc(size_t __size) throw() __attribute((__malloc__));
# 467
extern void *calloc(size_t __nmemb, size_t __size) throw()
# 468
__attribute((__malloc__));
# 479
extern void *realloc(void * __ptr, size_t __size) throw()
# 480
__attribute((__warn_unused_result__));
# 482
extern void free(void * __ptr) throw();
# 487
extern void cfree(void * __ptr) throw();
# 26 "/usr/include/alloca.h" 3
extern "C" {
# 32
extern void *alloca(size_t __size) throw();
# 38
}
# 497 "/usr/include/stdlib.h" 3
extern void *valloc(size_t __size) throw() __attribute((__malloc__));
# 502
extern int posix_memalign(void ** __memptr, size_t __alignment, size_t __size) throw()
# 503
__attribute((__nonnull__(1)));
# 508
extern void *aligned_alloc(size_t __alignment, size_t __size) throw()
# 509
__attribute((__malloc__, __alloc_size__(2)));
# 514
extern void abort() throw() __attribute((__noreturn__));
# 518
extern int atexit(void (* __func)(void)) throw() __attribute((__nonnull__(1)));
# 523
extern "C++" int at_quick_exit(void (* __func)(void)) throw() __asm__("at_quick_exit")
# 524
__attribute((__nonnull__(1)));
# 534
extern int on_exit(void (* __func)(int __status, void * __arg), void * __arg) throw()
# 535
__attribute((__nonnull__(1)));
# 542
extern void exit(int __status) throw() __attribute((__noreturn__));
# 548
extern void quick_exit(int __status) throw() __attribute((__noreturn__));
# 556
extern void _Exit(int __status) throw() __attribute((__noreturn__));
# 563
extern char *getenv(const char * __name) throw() __attribute((__nonnull__(1)));
# 569
extern char *secure_getenv(const char * __name) throw()
# 570
__attribute((__nonnull__(1)));
# 577
extern int putenv(char * __string) throw() __attribute((__nonnull__(1)));
# 583
extern int setenv(const char * __name, const char * __value, int __replace) throw()
# 584
__attribute((__nonnull__(2)));
# 587
extern int unsetenv(const char * __name) throw() __attribute((__nonnull__(1)));
# 594
extern int clearenv() throw();
# 605 "/usr/include/stdlib.h" 3
extern char *mktemp(char * __template) throw() __attribute((__nonnull__(1)));
# 619 "/usr/include/stdlib.h" 3
extern int mkstemp(char * __template) __attribute((__nonnull__(1)));
# 629 "/usr/include/stdlib.h" 3
extern int mkstemp64(char * __template) __attribute((__nonnull__(1)));
# 641 "/usr/include/stdlib.h" 3
extern int mkstemps(char * __template, int __suffixlen) __attribute((__nonnull__(1)));
# 651 "/usr/include/stdlib.h" 3
extern int mkstemps64(char * __template, int __suffixlen)
# 652
__attribute((__nonnull__(1)));
# 662 "/usr/include/stdlib.h" 3
extern char *mkdtemp(char * __template) throw() __attribute((__nonnull__(1)));
# 673 "/usr/include/stdlib.h" 3
extern int mkostemp(char * __template, int __flags) __attribute((__nonnull__(1)));
# 683 "/usr/include/stdlib.h" 3
extern int mkostemp64(char * __template, int __flags) __attribute((__nonnull__(1)));
# 693 "/usr/include/stdlib.h" 3
extern int mkostemps(char * __template, int __suffixlen, int __flags)
# 694
__attribute((__nonnull__(1)));
# 705 "/usr/include/stdlib.h" 3
extern int mkostemps64(char * __template, int __suffixlen, int __flags)
# 706
__attribute((__nonnull__(1)));
# 716
extern int system(const char * __command);
# 723
extern char *canonicalize_file_name(const char * __name) throw()
# 724
__attribute((__nonnull__(1)));
# 733 "/usr/include/stdlib.h" 3
extern char *realpath(const char *__restrict__ __name, char *__restrict__ __resolved) throw();
# 741
typedef int (*__compar_fn_t)(const void *, const void *);
# 744
typedef __compar_fn_t comparison_fn_t;
# 748
typedef int (*__compar_d_fn_t)(const void *, const void *, void *);
# 754
extern void *bsearch(const void * __key, const void * __base, size_t __nmemb, size_t __size, __compar_fn_t __compar)
# 756
__attribute((__nonnull__(1, 2, 5)));
# 760
extern void qsort(void * __base, size_t __nmemb, size_t __size, __compar_fn_t __compar)
# 761
__attribute((__nonnull__(1, 4)));
# 763
extern void qsort_r(void * __base, size_t __nmemb, size_t __size, __compar_d_fn_t __compar, void * __arg)
# 765
__attribute((__nonnull__(1, 4)));
# 770
extern int abs(int __x) throw() __attribute((const));
# 771
extern long labs(long __x) throw() __attribute((const));
# 775
__extension__ extern long long llabs(long long __x) throw()
# 776
__attribute((const));
# 784
extern div_t div(int __numer, int __denom) throw()
# 785
__attribute((const));
# 786
extern ldiv_t ldiv(long __numer, long __denom) throw()
# 787
__attribute((const));
# 792
__extension__ extern lldiv_t lldiv(long long __numer, long long __denom) throw()
# 794
__attribute((const));
# 807 "/usr/include/stdlib.h" 3
extern char *ecvt(double __value, int __ndigit, int *__restrict__ __decpt, int *__restrict__ __sign) throw()
# 808
__attribute((__nonnull__(3, 4)));
# 813
extern char *fcvt(double __value, int __ndigit, int *__restrict__ __decpt, int *__restrict__ __sign) throw()
# 814
__attribute((__nonnull__(3, 4)));
# 819
extern char *gcvt(double __value, int __ndigit, char * __buf) throw()
# 820
__attribute((__nonnull__(3)));
# 825
extern char *qecvt(long double __value, int __ndigit, int *__restrict__ __decpt, int *__restrict__ __sign) throw()
# 827
__attribute((__nonnull__(3, 4)));
# 828
extern char *qfcvt(long double __value, int __ndigit, int *__restrict__ __decpt, int *__restrict__ __sign) throw()
# 830
__attribute((__nonnull__(3, 4)));
# 831
extern char *qgcvt(long double __value, int __ndigit, char * __buf) throw()
# 832
__attribute((__nonnull__(3)));
# 837
extern int ecvt_r(double __value, int __ndigit, int *__restrict__ __decpt, int *__restrict__ __sign, char *__restrict__ __buf, size_t __len) throw()
# 839
__attribute((__nonnull__(3, 4, 5)));
# 840
extern int fcvt_r(double __value, int __ndigit, int *__restrict__ __decpt, int *__restrict__ __sign, char *__restrict__ __buf, size_t __len) throw()
# 842
__attribute((__nonnull__(3, 4, 5)));
# 844
extern int qecvt_r(long double __value, int __ndigit, int *__restrict__ __decpt, int *__restrict__ __sign, char *__restrict__ __buf, size_t __len) throw()
# 847
__attribute((__nonnull__(3, 4, 5)));
# 848
extern int qfcvt_r(long double __value, int __ndigit, int *__restrict__ __decpt, int *__restrict__ __sign, char *__restrict__ __buf, size_t __len) throw()
# 851
__attribute((__nonnull__(3, 4, 5)));
# 859
extern int mblen(const char * __s, size_t __n) throw();
# 862
extern int mbtowc(wchar_t *__restrict__ __pwc, const char *__restrict__ __s, size_t __n) throw();
# 866
extern int wctomb(char * __s, wchar_t __wchar) throw();
# 870
extern size_t mbstowcs(wchar_t *__restrict__ __pwcs, const char *__restrict__ __s, size_t __n) throw();
# 873
extern size_t wcstombs(char *__restrict__ __s, const wchar_t *__restrict__ __pwcs, size_t __n) throw();
# 884
extern int rpmatch(const char * __response) throw() __attribute((__nonnull__(1)));
# 895 "/usr/include/stdlib.h" 3
extern int getsubopt(char **__restrict__ __optionp, char *const *__restrict__ __tokens, char **__restrict__ __valuep) throw()
# 898
__attribute((__nonnull__(1, 2, 3)));
# 904
extern void setkey(const char * __key) throw() __attribute((__nonnull__(1)));
# 912
extern int posix_openpt(int __oflag);
# 920
extern int grantpt(int __fd) throw();
# 924
extern int unlockpt(int __fd) throw();
# 929
extern char *ptsname(int __fd) throw();
# 936
extern int ptsname_r(int __fd, char * __buf, size_t __buflen) throw()
# 937
__attribute((__nonnull__(2)));
# 940
extern int getpt();
# 947
extern int getloadavg(double __loadavg[], int __nelem) throw()
# 948
__attribute((__nonnull__(1)));
# 964 "/usr/include/stdlib.h" 3
}
# 1855 "/usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++config.h" 3
namespace std {
# 1857
typedef unsigned long size_t;
# 1858
typedef long ptrdiff_t;
# 1863
}
# 68 "/usr/include/c++/4.8.2/bits/cpp_type_traits.h" 3
namespace __gnu_cxx __attribute((__visibility__("default"))) {
# 72
template< class _Iterator, class _Container> class __normal_iterator;
# 76
}
# 78
namespace std __attribute((__visibility__("default"))) {
# 82
struct __true_type { };
# 83
struct __false_type { };
# 85
template< bool >
# 86
struct __truth_type {
# 87
typedef __false_type __type; };
# 90
template<> struct __truth_type< true> {
# 91
typedef __true_type __type; };
# 95
template< class _Sp, class _Tp>
# 96
struct __traitor {
# 98
enum { __value = ((bool)_Sp::__value) || ((bool)_Tp::__value)};
# 99
typedef typename __truth_type< __value> ::__type __type;
# 100
};
# 103
template< class , class >
# 104
struct __are_same {
# 106
enum { __value};
# 107
typedef __false_type __type;
# 108
};
# 110
template< class _Tp>
# 111
struct __are_same< _Tp, _Tp> {
# 113
enum { __value = 1};
# 114
typedef __true_type __type;
# 115
};
# 118
template< class _Tp>
# 119
struct __is_void {
# 121
enum { __value};
# 122
typedef __false_type __type;
# 123
};
# 126
template<> struct __is_void< void> {
# 128
enum { __value = 1};
# 129
typedef __true_type __type;
# 130
};
# 135
template< class _Tp>
# 136
struct __is_integer {
# 138
enum { __value};
# 139
typedef __false_type __type;
# 140
};
# 146
template<> struct __is_integer< bool> {
# 148
enum { __value = 1};
# 149
typedef __true_type __type;
# 150
};
# 153
template<> struct __is_integer< char> {
# 155
enum { __value = 1};
# 156
typedef __true_type __type;
# 157
};
# 160
template<> struct __is_integer< signed char> {
# 162
enum { __value = 1};
# 163
typedef __true_type __type;
# 164
};
# 167
template<> struct __is_integer< unsigned char> {
# 169
enum { __value = 1};
# 170
typedef __true_type __type;
# 171
};
# 175
template<> struct __is_integer< wchar_t> {
# 177
enum { __value = 1};
# 178
typedef __true_type __type;
# 179
};
# 199 "/usr/include/c++/4.8.2/bits/cpp_type_traits.h" 3
template<> struct __is_integer< short> {
# 201
enum { __value = 1};
# 202
typedef __true_type __type;
# 203
};
# 206
template<> struct __is_integer< unsigned short> {
# 208
enum { __value = 1};
# 209
typedef __true_type __type;
# 210
};
# 213
template<> struct __is_integer< int> {
# 215
enum { __value = 1};
# 216
typedef __true_type __type;
# 217
};
# 220
template<> struct __is_integer< unsigned> {
# 222
enum { __value = 1};
# 223
typedef __true_type __type;
# 224
};
# 227
template<> struct __is_integer< long> {
# 229
enum { __value = 1};
# 230
typedef __true_type __type;
# 231
};
# 234
template<> struct __is_integer< unsigned long> {
# 236
enum { __value = 1};
# 237
typedef __true_type __type;
# 238
};
# 241
template<> struct __is_integer< long long> {
# 243
enum { __value = 1};
# 244
typedef __true_type __type;
# 245
};
# 248
template<> struct __is_integer< unsigned long long> {
# 250
enum { __value = 1};
# 251
typedef __true_type __type;
# 252
};
# 257
template< class _Tp>
# 258
struct __is_floating {
# 260
enum { __value};
# 261
typedef __false_type __type;
# 262
};
# 266
template<> struct __is_floating< float> {
# 268
enum { __value = 1};
# 269
typedef __true_type __type;
# 270
};
# 273
template<> struct __is_floating< double> {
# 275
enum { __value = 1};
# 276
typedef __true_type __type;
# 277
};
# 280
template<> struct __is_floating< long double> {
# 282
enum { __value = 1};
# 283
typedef __true_type __type;
# 284
};
# 289
template< class _Tp>
# 290
struct __is_pointer {
# 292
enum { __value};
# 293
typedef __false_type __type;
# 294
};
# 296
template< class _Tp>
# 297
struct __is_pointer< _Tp *> {
# 299
enum { __value = 1};
# 300
typedef __true_type __type;
# 301
};
# 306
template< class _Tp>
# 307
struct __is_normal_iterator {
# 309
enum { __value};
# 310
typedef __false_type __type;
# 311
};
# 313
template< class _Iterator, class _Container>
# 314
struct __is_normal_iterator< __gnu_cxx::__normal_iterator< _Iterator, _Container> > {
# 317
enum { __value = 1};
# 318
typedef __true_type __type;
# 319
};
# 324
template< class _Tp>
# 325
struct __is_arithmetic : public __traitor< __is_integer< _Tp> , __is_floating< _Tp> > {
# 327
};
# 332
template< class _Tp>
# 333
struct __is_fundamental : public __traitor< __is_void< _Tp> , __is_arithmetic< _Tp> > {
# 335
};
# 340
template< class _Tp>
# 341
struct __is_scalar : public __traitor< __is_arithmetic< _Tp> , __is_pointer< _Tp> > {
# 343
};
# 348
template< class _Tp>
# 349
struct __is_char {
# 351
enum { __value};
# 352
typedef __false_type __type;
# 353
};
# 356
template<> struct __is_char< char> {
# 358
enum { __value = 1};
# 359
typedef __true_type __type;
# 360
};
# 364
template<> struct __is_char< wchar_t> {
# 366
enum { __value = 1};
# 367
typedef __true_type __type;
# 368
};
# 371
template< class _Tp>
# 372
struct __is_byte {
# 374
enum { __value};
# 375
typedef __false_type __type;
# 376
};
# 379
template<> struct __is_byte< char> {
# 381
enum { __value = 1};
# 382
typedef __true_type __type;
# 383
};
# 386
template<> struct __is_byte< signed char> {
# 388
enum { __value = 1};
# 389
typedef __true_type __type;
# 390
};
# 393
template<> struct __is_byte< unsigned char> {
# 395
enum { __value = 1};
# 396
typedef __true_type __type;
# 397
};
# 402
template< class _Tp>
# 403
struct __is_move_iterator {
# 405
enum { __value};
# 406
typedef __false_type __type;
# 407
};
# 422 "/usr/include/c++/4.8.2/bits/cpp_type_traits.h" 3
}
# 37 "/usr/include/c++/4.8.2/ext/type_traits.h" 3
namespace __gnu_cxx __attribute((__visibility__("default"))) {
# 42
template< bool , class >
# 43
struct __enable_if {
# 44
};
# 46
template< class _Tp>
# 47
struct __enable_if< true, _Tp> {
# 48
typedef _Tp __type; };
# 52
template< bool _Cond, class _Iftrue, class _Iffalse>
# 53
struct __conditional_type {
# 54
typedef _Iftrue __type; };
# 56
template< class _Iftrue, class _Iffalse>
# 57
struct __conditional_type< false, _Iftrue, _Iffalse> {
# 58
typedef _Iffalse __type; };
# 62
template< class _Tp>
# 63
struct __add_unsigned {
# 66
private: typedef __enable_if< std::__is_integer< _Tp> ::__value, _Tp> __if_type;
# 69
public: typedef typename __enable_if< std::__is_integer< _Tp> ::__value, _Tp> ::__type __type;
# 70
};
# 73
template<> struct __add_unsigned< char> {
# 74
typedef unsigned char __type; };
# 77
template<> struct __add_unsigned< signed char> {
# 78
typedef unsigned char __type; };
# 81
template<> struct __add_unsigned< short> {
# 82
typedef unsigned short __type; };
# 85
template<> struct __add_unsigned< int> {
# 86
typedef unsigned __type; };
# 89
template<> struct __add_unsigned< long> {
# 90
typedef unsigned long __type; };
# 93
template<> struct __add_unsigned< long long> {
# 94
typedef unsigned long long __type; };
# 98
template<> struct __add_unsigned< bool> ;
# 101
template<> struct __add_unsigned< wchar_t> ;
# 105
template< class _Tp>
# 106
struct __remove_unsigned {
# 109
private: typedef __enable_if< std::__is_integer< _Tp> ::__value, _Tp> __if_type;
# 112
public: typedef typename __enable_if< std::__is_integer< _Tp> ::__value, _Tp> ::__type __type;
# 113
};
# 116
template<> struct __remove_unsigned< char> {
# 117
typedef signed char __type; };
# 120
template<> struct __remove_unsigned< unsigned char> {
# 121
typedef signed char __type; };
# 124
template<> struct __remove_unsigned< unsigned short> {
# 125
typedef short __type; };
# 128
template<> struct __remove_unsigned< unsigned> {
# 129
typedef int __type; };
# 132
template<> struct __remove_unsigned< unsigned long> {
# 133
typedef long __type; };
# 136
template<> struct __remove_unsigned< unsigned long long> {
# 137
typedef long long __type; };
# 141
template<> struct __remove_unsigned< bool> ;
# 144
template<> struct __remove_unsigned< wchar_t> ;
# 148
template< class _Type> inline bool
# 150
__is_null_pointer(_Type *__ptr)
# 151
{ return __ptr == 0; }
# 153
template< class _Type> inline bool
# 155
__is_null_pointer(_Type)
# 156
{ return false; }
# 160
template< class _Tp, bool = std::__is_integer< _Tp> ::__value>
# 161
struct __promote {
# 162
typedef double __type; };
# 167
template< class _Tp>
# 168
struct __promote< _Tp, false> {
# 169
};
# 172
template<> struct __promote< long double> {
# 173
typedef long double __type; };
# 176
template<> struct __promote< double> {
# 177
typedef double __type; };
# 180
template<> struct __promote< float> {
# 181
typedef float __type; };
# 183
template< class _Tp, class _Up, class
# 184
_Tp2 = typename __promote< _Tp> ::__type, class
# 185
_Up2 = typename __promote< _Up> ::__type>
# 186
struct __promote_2 {
# 188
typedef __typeof__(_Tp2() + _Up2()) __type;
# 189
};
# 191
template< class _Tp, class _Up, class _Vp, class
# 192
_Tp2 = typename __promote< _Tp> ::__type, class
# 193
_Up2 = typename __promote< _Up> ::__type, class
# 194
_Vp2 = typename __promote< _Vp> ::__type>
# 195
struct __promote_3 {
# 197
typedef __typeof__((_Tp2() + _Up2()) + _Vp2()) __type;
# 198
};
# 200
template< class _Tp, class _Up, class _Vp, class _Wp, class
# 201
_Tp2 = typename __promote< _Tp> ::__type, class
# 202
_Up2 = typename __promote< _Up> ::__type, class
# 203
_Vp2 = typename __promote< _Vp> ::__type, class
# 204
_Wp2 = typename __promote< _Wp> ::__type>
# 205
struct __promote_4 {
# 207
typedef __typeof__(((_Tp2() + _Up2()) + _Vp2()) + _Wp2()) __type;
# 208
};
# 211
}
# 75 "/usr/include/c++/4.8.2/cmath" 3
namespace std __attribute((__visibility__("default"))) {
# 81
inline double abs(double __x)
# 82
{ return __builtin_fabs(__x); }
# 87
inline float abs(float __x)
# 88
{ return __builtin_fabsf(__x); }
# 91
inline long double abs(long double __x)
# 92
{ return __builtin_fabsl(__x); }
# 95
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 99
abs(_Tp __x)
# 100
{ return __builtin_fabs(__x); }
# 102
using ::acos;
# 106
inline float acos(float __x)
# 107
{ return __builtin_acosf(__x); }
# 110
inline long double acos(long double __x)
# 111
{ return __builtin_acosl(__x); }
# 114
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 118
acos(_Tp __x)
# 119
{ return __builtin_acos(__x); }
# 121
using ::asin;
# 125
inline float asin(float __x)
# 126
{ return __builtin_asinf(__x); }
# 129
inline long double asin(long double __x)
# 130
{ return __builtin_asinl(__x); }
# 133
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 137
asin(_Tp __x)
# 138
{ return __builtin_asin(__x); }
# 140
using ::atan;
# 144
inline float atan(float __x)
# 145
{ return __builtin_atanf(__x); }
# 148
inline long double atan(long double __x)
# 149
{ return __builtin_atanl(__x); }
# 152
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 156
atan(_Tp __x)
# 157
{ return __builtin_atan(__x); }
# 159
using ::atan2;
# 163
inline float atan2(float __y, float __x)
# 164
{ return __builtin_atan2f(__y, __x); }
# 167
inline long double atan2(long double __y, long double __x)
# 168
{ return __builtin_atan2l(__y, __x); }
# 171
template< class _Tp, class _Up> inline typename __gnu_cxx::__promote_2< _Tp, _Up> ::__type
# 174
atan2(_Tp __y, _Up __x)
# 175
{
# 176
typedef typename __gnu_cxx::__promote_2< _Tp, _Up> ::__type __type;
# 177
return atan2((__type)__y, (__type)__x);
# 178
}
# 180
using ::ceil;
# 184
inline float ceil(float __x)
# 185
{ return __builtin_ceilf(__x); }
# 188
inline long double ceil(long double __x)
# 189
{ return __builtin_ceill(__x); }
# 192
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 196
ceil(_Tp __x)
# 197
{ return __builtin_ceil(__x); }
# 199
using ::cos;
# 203
inline float cos(float __x)
# 204
{ return __builtin_cosf(__x); }
# 207
inline long double cos(long double __x)
# 208
{ return __builtin_cosl(__x); }
# 211
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 215
cos(_Tp __x)
# 216
{ return __builtin_cos(__x); }
# 218
using ::cosh;
# 222
inline float cosh(float __x)
# 223
{ return __builtin_coshf(__x); }
# 226
inline long double cosh(long double __x)
# 227
{ return __builtin_coshl(__x); }
# 230
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 234
cosh(_Tp __x)
# 235
{ return __builtin_cosh(__x); }
# 237
using ::exp;
# 241
inline float exp(float __x)
# 242
{ return __builtin_expf(__x); }
# 245
inline long double exp(long double __x)
# 246
{ return __builtin_expl(__x); }
# 249
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 253
exp(_Tp __x)
# 254
{ return __builtin_exp(__x); }
# 256
using ::fabs;
# 260
inline float fabs(float __x)
# 261
{ return __builtin_fabsf(__x); }
# 264
inline long double fabs(long double __x)
# 265
{ return __builtin_fabsl(__x); }
# 268
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 272
fabs(_Tp __x)
# 273
{ return __builtin_fabs(__x); }
# 275
using ::floor;
# 279
inline float floor(float __x)
# 280
{ return __builtin_floorf(__x); }
# 283
inline long double floor(long double __x)
# 284
{ return __builtin_floorl(__x); }
# 287
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 291
floor(_Tp __x)
# 292
{ return __builtin_floor(__x); }
# 294
using ::fmod;
# 298
inline float fmod(float __x, float __y)
# 299
{ return __builtin_fmodf(__x, __y); }
# 302
inline long double fmod(long double __x, long double __y)
# 303
{ return __builtin_fmodl(__x, __y); }
# 306
template< class _Tp, class _Up> inline typename __gnu_cxx::__promote_2< _Tp, _Up> ::__type
# 309
fmod(_Tp __x, _Up __y)
# 310
{
# 311
typedef typename __gnu_cxx::__promote_2< _Tp, _Up> ::__type __type;
# 312
return fmod((__type)__x, (__type)__y);
# 313
}
# 315
using ::frexp;
# 319
inline float frexp(float __x, int *__exp)
# 320
{ return __builtin_frexpf(__x, __exp); }
# 323
inline long double frexp(long double __x, int *__exp)
# 324
{ return __builtin_frexpl(__x, __exp); }
# 327
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 331
frexp(_Tp __x, int *__exp)
# 332
{ return __builtin_frexp(__x, __exp); }
# 334
using ::ldexp;
# 338
inline float ldexp(float __x, int __exp)
# 339
{ return __builtin_ldexpf(__x, __exp); }
# 342
inline long double ldexp(long double __x, int __exp)
# 343
{ return __builtin_ldexpl(__x, __exp); }
# 346
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 350
ldexp(_Tp __x, int __exp)
# 351
{ return __builtin_ldexp(__x, __exp); }
# 353
using ::log;
# 357
inline float log(float __x)
# 358
{ return __builtin_logf(__x); }
# 361
inline long double log(long double __x)
# 362
{ return __builtin_logl(__x); }
# 365
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 369
log(_Tp __x)
# 370
{ return __builtin_log(__x); }
# 372
using ::log10;
# 376
inline float log10(float __x)
# 377
{ return __builtin_log10f(__x); }
# 380
inline long double log10(long double __x)
# 381
{ return __builtin_log10l(__x); }
# 384
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 388
log10(_Tp __x)
# 389
{ return __builtin_log10(__x); }
# 391
using ::modf;
# 395
inline float modf(float __x, float *__iptr)
# 396
{ return __builtin_modff(__x, __iptr); }
# 399
inline long double modf(long double __x, long double *__iptr)
# 400
{ return __builtin_modfl(__x, __iptr); }
# 403
using ::pow;
# 407
inline float pow(float __x, float __y)
# 408
{ return __builtin_powf(__x, __y); }
# 411
inline long double pow(long double __x, long double __y)
# 412
{ return __builtin_powl(__x, __y); }
# 418
inline double pow(double __x, int __i)
# 419
{ return __builtin_powi(__x, __i); }
# 422
inline float pow(float __x, int __n)
# 423
{ return __builtin_powif(__x, __n); }
# 426
inline long double pow(long double __x, int __n)
# 427
{ return __builtin_powil(__x, __n); }
# 431
template< class _Tp, class _Up> inline typename __gnu_cxx::__promote_2< _Tp, _Up> ::__type
# 434
pow(_Tp __x, _Up __y)
# 435
{
# 436
typedef typename __gnu_cxx::__promote_2< _Tp, _Up> ::__type __type;
# 437
return pow((__type)__x, (__type)__y);
# 438
}
# 440
using ::sin;
# 444
inline float sin(float __x)
# 445
{ return __builtin_sinf(__x); }
# 448
inline long double sin(long double __x)
# 449
{ return __builtin_sinl(__x); }
# 452
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 456
sin(_Tp __x)
# 457
{ return __builtin_sin(__x); }
# 459
using ::sinh;
# 463
inline float sinh(float __x)
# 464
{ return __builtin_sinhf(__x); }
# 467
inline long double sinh(long double __x)
# 468
{ return __builtin_sinhl(__x); }
# 471
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 475
sinh(_Tp __x)
# 476
{ return __builtin_sinh(__x); }
# 478
using ::sqrt;
# 482
inline float sqrt(float __x)
# 483
{ return __builtin_sqrtf(__x); }
# 486
inline long double sqrt(long double __x)
# 487
{ return __builtin_sqrtl(__x); }
# 490
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 494
sqrt(_Tp __x)
# 495
{ return __builtin_sqrt(__x); }
# 497
using ::tan;
# 501
inline float tan(float __x)
# 502
{ return __builtin_tanf(__x); }
# 505
inline long double tan(long double __x)
# 506
{ return __builtin_tanl(__x); }
# 509
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 513
tan(_Tp __x)
# 514
{ return __builtin_tan(__x); }
# 516
using ::tanh;
# 520
inline float tanh(float __x)
# 521
{ return __builtin_tanhf(__x); }
# 524
inline long double tanh(long double __x)
# 525
{ return __builtin_tanhl(__x); }
# 528
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_integer< _Tp> ::__value, double> ::__type
# 532
tanh(_Tp __x)
# 533
{ return __builtin_tanh(__x); }
# 536
}
# 555 "/usr/include/c++/4.8.2/cmath" 3
namespace std __attribute((__visibility__("default"))) {
# 805 "/usr/include/c++/4.8.2/cmath" 3
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_arithmetic< _Tp> ::__value, int> ::__type
# 808
fpclassify(_Tp __f)
# 809
{
# 810
typedef typename __gnu_cxx::__promote< _Tp> ::__type __type;
# 811
return __builtin_fpclassify(0, 1, 4, 3, 2, (__type)__f);
# 813
}
# 815
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_arithmetic< _Tp> ::__value, int> ::__type
# 818
isfinite(_Tp __f)
# 819
{
# 820
typedef typename __gnu_cxx::__promote< _Tp> ::__type __type;
# 821
return __builtin_isfinite((__type)__f);
# 822
}
# 824
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_arithmetic< _Tp> ::__value, int> ::__type
# 827
isinf(_Tp __f)
# 828
{
# 829
typedef typename __gnu_cxx::__promote< _Tp> ::__type __type;
# 830
return __builtin_isinf((__type)__f);
# 831
}
# 833
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_arithmetic< _Tp> ::__value, int> ::__type
# 836
isnan(_Tp __f)
# 837
{
# 838
typedef typename __gnu_cxx::__promote< _Tp> ::__type __type;
# 839
return __builtin_isnan((__type)__f);
# 840
}
# 842
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_arithmetic< _Tp> ::__value, int> ::__type
# 845
isnormal(_Tp __f)
# 846
{
# 847
typedef typename __gnu_cxx::__promote< _Tp> ::__type __type;
# 848
return __builtin_isnormal((__type)__f);
# 849
}
# 851
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_arithmetic< _Tp> ::__value, int> ::__type
# 854
signbit(_Tp __f)
# 855
{
# 856
typedef typename __gnu_cxx::__promote< _Tp> ::__type __type;
# 857
return __builtin_signbit((__type)__f);
# 858
}
# 860
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_arithmetic< _Tp> ::__value, int> ::__type
# 863
isgreater(_Tp __f1, _Tp __f2)
# 864
{
# 865
typedef typename __gnu_cxx::__promote< _Tp> ::__type __type;
# 866
return __builtin_isgreater((__type)__f1, (__type)__f2);
# 867
}
# 869
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_arithmetic< _Tp> ::__value, int> ::__type
# 872
isgreaterequal(_Tp __f1, _Tp __f2)
# 873
{
# 874
typedef typename __gnu_cxx::__promote< _Tp> ::__type __type;
# 875
return __builtin_isgreaterequal((__type)__f1, (__type)__f2);
# 876
}
# 878
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_arithmetic< _Tp> ::__value, int> ::__type
# 881
isless(_Tp __f1, _Tp __f2)
# 882
{
# 883
typedef typename __gnu_cxx::__promote< _Tp> ::__type __type;
# 884
return __builtin_isless((__type)__f1, (__type)__f2);
# 885
}
# 887
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_arithmetic< _Tp> ::__value, int> ::__type
# 890
islessequal(_Tp __f1, _Tp __f2)
# 891
{
# 892
typedef typename __gnu_cxx::__promote< _Tp> ::__type __type;
# 893
return __builtin_islessequal((__type)__f1, (__type)__f2);
# 894
}
# 896
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_arithmetic< _Tp> ::__value, int> ::__type
# 899
islessgreater(_Tp __f1, _Tp __f2)
# 900
{
# 901
typedef typename __gnu_cxx::__promote< _Tp> ::__type __type;
# 902
return __builtin_islessgreater((__type)__f1, (__type)__f2);
# 903
}
# 905
template< class _Tp> inline typename __gnu_cxx::__enable_if< __is_arithmetic< _Tp> ::__value, int> ::__type
# 908
isunordered(_Tp __f1, _Tp __f2)
# 909
{
# 910
typedef typename __gnu_cxx::__promote< _Tp> ::__type __type;
# 911
return __builtin_isunordered((__type)__f1, (__type)__f2);
# 912
}
# 917
}
# 114 "/usr/include/c++/4.8.2/cstdlib" 3
namespace std __attribute((__visibility__("default"))) {
# 118
using ::div_t;
# 119
using ::ldiv_t;
# 121
using ::abort;
# 122
using ::abs;
# 123
using ::atexit;
# 129
using ::atof;
# 130
using ::atoi;
# 131
using ::atol;
# 132
using ::bsearch;
# 133
using ::calloc;
# 134
using ::div;
# 135
using ::exit;
# 136
using ::free;
# 137
using ::getenv;
# 138
using ::labs;
# 139
using ::ldiv;
# 140
using ::malloc;
# 142
using ::mblen;
# 143
using ::mbstowcs;
# 144
using ::mbtowc;
# 146
using ::qsort;
# 152
using ::rand;
# 153
using ::realloc;
# 154
using ::srand;
# 155
using ::strtod;
# 156
using ::strtol;
# 157
using ::strtoul;
# 158
using ::system;
# 160
using ::wcstombs;
# 161
using ::wctomb;
# 166
inline long abs(long __i) { return __builtin_labs(__i); }
# 169
inline ldiv_t div(long __i, long __j) { return ldiv(__i, __j); }
# 174
inline long long abs(long long __x) { return __builtin_llabs(__x); }
# 179
inline __int128_t abs(__int128_t __x) { return (__x >= (0)) ? __x : (-__x); }
# 183
}
# 196 "/usr/include/c++/4.8.2/cstdlib" 3
namespace __gnu_cxx __attribute((__visibility__("default"))) {
# 201
using ::lldiv_t;
# 207
using ::_Exit;
# 211
using ::llabs;
# 214
inline lldiv_t div(long long __n, long long __d)
# 215
{ lldiv_t __q; (__q.quot) = (__n / __d); (__q.rem) = (__n % __d); return __q; }
# 217
using ::lldiv;
# 228 "/usr/include/c++/4.8.2/cstdlib" 3
using ::atoll;
# 229
using ::strtoll;
# 230
using ::strtoull;
# 232
using ::strtof;
# 233
using ::strtold;
# 236
}
# 238
namespace std {
# 241
using __gnu_cxx::lldiv_t;
# 243
using __gnu_cxx::_Exit;
# 245
using __gnu_cxx::llabs;
# 246
using __gnu_cxx::div;
# 247
using __gnu_cxx::lldiv;
# 249
using __gnu_cxx::atoll;
# 250
using __gnu_cxx::strtof;
# 251
using __gnu_cxx::strtoll;
# 252
using __gnu_cxx::strtoull;
# 253
using __gnu_cxx::strtold;
# 254
}
# 8984 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
__attribute((always_inline)) inline int signbit(float x);
# 8988
__attribute((always_inline)) inline int signbit(double x);
# 8990
__attribute((always_inline)) inline int signbit(long double x);
# 8992
__attribute((always_inline)) inline int isfinite(float x);
# 8996
__attribute((always_inline)) inline int isfinite(double x);
# 8998
__attribute((always_inline)) inline int isfinite(long double x);
# 9005
__attribute((always_inline)) inline int isnan(float x);
# 9013
extern "C" __attribute((always_inline)) inline int isnan(double x) throw();
# 9018
__attribute((always_inline)) inline int isnan(long double x);
# 9026
__attribute((always_inline)) inline int isinf(float x);
# 9035 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern "C" __attribute((always_inline)) inline int isinf(double x) throw();
# 9040
__attribute((always_inline)) inline int isinf(long double x);
# 9098 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
namespace std {
# 9100
template< class T> extern T __pow_helper(T, int);
# 9101
template< class T> extern T __cmath_power(T, unsigned);
# 9102
}
# 9104
using std::abs;
# 9105
using std::fabs;
# 9106
using std::ceil;
# 9107
using std::floor;
# 9108
using std::sqrt;
# 9110
using std::pow;
# 9112
using std::log;
# 9113
using std::log10;
# 9114
using std::fmod;
# 9115
using std::modf;
# 9116
using std::exp;
# 9117
using std::frexp;
# 9118
using std::ldexp;
# 9119
using std::asin;
# 9120
using std::sin;
# 9121
using std::sinh;
# 9122
using std::acos;
# 9123
using std::cos;
# 9124
using std::cosh;
# 9125
using std::atan;
# 9126
using std::atan2;
# 9127
using std::tan;
# 9128
using std::tanh;
# 9493 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
namespace std {
# 9502 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern inline long long abs(long long);
# 9512 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern inline long abs(long);
# 9513
extern inline float abs(float);
# 9514
extern inline double abs(double);
# 9515
extern inline float fabs(float);
# 9516
extern inline float ceil(float);
# 9517
extern inline float floor(float);
# 9518
extern inline float sqrt(float);
# 9519
extern inline float pow(float, float);
# 9528 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
extern inline float pow(float, int);
# 9529
extern inline double pow(double, int);
# 9534
extern inline float log(float);
# 9535
extern inline float log10(float);
# 9536
extern inline float fmod(float, float);
# 9537
extern inline float modf(float, float *);
# 9538
extern inline float exp(float);
# 9539
extern inline float frexp(float, int *);
# 9540
extern inline float ldexp(float, int);
# 9541
extern inline float asin(float);
# 9542
extern inline float sin(float);
# 9543
extern inline float sinh(float);
# 9544
extern inline float acos(float);
# 9545
extern inline float cos(float);
# 9546
extern inline float cosh(float);
# 9547
extern inline float atan(float);
# 9548
extern inline float atan2(float, float);
# 9549
extern inline float tan(float);
# 9550
extern inline float tanh(float);
# 9624 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
}
# 9761 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
static inline float logb(float a);
# 9763
static inline int ilogb(float a);
# 9765
static inline float scalbn(float a, int b);
# 9767
static inline float scalbln(float a, long b);
# 9769
static inline float exp2(float a);
# 9771
static inline float expm1(float a);
# 9773
static inline float log2(float a);
# 9775
static inline float log1p(float a);
# 9777
static inline float acosh(float a);
# 9779
static inline float asinh(float a);
# 9781
static inline float atanh(float a);
# 9783
static inline float hypot(float a, float b);
# 9785
static inline float cbrt(float a);
# 9787
static inline float erf(float a);
# 9789
static inline float erfc(float a);
# 9791
static inline float lgamma(float a);
# 9793
static inline float tgamma(float a);
# 9795
static inline float copysign(float a, float b);
# 9797
static inline float nextafter(float a, float b);
# 9799
static inline float remainder(float a, float b);
# 9801
static inline float remquo(float a, float b, int * quo);
# 9803
static inline float round(float a);
# 9805
static inline long lround(float a);
# 9807
static inline long long llround(float a);
# 9809
static inline float trunc(float a);
# 9811
static inline float rint(float a);
# 9813
static inline long lrint(float a);
# 9815
static inline long long llrint(float a);
# 9817
static inline float nearbyint(float a);
# 9819
static inline float fdim(float a, float b);
# 9821
static inline float fma(float a, float b, float c);
# 9823
static inline float fmax(float a, float b);
# 9825
static inline float fmin(float a, float b);
# 9864 "/usr/local/cuda-10.1/include/crt/math_functions.h" 3
static inline float exp10(float a);
# 9866
static inline float rsqrt(float a);
# 9868
static inline float rcbrt(float a);
# 9870
static inline float sinpi(float a);
# 9872
static inline float cospi(float a);
# 9874
static inline void sincospi(float a, float * sptr, float * cptr);
# 9876
static inline void sincos(float a, float * sptr, float * cptr);
# 9878
static inline float j0(float a);
# 9880
static inline float j1(float a);
# 9882
static inline float jn(int n, float a);
# 9884
static inline float y0(float a);
# 9886
static inline float y1(float a);
# 9888
static inline float yn(int n, float a);
# 9890
static inline float cyl_bessel_i0(float a);
# 9892
static inline float cyl_bessel_i1(float a);
# 9894
static inline float erfinv(float a);
# 9896
static inline float erfcinv(float a);
# 9898
static inline float normcdfinv(float a);
# 9900
static inline float normcdf(float a);
# 9902
static inline float erfcx(float a);
# 9904
static inline double copysign(double a, float b);
# 9906
static inline double copysign(float a, double b);
# 9908
static inline unsigned min(unsigned a, unsigned b);
# 9910
static inline unsigned min(int a, unsigned b);
# 9912
static inline unsigned min(unsigned a, int b);
# 9914
static inline long min(long a, long b);
# 9916
static inline unsigned long min(unsigned long a, unsigned long b);
# 9918
static inline unsigned long min(long a, unsigned long b);
# 9920
static inline unsigned long min(unsigned long a, long b);
# 9922
static inline long long min(long long a, long long b);
# 9924
static inline unsigned long long min(unsigned long long a, unsigned long long b);
# 9926
static inline unsigned long long min(long long a, unsigned long long b);
# 9928
static inline unsigned long long min(unsigned long long a, long long b);
# 9930
static inline float min(float a, float b);
# 9932
static inline double min(double a, double b);
# 9934
static inline double min(float a, double b);
# 9936
static inline double min(double a, float b);
# 9938
static inline unsigned max(unsigned a, unsigned b);
# 9940
static inline unsigned max(int a, unsigned b);
# 9942
static inline unsigned max(unsigned a, int b);
# 9944
static inline long max(long a, long b);
# 9946
static inline unsigned long max(unsigned long a, unsigned long b);
# 9948
static inline unsigned long max(long a, unsigned long b);
# 9950
static inline unsigned long max(unsigned long a, long b);
# 9952
static inline long long max(long long a, long long b);
# 9954
static inline unsigned long long max(unsigned long long a, unsigned long long b);
# 9956
static inline unsigned long long max(long long a, unsigned long long b);
# 9958
static inline unsigned long long max(unsigned long long a, long long b);
# 9960
static inline float max(float a, float b);
# 9962
static inline double max(double a, double b);
# 9964
static inline double max(float a, double b);
# 9966
static inline double max(double a, float b);
# 327 "/usr/local/cuda-10.1/include/crt/math_functions.hpp" 3
__attribute((always_inline)) inline int signbit(float x) { return __signbitf(x); }
# 331
__attribute((always_inline)) inline int signbit(double x) { return __signbit(x); }
# 333
__attribute((always_inline)) inline int signbit(long double x) { return __signbitl(x); }
# 344 "/usr/local/cuda-10.1/include/crt/math_functions.hpp" 3
__attribute((always_inline)) inline int isfinite(float x) { return __finitef(x); }
# 359 "/usr/local/cuda-10.1/include/crt/math_functions.hpp" 3
__attribute((always_inline)) inline int isfinite(double x) { return __finite(x); }
# 372 "/usr/local/cuda-10.1/include/crt/math_functions.hpp" 3
__attribute((always_inline)) inline int isfinite(long double x) { return __finitel(x); }
# 375
__attribute((always_inline)) inline int isnan(float x) { return __isnanf(x); }
# 379
__attribute((always_inline)) inline int isnan(double x) throw() { return __isnan(x); }
# 381
__attribute((always_inline)) inline int isnan(long double x) { return __isnanl(x); }
# 383
__attribute((always_inline)) inline int isinf(float x) { return __isinff(x); }
# 387
__attribute((always_inline)) inline int isinf(double x) throw() { return __isinf(x); }
# 389
__attribute((always_inline)) inline int isinf(long double x) { return __isinfl(x); }
# 585 "/usr/local/cuda-10.1/include/crt/math_functions.hpp" 3
static inline float logb(float a)
# 586
{
# 587
return logbf(a);
# 588
}
# 590
static inline int ilogb(float a)
# 591
{
# 592
return ilogbf(a);
# 593
}
# 595
static inline float scalbn(float a, int b)
# 596
{
# 597
return scalbnf(a, b);
# 598
}
# 600
static inline float scalbln(float a, long b)
# 601
{
# 602
return scalblnf(a, b);
# 603
}
# 605
static inline float exp2(float a)
# 606
{
# 607
return exp2f(a);
# 608
}
# 610
static inline float expm1(float a)
# 611
{
# 612
return expm1f(a);
# 613
}
# 615
static inline float log2(float a)
# 616
{
# 617
return log2f(a);
# 618
}
# 620
static inline float log1p(float a)
# 621
{
# 622
return log1pf(a);
# 623
}
# 625
static inline float acosh(float a)
# 626
{
# 627
return acoshf(a);
# 628
}
# 630
static inline float asinh(float a)
# 631
{
# 632
return asinhf(a);
# 633
}
# 635
static inline float atanh(float a)
# 636
{
# 637
return atanhf(a);
# 638
}
# 640
static inline float hypot(float a, float b)
# 641
{
# 642
return hypotf(a, b);
# 643
}
# 645
static inline float cbrt(float a)
# 646
{
# 647
return cbrtf(a);
# 648
}
# 650
static inline float erf(float a)
# 651
{
# 652
return erff(a);
# 653
}
# 655
static inline float erfc(float a)
# 656
{
# 657
return erfcf(a);
# 658
}
# 660
static inline float lgamma(float a)
# 661
{
# 662
return lgammaf(a);
# 663
}
# 665
static inline float tgamma(float a)
# 666
{
# 667
return tgammaf(a);
# 668
}
# 670
static inline float copysign(float a, float b)
# 671
{
# 672
return copysignf(a, b);
# 673
}
# 675
static inline float nextafter(float a, float b)
# 676
{
# 677
return nextafterf(a, b);
# 678
}
# 680
static inline float remainder(float a, float b)
# 681
{
# 682
return remainderf(a, b);
# 683
}
# 685
static inline float remquo(float a, float b, int *quo)
# 686
{
# 687
return remquof(a, b, quo);
# 688
}
# 690
static inline float round(float a)
# 691
{
# 692
return roundf(a);
# 693
}
# 695
static inline long lround(float a)
# 696
{
# 697
return lroundf(a);
# 698
}
# 700
static inline long long llround(float a)
# 701
{
# 702
return llroundf(a);
# 703
}
# 705
static inline float trunc(float a)
# 706
{
# 707
return truncf(a);
# 708
}
# 710
static inline float rint(float a)
# 711
{
# 712
return rintf(a);
# 713
}
# 715
static inline long lrint(float a)
# 716
{
# 717
return lrintf(a);
# 718
}
# 720
static inline long long llrint(float a)
# 721
{
# 722
return llrintf(a);
# 723
}
# 725
static inline float nearbyint(float a)
# 726
{
# 727
return nearbyintf(a);
# 728
}
# 730
static inline float fdim(float a, float b)
# 731
{
# 732
return fdimf(a, b);
# 733
}
# 735
static inline float fma(float a, float b, float c)
# 736
{
# 737
return fmaf(a, b, c);
# 738
}
# 740
static inline float fmax(float a, float b)
# 741
{
# 742
return fmaxf(a, b);
# 743
}
# 745
static inline float fmin(float a, float b)
# 746
{
# 747
return fminf(a, b);
# 748
}
# 756
static inline float exp10(float a)
# 757
{
# 758
return exp10f(a);
# 759
}
# 761
static inline float rsqrt(float a)
# 762
{
# 763
return rsqrtf(a);
# 764
}
# 766
static inline float rcbrt(float a)
# 767
{
# 768
return rcbrtf(a);
# 769
}
# 771
static inline float sinpi(float a)
# 772
{
# 773
return sinpif(a);
# 774
}
# 776
static inline float cospi(float a)
# 777
{
# 778
return cospif(a);
# 779
}
# 781
static inline void sincospi(float a, float *sptr, float *cptr)
# 782
{
# 783
sincospif(a, sptr, cptr);
# 784
}
# 786
static inline void sincos(float a, float *sptr, float *cptr)
# 787
{
# 788
sincosf(a, sptr, cptr);
# 789
}
# 791
static inline float j0(float a)
# 792
{
# 793
return j0f(a);
# 794
}
# 796
static inline float j1(float a)
# 797
{
# 798
return j1f(a);
# 799
}
# 801
static inline float jn(int n, float a)
# 802
{
# 803
return jnf(n, a);
# 804
}
# 806
static inline float y0(float a)
# 807
{
# 808
return y0f(a);
# 809
}
# 811
static inline float y1(float a)
# 812
{
# 813
return y1f(a);
# 814
}
# 816
static inline float yn(int n, float a)
# 817
{
# 818
return ynf(n, a);
# 819
}
# 821
static inline float cyl_bessel_i0(float a)
# 822
{
# 823
return cyl_bessel_i0f(a);
# 824
}
# 826
static inline float cyl_bessel_i1(float a)
# 827
{
# 828
return cyl_bessel_i1f(a);
# 829
}
# 831
static inline float erfinv(float a)
# 832
{
# 833
return erfinvf(a);
# 834
}
# 836
static inline float erfcinv(float a)
# 837
{
# 838
return erfcinvf(a);
# 839
}
# 841
static inline float normcdfinv(float a)
# 842
{
# 843
return normcdfinvf(a);
# 844
}
# 846
static inline float normcdf(float a)
# 847
{
# 848
return normcdff(a);
# 849
}
# 851
static inline float erfcx(float a)
# 852
{
# 853
return erfcxf(a);
# 854
}
# 856
static inline double copysign(double a, float b)
# 857
{
# 858
return copysign(a, (double)b);
# 859
}
# 861
static inline double copysign(float a, double b)
# 862
{
# 863
return copysign((double)a, b);
# 864
}
# 866
static inline unsigned min(unsigned a, unsigned b)
# 867
{
# 868
return umin(a, b);
# 869
}
# 871
static inline unsigned min(int a, unsigned b)
# 872
{
# 873
return umin((unsigned)a, b);
# 874
}
# 876
static inline unsigned min(unsigned a, int b)
# 877
{
# 878
return umin(a, (unsigned)b);
# 879
}
# 881
static inline long min(long a, long b)
# 882
{
# 888
if (sizeof(long) == sizeof(int)) {
# 892
return (long)min((int)a, (int)b);
# 893
} else {
# 894
return (long)llmin((long long)a, (long long)b);
# 895
}
# 896
}
# 898
static inline unsigned long min(unsigned long a, unsigned long b)
# 899
{
# 903
if (sizeof(unsigned long) == sizeof(unsigned)) {
# 907
return (unsigned long)umin((unsigned)a, (unsigned)b);
# 908
} else {
# 909
return (unsigned long)ullmin((unsigned long long)a, (unsigned long long)b);
# 910
}
# 911
}
# 913
static inline unsigned long min(long a, unsigned long b)
# 914
{
# 918
if (sizeof(unsigned long) == sizeof(unsigned)) {
# 922
return (unsigned long)umin((unsigned)a, (unsigned)b);
# 923
} else {
# 924
return (unsigned long)ullmin((unsigned long long)a, (unsigned long long)b);
# 925
}
# 926
}
# 928
static inline unsigned long min(unsigned long a, long b)
# 929
{
# 933
if (sizeof(unsigned long) == sizeof(unsigned)) {
# 937
return (unsigned long)umin((unsigned)a, (unsigned)b);
# 938
} else {
# 939
return (unsigned long)ullmin((unsigned long long)a, (unsigned long long)b);
# 940
}
# 941
}
# 943
static inline long long min(long long a, long long b)
# 944
{
# 945
return llmin(a, b);
# 946
}
# 948
static inline unsigned long long min(unsigned long long a, unsigned long long b)
# 949
{
# 950
return ullmin(a, b);
# 951
}
# 953
static inline unsigned long long min(long long a, unsigned long long b)
# 954
{
# 955
return ullmin((unsigned long long)a, b);
# 956
}
# 958
static inline unsigned long long min(unsigned long long a, long long b)
# 959
{
# 960
return ullmin(a, (unsigned long long)b);
# 961
}
# 963
static inline float min(float a, float b)
# 964
{
# 965
return fminf(a, b);
# 966
}
# 968
static inline double min(double a, double b)
# 969
{
# 970
return fmin(a, b);
# 971
}
# 973
static inline double min(float a, double b)
# 974
{
# 975
return fmin((double)a, b);
# 976
}
# 978
static inline double min(double a, float b)
# 979
{
# 980
return fmin(a, (double)b);
# 981
}
# 983
static inline unsigned max(unsigned a, unsigned b)
# 984
{
# 985
return umax(a, b);
# 986
}
# 988
static inline unsigned max(int a, unsigned b)
# 989
{
# 990
return umax((unsigned)a, b);
# 991
}
# 993
static inline unsigned max(unsigned a, int b)
# 994
{
# 995
return umax(a, (unsigned)b);
# 996
}
# 998
static inline long max(long a, long b)
# 999
{
# 1004
if (sizeof(long) == sizeof(int)) {
# 1008
return (long)max((int)a, (int)b);
# 1009
} else {
# 1010
return (long)llmax((long long)a, (long long)b);
# 1011
}
# 1012
}
# 1014
static inline unsigned long max(unsigned long a, unsigned long b)
# 1015
{
# 1019
if (sizeof(unsigned long) == sizeof(unsigned)) {
# 1023
return (unsigned long)umax((unsigned)a, (unsigned)b);
# 1024
} else {
# 1025
return (unsigned long)ullmax((unsigned long long)a, (unsigned long long)b);
# 1026
}
# 1027
}
# 1029
static inline unsigned long max(long a, unsigned long b)
# 1030
{
# 1034
if (sizeof(unsigned long) == sizeof(unsigned)) {
# 1038
return (unsigned long)umax((unsigned)a, (unsigned)b);
# 1039
} else {
# 1040
return (unsigned long)ullmax((unsigned long long)a, (unsigned long long)b);
# 1041
}
# 1042
}
# 1044
static inline unsigned long max(unsigned long a, long b)
# 1045
{
# 1049
if (sizeof(unsigned long) == sizeof(unsigned)) {
# 1053
return (unsigned long)umax((unsigned)a, (unsigned)b);
# 1054
} else {
# 1055
return (unsigned long)ullmax((unsigned long long)a, (unsigned long long)b);
# 1056
}
# 1057
}
# 1059
static inline long long max(long long a, long long b)
# 1060
{
# 1061
return llmax(a, b);
# 1062
}
# 1064
static inline unsigned long long max(unsigned long long a, unsigned long long b)
# 1065
{
# 1066
return ullmax(a, b);
# 1067
}
# 1069
static inline unsigned long long max(long long a, unsigned long long b)
# 1070
{
# 1071
return ullmax((unsigned long long)a, b);
# 1072
}
# 1074
static inline unsigned long long max(unsigned long long a, long long b)
# 1075
{
# 1076
return ullmax(a, (unsigned long long)b);
# 1077
}
# 1079
static inline float max(float a, float b)
# 1080
{
# 1081
return fmaxf(a, b);
# 1082
}
# 1084
static inline double max(double a, double b)
# 1085
{
# 1086
return fmax(a, b);
# 1087
}
# 1089
static inline double max(float a, double b)
# 1090
{
# 1091
return fmax((double)a, b);
# 1092
}
# 1094
static inline double max(double a, float b)
# 1095
{
# 1096
return fmax(a, (double)b);
# 1097
}
# 1108 "/usr/local/cuda-10.1/include/crt/math_functions.hpp" 3
inline int min(int a, int b)
# 1109
{
# 1110
return (a < b) ? a : b;
# 1111
}
# 1113
inline unsigned umin(unsigned a, unsigned b)
# 1114
{
# 1115
return (a < b) ? a : b;
# 1116
}
# 1118
inline long long llmin(long long a, long long b)
# 1119
{
# 1120
return (a < b) ? a : b;
# 1121
}
# 1123
inline unsigned long long ullmin(unsigned long long a, unsigned long long
# 1124
b)
# 1125
{
# 1126
return (a < b) ? a : b;
# 1127
}
# 1129
inline int max(int a, int b)
# 1130
{
# 1131
return (a > b) ? a : b;
# 1132
}
# 1134
inline unsigned umax(unsigned a, unsigned b)
# 1135
{
# 1136
return (a > b) ? a : b;
# 1137
}
# 1139
inline long long llmax(long long a, long long b)
# 1140
{
# 1141
return (a > b) ? a : b;
# 1142
}
# 1144
inline unsigned long long ullmax(unsigned long long a, unsigned long long
# 1145
b)
# 1146
{
# 1147
return (a > b) ? a : b;
# 1148
}
# 74 "/usr/local/cuda-10.1/include/cuda_surface_types.h" 3
template< class T, int dim = 1>
# 75
struct surface : public surfaceReference {
# 78
surface()
# 79
{
# 80
(channelDesc) = cudaCreateChannelDesc< T> ();
# 81
}
# 83
surface(cudaChannelFormatDesc desc)
# 84
{
# 85
(channelDesc) = desc;
# 86
}
# 88
};
# 90
template< int dim>
# 91
struct surface< void, dim> : public surfaceReference {
# 94
surface()
# 95
{
# 96
(channelDesc) = cudaCreateChannelDesc< void> ();
# 97
}
# 99
};
# 74 "/usr/local/cuda-10.1/include/cuda_texture_types.h" 3
template< class T, int texType = 1, cudaTextureReadMode mode = cudaReadModeElementType>
# 75
struct texture : public textureReference {
# 78
texture(int norm = 0, cudaTextureFilterMode
# 79
fMode = cudaFilterModePoint, cudaTextureAddressMode
# 80
aMode = cudaAddressModeClamp)
# 81
{
# 82
(normalized) = norm;
# 83
(filterMode) = fMode;
# 84
((addressMode)[0]) = aMode;
# 85
((addressMode)[1]) = aMode;
# 86
((addressMode)[2]) = aMode;
# 87
(channelDesc) = cudaCreateChannelDesc< T> ();
# 88
(sRGB) = 0;
# 89
}
# 91
texture(int norm, cudaTextureFilterMode
# 92
fMode, cudaTextureAddressMode
# 93
aMode, cudaChannelFormatDesc
# 94
desc)
# 95
{
# 96
(normalized) = norm;
# 97
(filterMode) = fMode;
# 98
((addressMode)[0]) = aMode;
# 99
((addressMode)[1]) = aMode;
# 100
((addressMode)[2]) = aMode;
# 101
(channelDesc) = desc;
# 102
(sRGB) = 0;
# 103
}
# 105
};
# 89 "/usr/local/cuda-10.1/include/crt/device_functions.h" 3
extern "C" {
# 3217 "/usr/local/cuda-10.1/include/crt/device_functions.h" 3
}
# 3225
__attribute__((unused)) static inline int mulhi(int a, int b);
# 3227
__attribute__((unused)) static inline unsigned mulhi(unsigned a, unsigned b);
# 3229
__attribute__((unused)) static inline unsigned mulhi(int a, unsigned b);
# 3231
__attribute__((unused)) static inline unsigned mulhi(unsigned a, int b);
# 3233
__attribute__((unused)) static inline long long mul64hi(long long a, long long b);
# 3235
__attribute__((unused)) static inline unsigned long long mul64hi(unsigned long long a, unsigned long long b);
# 3237
__attribute__((unused)) static inline unsigned long long mul64hi(long long a, unsigned long long b);
# 3239
__attribute__((unused)) static inline unsigned long long mul64hi(unsigned long long a, long long b);
# 3241
__attribute__((unused)) static inline int float_as_int(float a);
# 3243
__attribute__((unused)) static inline float int_as_float(int a);
# 3245
__attribute__((unused)) static inline unsigned float_as_uint(float a);
# 3247
__attribute__((unused)) static inline float uint_as_float(unsigned a);
# 3249
__attribute__((unused)) static inline float saturate(float a);
# 3251
__attribute__((unused)) static inline int mul24(int a, int b);
# 3253
__attribute__((unused)) static inline unsigned umul24(unsigned a, unsigned b);
# 3255
__attribute__((unused)) static inline int float2int(float a, cudaRoundMode mode = cudaRoundZero);
# 3257
__attribute__((unused)) static inline unsigned float2uint(float a, cudaRoundMode mode = cudaRoundZero);
# 3259
__attribute__((unused)) static inline float int2float(int a, cudaRoundMode mode = cudaRoundNearest);
# 3261
__attribute__((unused)) static inline float uint2float(unsigned a, cudaRoundMode mode = cudaRoundNearest);
# 90 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline int mulhi(int a, int b)
# 91
{int volatile ___ = 1;(void)a;(void)b;
# 93
::exit(___);}
#if 0
# 91
{
# 92
return __mulhi(a, b);
# 93
}
#endif
# 95 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline unsigned mulhi(unsigned a, unsigned b)
# 96
{int volatile ___ = 1;(void)a;(void)b;
# 98
::exit(___);}
#if 0
# 96
{
# 97
return __umulhi(a, b);
# 98
}
#endif
# 100 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline unsigned mulhi(int a, unsigned b)
# 101
{int volatile ___ = 1;(void)a;(void)b;
# 103
::exit(___);}
#if 0
# 101
{
# 102
return __umulhi((unsigned)a, b);
# 103
}
#endif
# 105 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline unsigned mulhi(unsigned a, int b)
# 106
{int volatile ___ = 1;(void)a;(void)b;
# 108
::exit(___);}
#if 0
# 106
{
# 107
return __umulhi(a, (unsigned)b);
# 108
}
#endif
# 110 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline long long mul64hi(long long a, long long b)
# 111
{int volatile ___ = 1;(void)a;(void)b;
# 113
::exit(___);}
#if 0
# 111
{
# 112
return __mul64hi(a, b);
# 113
}
#endif
# 115 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline unsigned long long mul64hi(unsigned long long a, unsigned long long b)
# 116
{int volatile ___ = 1;(void)a;(void)b;
# 118
::exit(___);}
#if 0
# 116
{
# 117
return __umul64hi(a, b);
# 118
}
#endif
# 120 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline unsigned long long mul64hi(long long a, unsigned long long b)
# 121
{int volatile ___ = 1;(void)a;(void)b;
# 123
::exit(___);}
#if 0
# 121
{
# 122
return __umul64hi((unsigned long long)a, b);
# 123
}
#endif
# 125 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline unsigned long long mul64hi(unsigned long long a, long long b)
# 126
{int volatile ___ = 1;(void)a;(void)b;
# 128
::exit(___);}
#if 0
# 126
{
# 127
return __umul64hi(a, (unsigned long long)b);
# 128
}
#endif
# 130 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline int float_as_int(float a)
# 131
{int volatile ___ = 1;(void)a;
# 133
::exit(___);}
#if 0
# 131
{
# 132
return __float_as_int(a);
# 133
}
#endif
# 135 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline float int_as_float(int a)
# 136
{int volatile ___ = 1;(void)a;
# 138
::exit(___);}
#if 0
# 136
{
# 137
return __int_as_float(a);
# 138
}
#endif
# 140 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline unsigned float_as_uint(float a)
# 141
{int volatile ___ = 1;(void)a;
# 143
::exit(___);}
#if 0
# 141
{
# 142
return __float_as_uint(a);
# 143
}
#endif
# 145 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline float uint_as_float(unsigned a)
# 146
{int volatile ___ = 1;(void)a;
# 148
::exit(___);}
#if 0
# 146
{
# 147
return __uint_as_float(a);
# 148
}
#endif
# 149 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline float saturate(float a)
# 150
{int volatile ___ = 1;(void)a;
# 152
::exit(___);}
#if 0
# 150
{
# 151
return __saturatef(a);
# 152
}
#endif
# 154 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline int mul24(int a, int b)
# 155
{int volatile ___ = 1;(void)a;(void)b;
# 157
::exit(___);}
#if 0
# 155
{
# 156
return __mul24(a, b);
# 157
}
#endif
# 159 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline unsigned umul24(unsigned a, unsigned b)
# 160
{int volatile ___ = 1;(void)a;(void)b;
# 162
::exit(___);}
#if 0
# 160
{
# 161
return __umul24(a, b);
# 162
}
#endif
# 164 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline int float2int(float a, cudaRoundMode mode)
# 165
{int volatile ___ = 1;(void)a;(void)mode;
# 170
::exit(___);}
#if 0
# 165
{
# 166
return (mode == (cudaRoundNearest)) ? __float2int_rn(a) : ((mode == (cudaRoundPosInf)) ? __float2int_ru(a) : ((mode == (cudaRoundMinInf)) ? __float2int_rd(a) : __float2int_rz(a)));
# 170
}
#endif
# 172 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline unsigned float2uint(float a, cudaRoundMode mode)
# 173
{int volatile ___ = 1;(void)a;(void)mode;
# 178
::exit(___);}
#if 0
# 173
{
# 174
return (mode == (cudaRoundNearest)) ? __float2uint_rn(a) : ((mode == (cudaRoundPosInf)) ? __float2uint_ru(a) : ((mode == (cudaRoundMinInf)) ? __float2uint_rd(a) : __float2uint_rz(a)));
# 178
}
#endif
# 180 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline float int2float(int a, cudaRoundMode mode)
# 181
{int volatile ___ = 1;(void)a;(void)mode;
# 186
::exit(___);}
#if 0
# 181
{
# 182
return (mode == (cudaRoundZero)) ? __int2float_rz(a) : ((mode == (cudaRoundPosInf)) ? __int2float_ru(a) : ((mode == (cudaRoundMinInf)) ? __int2float_rd(a) : __int2float_rn(a)));
# 186
}
#endif
# 188 "/usr/local/cuda-10.1/include/crt/device_functions.hpp" 3
__attribute__((unused)) static inline float uint2float(unsigned a, cudaRoundMode mode)
# 189
{int volatile ___ = 1;(void)a;(void)mode;
# 194
::exit(___);}
#if 0
# 189
{
# 190
return (mode == (cudaRoundZero)) ? __uint2float_rz(a) : ((mode == (cudaRoundPosInf)) ? __uint2float_ru(a) : ((mode == (cudaRoundMinInf)) ? __uint2float_rd(a) : __uint2float_rn(a)));
# 194
}
#endif
# 106 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicAdd(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 106
{ }
#endif
# 108 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicAdd(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 108
{ }
#endif
# 110 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicSub(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 110
{ }
#endif
# 112 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicSub(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 112
{ }
#endif
# 114 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicExch(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 114
{ }
#endif
# 116 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicExch(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 116
{ }
#endif
# 118 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline float atomicExch(float *address, float val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 118
{ }
#endif
# 120 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicMin(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 120
{ }
#endif
# 122 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicMin(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 122
{ }
#endif
# 124 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicMax(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 124
{ }
#endif
# 126 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicMax(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 126
{ }
#endif
# 128 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicInc(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 128
{ }
#endif
# 130 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicDec(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 130
{ }
#endif
# 132 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicAnd(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 132
{ }
#endif
# 134 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicAnd(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 134
{ }
#endif
# 136 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicOr(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 136
{ }
#endif
# 138 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicOr(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 138
{ }
#endif
# 140 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicXor(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 140
{ }
#endif
# 142 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicXor(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 142
{ }
#endif
# 144 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicCAS(int *address, int compare, int val) {int volatile ___ = 1;(void)address;(void)compare;(void)val;::exit(___);}
#if 0
# 144
{ }
#endif
# 146 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicCAS(unsigned *address, unsigned compare, unsigned val) {int volatile ___ = 1;(void)address;(void)compare;(void)val;::exit(___);}
#if 0
# 146
{ }
#endif
# 171 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
extern "C" {
# 180
}
# 189 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicAdd(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 189
{ }
#endif
# 191 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicExch(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 191
{ }
#endif
# 193 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicCAS(unsigned long long *address, unsigned long long compare, unsigned long long val) {int volatile ___ = 1;(void)address;(void)compare;(void)val;::exit(___);}
#if 0
# 193
{ }
#endif
# 195 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute((deprecated("__any() is deprecated in favor of __any_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppr" "ess this warning)."))) __attribute__((unused)) static inline bool any(bool cond) {int volatile ___ = 1;(void)cond;::exit(___);}
#if 0
# 195
{ }
#endif
# 197 "/usr/local/cuda-10.1/include/device_atomic_functions.h" 3
__attribute((deprecated("__all() is deprecated in favor of __all_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppr" "ess this warning)."))) __attribute__((unused)) static inline bool all(bool cond) {int volatile ___ = 1;(void)cond;::exit(___);}
#if 0
# 197
{ }
#endif
# 87 "/usr/local/cuda-10.1/include/crt/device_double_functions.h" 3
extern "C" {
# 1139 "/usr/local/cuda-10.1/include/crt/device_double_functions.h" 3
}
# 1147
__attribute__((unused)) static inline double fma(double a, double b, double c, cudaRoundMode mode);
# 1149
__attribute__((unused)) static inline double dmul(double a, double b, cudaRoundMode mode = cudaRoundNearest);
# 1151
__attribute__((unused)) static inline double dadd(double a, double b, cudaRoundMode mode = cudaRoundNearest);
# 1153
__attribute__((unused)) static inline double dsub(double a, double b, cudaRoundMode mode = cudaRoundNearest);
# 1155
__attribute__((unused)) static inline int double2int(double a, cudaRoundMode mode = cudaRoundZero);
# 1157
__attribute__((unused)) static inline unsigned double2uint(double a, cudaRoundMode mode = cudaRoundZero);
# 1159
__attribute__((unused)) static inline long long double2ll(double a, cudaRoundMode mode = cudaRoundZero);
# 1161
__attribute__((unused)) static inline unsigned long long double2ull(double a, cudaRoundMode mode = cudaRoundZero);
# 1163
__attribute__((unused)) static inline double ll2double(long long a, cudaRoundMode mode = cudaRoundNearest);
# 1165
__attribute__((unused)) static inline double ull2double(unsigned long long a, cudaRoundMode mode = cudaRoundNearest);
# 1167
__attribute__((unused)) static inline double int2double(int a, cudaRoundMode mode = cudaRoundNearest);
# 1169
__attribute__((unused)) static inline double uint2double(unsigned a, cudaRoundMode mode = cudaRoundNearest);
# 1171
__attribute__((unused)) static inline double float2double(float a, cudaRoundMode mode = cudaRoundNearest);
# 93 "/usr/local/cuda-10.1/include/crt/device_double_functions.hpp" 3
__attribute__((unused)) static inline double fma(double a, double b, double c, cudaRoundMode mode)
# 94
{int volatile ___ = 1;(void)a;(void)b;(void)c;(void)mode;
# 99
::exit(___);}
#if 0
# 94
{
# 95
return (mode == (cudaRoundZero)) ? __fma_rz(a, b, c) : ((mode == (cudaRoundPosInf)) ? __fma_ru(a, b, c) : ((mode == (cudaRoundMinInf)) ? __fma_rd(a, b, c) : __fma_rn(a, b, c)));
# 99
}
#endif
# 101 "/usr/local/cuda-10.1/include/crt/device_double_functions.hpp" 3
__attribute__((unused)) static inline double dmul(double a, double b, cudaRoundMode mode)
# 102
{int volatile ___ = 1;(void)a;(void)b;(void)mode;
# 107
::exit(___);}
#if 0
# 102
{
# 103
return (mode == (cudaRoundZero)) ? __dmul_rz(a, b) : ((mode == (cudaRoundPosInf)) ? __dmul_ru(a, b) : ((mode == (cudaRoundMinInf)) ? __dmul_rd(a, b) : __dmul_rn(a, b)));
# 107
}
#endif
# 109 "/usr/local/cuda-10.1/include/crt/device_double_functions.hpp" 3
__attribute__((unused)) static inline double dadd(double a, double b, cudaRoundMode mode)
# 110
{int volatile ___ = 1;(void)a;(void)b;(void)mode;
# 115
::exit(___);}
#if 0
# 110
{
# 111
return (mode == (cudaRoundZero)) ? __dadd_rz(a, b) : ((mode == (cudaRoundPosInf)) ? __dadd_ru(a, b) : ((mode == (cudaRoundMinInf)) ? __dadd_rd(a, b) : __dadd_rn(a, b)));
# 115
}
#endif
# 117 "/usr/local/cuda-10.1/include/crt/device_double_functions.hpp" 3
__attribute__((unused)) static inline double dsub(double a, double b, cudaRoundMode mode)
# 118
{int volatile ___ = 1;(void)a;(void)b;(void)mode;
# 123
::exit(___);}
#if 0
# 118
{
# 119
return (mode == (cudaRoundZero)) ? __dsub_rz(a, b) : ((mode == (cudaRoundPosInf)) ? __dsub_ru(a, b) : ((mode == (cudaRoundMinInf)) ? __dsub_rd(a, b) : __dsub_rn(a, b)));
# 123
}
#endif
# 125 "/usr/local/cuda-10.1/include/crt/device_double_functions.hpp" 3
__attribute__((unused)) static inline int double2int(double a, cudaRoundMode mode)
# 126
{int volatile ___ = 1;(void)a;(void)mode;
# 131
::exit(___);}
#if 0
# 126
{
# 127
return (mode == (cudaRoundNearest)) ? __double2int_rn(a) : ((mode == (cudaRoundPosInf)) ? __double2int_ru(a) : ((mode == (cudaRoundMinInf)) ? __double2int_rd(a) : __double2int_rz(a)));
# 131
}
#endif
# 133 "/usr/local/cuda-10.1/include/crt/device_double_functions.hpp" 3
__attribute__((unused)) static inline unsigned double2uint(double a, cudaRoundMode mode)
# 134
{int volatile ___ = 1;(void)a;(void)mode;
# 139
::exit(___);}
#if 0
# 134
{
# 135
return (mode == (cudaRoundNearest)) ? __double2uint_rn(a) : ((mode == (cudaRoundPosInf)) ? __double2uint_ru(a) : ((mode == (cudaRoundMinInf)) ? __double2uint_rd(a) : __double2uint_rz(a)));
# 139
}
#endif
# 141 "/usr/local/cuda-10.1/include/crt/device_double_functions.hpp" 3
__attribute__((unused)) static inline long long double2ll(double a, cudaRoundMode mode)
# 142
{int volatile ___ = 1;(void)a;(void)mode;
# 147
::exit(___);}
#if 0
# 142
{
# 143
return (mode == (cudaRoundNearest)) ? __double2ll_rn(a) : ((mode == (cudaRoundPosInf)) ? __double2ll_ru(a) : ((mode == (cudaRoundMinInf)) ? __double2ll_rd(a) : __double2ll_rz(a)));
# 147
}
#endif
# 149 "/usr/local/cuda-10.1/include/crt/device_double_functions.hpp" 3
__attribute__((unused)) static inline unsigned long long double2ull(double a, cudaRoundMode mode)
# 150
{int volatile ___ = 1;(void)a;(void)mode;
# 155
::exit(___);}
#if 0
# 150
{
# 151
return (mode == (cudaRoundNearest)) ? __double2ull_rn(a) : ((mode == (cudaRoundPosInf)) ? __double2ull_ru(a) : ((mode == (cudaRoundMinInf)) ? __double2ull_rd(a) : __double2ull_rz(a)));
# 155
}
#endif
# 157 "/usr/local/cuda-10.1/include/crt/device_double_functions.hpp" 3
__attribute__((unused)) static inline double ll2double(long long a, cudaRoundMode mode)
# 158
{int volatile ___ = 1;(void)a;(void)mode;
# 163
::exit(___);}
#if 0
# 158
{
# 159
return (mode == (cudaRoundZero)) ? __ll2double_rz(a) : ((mode == (cudaRoundPosInf)) ? __ll2double_ru(a) : ((mode == (cudaRoundMinInf)) ? __ll2double_rd(a) : __ll2double_rn(a)));
# 163
}
#endif
# 165 "/usr/local/cuda-10.1/include/crt/device_double_functions.hpp" 3
__attribute__((unused)) static inline double ull2double(unsigned long long a, cudaRoundMode mode)
# 166
{int volatile ___ = 1;(void)a;(void)mode;
# 171
::exit(___);}
#if 0
# 166
{
# 167
return (mode == (cudaRoundZero)) ? __ull2double_rz(a) : ((mode == (cudaRoundPosInf)) ? __ull2double_ru(a) : ((mode == (cudaRoundMinInf)) ? __ull2double_rd(a) : __ull2double_rn(a)));
# 171
}
#endif
# 173 "/usr/local/cuda-10.1/include/crt/device_double_functions.hpp" 3
__attribute__((unused)) static inline double int2double(int a, cudaRoundMode mode)
# 174
{int volatile ___ = 1;(void)a;(void)mode;
# 176
::exit(___);}
#if 0
# 174
{
# 175
return (double)a;
# 176
}
#endif
# 178 "/usr/local/cuda-10.1/include/crt/device_double_functions.hpp" 3
__attribute__((unused)) static inline double uint2double(unsigned a, cudaRoundMode mode)
# 179
{int volatile ___ = 1;(void)a;(void)mode;
# 181
::exit(___);}
#if 0
# 179
{
# 180
return (double)a;
# 181
}
#endif
# 183 "/usr/local/cuda-10.1/include/crt/device_double_functions.hpp" 3
__attribute__((unused)) static inline double float2double(float a, cudaRoundMode mode)
# 184
{int volatile ___ = 1;(void)a;(void)mode;
# 186
::exit(___);}
#if 0
# 184
{
# 185
return (double)a;
# 186
}
#endif
# 89 "/usr/local/cuda-10.1/include/sm_20_atomic_functions.h" 3
__attribute__((unused)) static inline float atomicAdd(float *address, float val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 89
{ }
#endif
# 100 "/usr/local/cuda-10.1/include/sm_32_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicMin(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 100
{ }
#endif
# 102 "/usr/local/cuda-10.1/include/sm_32_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicMax(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 102
{ }
#endif
# 104 "/usr/local/cuda-10.1/include/sm_32_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicAnd(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 104
{ }
#endif
# 106 "/usr/local/cuda-10.1/include/sm_32_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicOr(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 106
{ }
#endif
# 108 "/usr/local/cuda-10.1/include/sm_32_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicXor(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 108
{ }
#endif
# 110 "/usr/local/cuda-10.1/include/sm_32_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicMin(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 110
{ }
#endif
# 112 "/usr/local/cuda-10.1/include/sm_32_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicMax(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 112
{ }
#endif
# 114 "/usr/local/cuda-10.1/include/sm_32_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicAnd(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 114
{ }
#endif
# 116 "/usr/local/cuda-10.1/include/sm_32_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicOr(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 116
{ }
#endif
# 118 "/usr/local/cuda-10.1/include/sm_32_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicXor(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 118
{ }
#endif
# 303 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline double atomicAdd(double *address, double val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 303
{ }
#endif
# 306 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicAdd_block(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 306
{ }
#endif
# 309 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicAdd_system(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 309
{ }
#endif
# 312 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicAdd_block(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 312
{ }
#endif
# 315 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicAdd_system(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 315
{ }
#endif
# 318 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicAdd_block(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 318
{ }
#endif
# 321 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicAdd_system(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 321
{ }
#endif
# 324 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline float atomicAdd_block(float *address, float val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 324
{ }
#endif
# 327 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline float atomicAdd_system(float *address, float val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 327
{ }
#endif
# 330 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline double atomicAdd_block(double *address, double val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 330
{ }
#endif
# 333 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline double atomicAdd_system(double *address, double val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 333
{ }
#endif
# 336 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicSub_block(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 336
{ }
#endif
# 339 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicSub_system(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 339
{ }
#endif
# 342 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicSub_block(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 342
{ }
#endif
# 345 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicSub_system(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 345
{ }
#endif
# 348 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicExch_block(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 348
{ }
#endif
# 351 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicExch_system(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 351
{ }
#endif
# 354 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicExch_block(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 354
{ }
#endif
# 357 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicExch_system(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 357
{ }
#endif
# 360 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicExch_block(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 360
{ }
#endif
# 363 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicExch_system(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 363
{ }
#endif
# 366 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline float atomicExch_block(float *address, float val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 366
{ }
#endif
# 369 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline float atomicExch_system(float *address, float val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 369
{ }
#endif
# 372 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicMin_block(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 372
{ }
#endif
# 375 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicMin_system(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 375
{ }
#endif
# 378 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicMin_block(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 378
{ }
#endif
# 381 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicMin_system(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 381
{ }
#endif
# 384 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicMin_block(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 384
{ }
#endif
# 387 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicMin_system(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 387
{ }
#endif
# 390 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicMin_block(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 390
{ }
#endif
# 393 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicMin_system(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 393
{ }
#endif
# 396 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicMax_block(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 396
{ }
#endif
# 399 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicMax_system(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 399
{ }
#endif
# 402 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicMax_block(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 402
{ }
#endif
# 405 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicMax_system(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 405
{ }
#endif
# 408 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicMax_block(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 408
{ }
#endif
# 411 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicMax_system(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 411
{ }
#endif
# 414 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicMax_block(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 414
{ }
#endif
# 417 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicMax_system(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 417
{ }
#endif
# 420 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicInc_block(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 420
{ }
#endif
# 423 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicInc_system(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 423
{ }
#endif
# 426 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicDec_block(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 426
{ }
#endif
# 429 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicDec_system(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 429
{ }
#endif
# 432 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicCAS_block(int *address, int compare, int val) {int volatile ___ = 1;(void)address;(void)compare;(void)val;::exit(___);}
#if 0
# 432
{ }
#endif
# 435 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicCAS_system(int *address, int compare, int val) {int volatile ___ = 1;(void)address;(void)compare;(void)val;::exit(___);}
#if 0
# 435
{ }
#endif
# 438 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicCAS_block(unsigned *address, unsigned compare, unsigned
# 439
val) {int volatile ___ = 1;(void)address;(void)compare;(void)val;::exit(___);}
#if 0
# 439
{ }
#endif
# 442 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicCAS_system(unsigned *address, unsigned compare, unsigned
# 443
val) {int volatile ___ = 1;(void)address;(void)compare;(void)val;::exit(___);}
#if 0
# 443
{ }
#endif
# 446 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicCAS_block(unsigned long long *address, unsigned long long
# 447
compare, unsigned long long
# 448
val) {int volatile ___ = 1;(void)address;(void)compare;(void)val;::exit(___);}
#if 0
# 448
{ }
#endif
# 451 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicCAS_system(unsigned long long *address, unsigned long long
# 452
compare, unsigned long long
# 453
val) {int volatile ___ = 1;(void)address;(void)compare;(void)val;::exit(___);}
#if 0
# 453
{ }
#endif
# 456 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicAnd_block(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 456
{ }
#endif
# 459 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicAnd_system(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 459
{ }
#endif
# 462 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicAnd_block(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 462
{ }
#endif
# 465 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicAnd_system(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 465
{ }
#endif
# 468 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicAnd_block(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 468
{ }
#endif
# 471 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicAnd_system(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 471
{ }
#endif
# 474 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicAnd_block(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 474
{ }
#endif
# 477 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicAnd_system(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 477
{ }
#endif
# 480 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicOr_block(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 480
{ }
#endif
# 483 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicOr_system(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 483
{ }
#endif
# 486 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicOr_block(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 486
{ }
#endif
# 489 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicOr_system(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 489
{ }
#endif
# 492 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicOr_block(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 492
{ }
#endif
# 495 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicOr_system(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 495
{ }
#endif
# 498 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicOr_block(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 498
{ }
#endif
# 501 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicOr_system(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 501
{ }
#endif
# 504 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicXor_block(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 504
{ }
#endif
# 507 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline int atomicXor_system(int *address, int val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 507
{ }
#endif
# 510 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicXor_block(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 510
{ }
#endif
# 513 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline long long atomicXor_system(long long *address, long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 513
{ }
#endif
# 516 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicXor_block(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 516
{ }
#endif
# 519 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned atomicXor_system(unsigned *address, unsigned val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 519
{ }
#endif
# 522 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicXor_block(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 522
{ }
#endif
# 525 "/usr/local/cuda-10.1/include/sm_60_atomic_functions.h" 3
__attribute__((unused)) static inline unsigned long long atomicXor_system(unsigned long long *address, unsigned long long val) {int volatile ___ = 1;(void)address;(void)val;::exit(___);}
#if 0
# 525
{ }
#endif
# 90 "/usr/local/cuda-10.1/include/sm_20_intrinsics.h" 3
extern "C" {
# 1475 "/usr/local/cuda-10.1/include/sm_20_intrinsics.h" 3
}
# 1482
__attribute((deprecated("__ballot() is deprecated in favor of __ballot_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to" " suppress this warning)."))) __attribute__((unused)) static inline unsigned ballot(bool pred) {int volatile ___ = 1;(void)pred;::exit(___);}
#if 0
# 1482
{ }
#endif
# 1484 "/usr/local/cuda-10.1/include/sm_20_intrinsics.h" 3
__attribute__((unused)) static inline int syncthreads_count(bool pred) {int volatile ___ = 1;(void)pred;::exit(___);}
#if 0
# 1484
{ }
#endif
# 1486 "/usr/local/cuda-10.1/include/sm_20_intrinsics.h" 3
__attribute__((unused)) static inline bool syncthreads_and(bool pred) {int volatile ___ = 1;(void)pred;::exit(___);}
#if 0
# 1486
{ }
#endif
# 1488 "/usr/local/cuda-10.1/include/sm_20_intrinsics.h" 3
__attribute__((unused)) static inline bool syncthreads_or(bool pred) {int volatile ___ = 1;(void)pred;::exit(___);}
#if 0
# 1488
{ }
#endif
# 1493 "/usr/local/cuda-10.1/include/sm_20_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __isGlobal(const void *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 1493
{ }
#endif
# 1494 "/usr/local/cuda-10.1/include/sm_20_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __isShared(const void *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 1494
{ }
#endif
# 1495 "/usr/local/cuda-10.1/include/sm_20_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __isConstant(const void *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 1495
{ }
#endif
# 1496 "/usr/local/cuda-10.1/include/sm_20_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __isLocal(const void *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 1496
{ }
#endif
# 102 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __fns(unsigned mask, unsigned base, int offset) {int volatile ___ = 1;(void)mask;(void)base;(void)offset;::exit(___);}
#if 0
# 102
{ }
#endif
# 103 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline void __barrier_sync(unsigned id) {int volatile ___ = 1;(void)id;::exit(___);}
#if 0
# 103
{ }
#endif
# 104 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline void __barrier_sync_count(unsigned id, unsigned cnt) {int volatile ___ = 1;(void)id;(void)cnt;::exit(___);}
#if 0
# 104
{ }
#endif
# 105 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline void __syncwarp(unsigned mask = 4294967295U) {int volatile ___ = 1;(void)mask;::exit(___);}
#if 0
# 105
{ }
#endif
# 106 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline int __all_sync(unsigned mask, int pred) {int volatile ___ = 1;(void)mask;(void)pred;::exit(___);}
#if 0
# 106
{ }
#endif
# 107 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline int __any_sync(unsigned mask, int pred) {int volatile ___ = 1;(void)mask;(void)pred;::exit(___);}
#if 0
# 107
{ }
#endif
# 108 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline int __uni_sync(unsigned mask, int pred) {int volatile ___ = 1;(void)mask;(void)pred;::exit(___);}
#if 0
# 108
{ }
#endif
# 109 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __ballot_sync(unsigned mask, int pred) {int volatile ___ = 1;(void)mask;(void)pred;::exit(___);}
#if 0
# 109
{ }
#endif
# 110 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __activemask() {int volatile ___ = 1;::exit(___);}
#if 0
# 110
{ }
#endif
# 119 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl() is deprecated in favor of __shfl_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to sup" "press this warning)."))) __attribute__((unused)) static inline int __shfl(int var, int srcLane, int width = 32) {int volatile ___ = 1;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 119
{ }
#endif
# 120 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl() is deprecated in favor of __shfl_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to sup" "press this warning)."))) __attribute__((unused)) static inline unsigned __shfl(unsigned var, int srcLane, int width = 32) {int volatile ___ = 1;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 120
{ }
#endif
# 121 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations " "to suppress this warning)."))) __attribute__((unused)) static inline int __shfl_up(int var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 121
{ }
#endif
# 122 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations " "to suppress this warning)."))) __attribute__((unused)) static inline unsigned __shfl_up(unsigned var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 122
{ }
#endif
# 123 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarati" "ons to suppress this warning)."))) __attribute__((unused)) static inline int __shfl_down(int var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 123
{ }
#endif
# 124 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarati" "ons to suppress this warning)."))) __attribute__((unused)) static inline unsigned __shfl_down(unsigned var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 124
{ }
#endif
# 125 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_xor() is deprecated in favor of __shfl_xor_sync() and may be removed in a future release (Use -Wno-deprecated-declaration" "s to suppress this warning)."))) __attribute__((unused)) static inline int __shfl_xor(int var, int laneMask, int width = 32) {int volatile ___ = 1;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 125
{ }
#endif
# 126 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_xor() is deprecated in favor of __shfl_xor_sync() and may be removed in a future release (Use -Wno-deprecated-declaration" "s to suppress this warning)."))) __attribute__((unused)) static inline unsigned __shfl_xor(unsigned var, int laneMask, int width = 32) {int volatile ___ = 1;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 126
{ }
#endif
# 127 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl() is deprecated in favor of __shfl_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to sup" "press this warning)."))) __attribute__((unused)) static inline float __shfl(float var, int srcLane, int width = 32) {int volatile ___ = 1;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 127
{ }
#endif
# 128 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations " "to suppress this warning)."))) __attribute__((unused)) static inline float __shfl_up(float var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 128
{ }
#endif
# 129 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarati" "ons to suppress this warning)."))) __attribute__((unused)) static inline float __shfl_down(float var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 129
{ }
#endif
# 130 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_xor() is deprecated in favor of __shfl_xor_sync() and may be removed in a future release (Use -Wno-deprecated-declaration" "s to suppress this warning)."))) __attribute__((unused)) static inline float __shfl_xor(float var, int laneMask, int width = 32) {int volatile ___ = 1;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 130
{ }
#endif
# 133 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline int __shfl_sync(unsigned mask, int var, int srcLane, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 133
{ }
#endif
# 134 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __shfl_sync(unsigned mask, unsigned var, int srcLane, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 134
{ }
#endif
# 135 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline int __shfl_up_sync(unsigned mask, int var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 135
{ }
#endif
# 136 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __shfl_up_sync(unsigned mask, unsigned var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 136
{ }
#endif
# 137 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline int __shfl_down_sync(unsigned mask, int var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 137
{ }
#endif
# 138 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __shfl_down_sync(unsigned mask, unsigned var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 138
{ }
#endif
# 139 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline int __shfl_xor_sync(unsigned mask, int var, int laneMask, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 139
{ }
#endif
# 140 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __shfl_xor_sync(unsigned mask, unsigned var, int laneMask, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 140
{ }
#endif
# 141 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline float __shfl_sync(unsigned mask, float var, int srcLane, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 141
{ }
#endif
# 142 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline float __shfl_up_sync(unsigned mask, float var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 142
{ }
#endif
# 143 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline float __shfl_down_sync(unsigned mask, float var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 143
{ }
#endif
# 144 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline float __shfl_xor_sync(unsigned mask, float var, int laneMask, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 144
{ }
#endif
# 148 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl() is deprecated in favor of __shfl_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to sup" "press this warning)."))) __attribute__((unused)) static inline unsigned long long __shfl(unsigned long long var, int srcLane, int width = 32) {int volatile ___ = 1;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 148
{ }
#endif
# 149 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl() is deprecated in favor of __shfl_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to sup" "press this warning)."))) __attribute__((unused)) static inline long long __shfl(long long var, int srcLane, int width = 32) {int volatile ___ = 1;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 149
{ }
#endif
# 150 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations " "to suppress this warning)."))) __attribute__((unused)) static inline long long __shfl_up(long long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 150
{ }
#endif
# 151 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations " "to suppress this warning)."))) __attribute__((unused)) static inline unsigned long long __shfl_up(unsigned long long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 151
{ }
#endif
# 152 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarati" "ons to suppress this warning)."))) __attribute__((unused)) static inline long long __shfl_down(long long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 152
{ }
#endif
# 153 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarati" "ons to suppress this warning)."))) __attribute__((unused)) static inline unsigned long long __shfl_down(unsigned long long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 153
{ }
#endif
# 154 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_xor() is deprecated in favor of __shfl_xor_sync() and may be removed in a future release (Use -Wno-deprecated-declaration" "s to suppress this warning)."))) __attribute__((unused)) static inline long long __shfl_xor(long long var, int laneMask, int width = 32) {int volatile ___ = 1;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 154
{ }
#endif
# 155 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_xor() is deprecated in favor of __shfl_xor_sync() and may be removed in a future release (Use -Wno-deprecated-declaration" "s to suppress this warning)."))) __attribute__((unused)) static inline unsigned long long __shfl_xor(unsigned long long var, int laneMask, int width = 32) {int volatile ___ = 1;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 155
{ }
#endif
# 156 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl() is deprecated in favor of __shfl_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to sup" "press this warning)."))) __attribute__((unused)) static inline double __shfl(double var, int srcLane, int width = 32) {int volatile ___ = 1;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 156
{ }
#endif
# 157 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations " "to suppress this warning)."))) __attribute__((unused)) static inline double __shfl_up(double var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 157
{ }
#endif
# 158 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarati" "ons to suppress this warning)."))) __attribute__((unused)) static inline double __shfl_down(double var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 158
{ }
#endif
# 159 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_xor() is deprecated in favor of __shfl_xor_sync() and may be removed in a future release (Use -Wno-deprecated-declaration" "s to suppress this warning)."))) __attribute__((unused)) static inline double __shfl_xor(double var, int laneMask, int width = 32) {int volatile ___ = 1;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 159
{ }
#endif
# 162 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline long long __shfl_sync(unsigned mask, long long var, int srcLane, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 162
{ }
#endif
# 163 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long long __shfl_sync(unsigned mask, unsigned long long var, int srcLane, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 163
{ }
#endif
# 164 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline long long __shfl_up_sync(unsigned mask, long long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 164
{ }
#endif
# 165 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long long __shfl_up_sync(unsigned mask, unsigned long long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 165
{ }
#endif
# 166 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline long long __shfl_down_sync(unsigned mask, long long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 166
{ }
#endif
# 167 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long long __shfl_down_sync(unsigned mask, unsigned long long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 167
{ }
#endif
# 168 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline long long __shfl_xor_sync(unsigned mask, long long var, int laneMask, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 168
{ }
#endif
# 169 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long long __shfl_xor_sync(unsigned mask, unsigned long long var, int laneMask, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 169
{ }
#endif
# 170 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline double __shfl_sync(unsigned mask, double var, int srcLane, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 170
{ }
#endif
# 171 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline double __shfl_up_sync(unsigned mask, double var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 171
{ }
#endif
# 172 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline double __shfl_down_sync(unsigned mask, double var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 172
{ }
#endif
# 173 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline double __shfl_xor_sync(unsigned mask, double var, int laneMask, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 173
{ }
#endif
# 177 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl() is deprecated in favor of __shfl_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to sup" "press this warning)."))) __attribute__((unused)) static inline long __shfl(long var, int srcLane, int width = 32) {int volatile ___ = 1;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 177
{ }
#endif
# 178 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl() is deprecated in favor of __shfl_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to sup" "press this warning)."))) __attribute__((unused)) static inline unsigned long __shfl(unsigned long var, int srcLane, int width = 32) {int volatile ___ = 1;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 178
{ }
#endif
# 179 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations " "to suppress this warning)."))) __attribute__((unused)) static inline long __shfl_up(long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 179
{ }
#endif
# 180 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_up() is deprecated in favor of __shfl_up_sync() and may be removed in a future release (Use -Wno-deprecated-declarations " "to suppress this warning)."))) __attribute__((unused)) static inline unsigned long __shfl_up(unsigned long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 180
{ }
#endif
# 181 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarati" "ons to suppress this warning)."))) __attribute__((unused)) static inline long __shfl_down(long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 181
{ }
#endif
# 182 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_down() is deprecated in favor of __shfl_down_sync() and may be removed in a future release (Use -Wno-deprecated-declarati" "ons to suppress this warning)."))) __attribute__((unused)) static inline unsigned long __shfl_down(unsigned long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 182
{ }
#endif
# 183 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_xor() is deprecated in favor of __shfl_xor_sync() and may be removed in a future release (Use -Wno-deprecated-declaration" "s to suppress this warning)."))) __attribute__((unused)) static inline long __shfl_xor(long var, int laneMask, int width = 32) {int volatile ___ = 1;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 183
{ }
#endif
# 184 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute((deprecated("__shfl_xor() is deprecated in favor of __shfl_xor_sync() and may be removed in a future release (Use -Wno-deprecated-declaration" "s to suppress this warning)."))) __attribute__((unused)) static inline unsigned long __shfl_xor(unsigned long var, int laneMask, int width = 32) {int volatile ___ = 1;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 184
{ }
#endif
# 187 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline long __shfl_sync(unsigned mask, long var, int srcLane, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 187
{ }
#endif
# 188 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long __shfl_sync(unsigned mask, unsigned long var, int srcLane, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)srcLane;(void)width;::exit(___);}
#if 0
# 188
{ }
#endif
# 189 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline long __shfl_up_sync(unsigned mask, long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 189
{ }
#endif
# 190 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long __shfl_up_sync(unsigned mask, unsigned long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 190
{ }
#endif
# 191 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline long __shfl_down_sync(unsigned mask, long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 191
{ }
#endif
# 192 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long __shfl_down_sync(unsigned mask, unsigned long var, unsigned delta, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)delta;(void)width;::exit(___);}
#if 0
# 192
{ }
#endif
# 193 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline long __shfl_xor_sync(unsigned mask, long var, int laneMask, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 193
{ }
#endif
# 194 "/usr/local/cuda-10.1/include/sm_30_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long __shfl_xor_sync(unsigned mask, unsigned long var, int laneMask, int width = 32) {int volatile ___ = 1;(void)mask;(void)var;(void)laneMask;(void)width;::exit(___);}
#if 0
# 194
{ }
#endif
# 87 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline long __ldg(const long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 87
{ }
#endif
# 88 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long __ldg(const unsigned long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 88
{ }
#endif
# 90 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline char __ldg(const char *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 90
{ }
#endif
# 91 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline signed char __ldg(const signed char *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 91
{ }
#endif
# 92 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline short __ldg(const short *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 92
{ }
#endif
# 93 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline int __ldg(const int *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 93
{ }
#endif
# 94 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline long long __ldg(const long long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 94
{ }
#endif
# 95 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline char2 __ldg(const char2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 95
{ }
#endif
# 96 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline char4 __ldg(const char4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 96
{ }
#endif
# 97 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline short2 __ldg(const short2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 97
{ }
#endif
# 98 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline short4 __ldg(const short4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 98
{ }
#endif
# 99 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline int2 __ldg(const int2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 99
{ }
#endif
# 100 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline int4 __ldg(const int4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 100
{ }
#endif
# 101 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline longlong2 __ldg(const longlong2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 101
{ }
#endif
# 103 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned char __ldg(const unsigned char *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 103
{ }
#endif
# 104 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned short __ldg(const unsigned short *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 104
{ }
#endif
# 105 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __ldg(const unsigned *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 105
{ }
#endif
# 106 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long long __ldg(const unsigned long long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 106
{ }
#endif
# 107 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uchar2 __ldg(const uchar2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 107
{ }
#endif
# 108 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uchar4 __ldg(const uchar4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 108
{ }
#endif
# 109 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline ushort2 __ldg(const ushort2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 109
{ }
#endif
# 110 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline ushort4 __ldg(const ushort4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 110
{ }
#endif
# 111 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uint2 __ldg(const uint2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 111
{ }
#endif
# 112 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uint4 __ldg(const uint4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 112
{ }
#endif
# 113 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline ulonglong2 __ldg(const ulonglong2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 113
{ }
#endif
# 115 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline float __ldg(const float *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 115
{ }
#endif
# 116 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline double __ldg(const double *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 116
{ }
#endif
# 117 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline float2 __ldg(const float2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 117
{ }
#endif
# 118 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline float4 __ldg(const float4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 118
{ }
#endif
# 119 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline double2 __ldg(const double2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 119
{ }
#endif
# 123 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline long __ldcg(const long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 123
{ }
#endif
# 124 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long __ldcg(const unsigned long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 124
{ }
#endif
# 126 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline char __ldcg(const char *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 126
{ }
#endif
# 127 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline signed char __ldcg(const signed char *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 127
{ }
#endif
# 128 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline short __ldcg(const short *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 128
{ }
#endif
# 129 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline int __ldcg(const int *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 129
{ }
#endif
# 130 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline long long __ldcg(const long long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 130
{ }
#endif
# 131 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline char2 __ldcg(const char2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 131
{ }
#endif
# 132 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline char4 __ldcg(const char4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 132
{ }
#endif
# 133 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline short2 __ldcg(const short2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 133
{ }
#endif
# 134 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline short4 __ldcg(const short4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 134
{ }
#endif
# 135 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline int2 __ldcg(const int2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 135
{ }
#endif
# 136 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline int4 __ldcg(const int4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 136
{ }
#endif
# 137 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline longlong2 __ldcg(const longlong2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 137
{ }
#endif
# 139 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned char __ldcg(const unsigned char *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 139
{ }
#endif
# 140 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned short __ldcg(const unsigned short *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 140
{ }
#endif
# 141 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __ldcg(const unsigned *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 141
{ }
#endif
# 142 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long long __ldcg(const unsigned long long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 142
{ }
#endif
# 143 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uchar2 __ldcg(const uchar2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 143
{ }
#endif
# 144 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uchar4 __ldcg(const uchar4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 144
{ }
#endif
# 145 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline ushort2 __ldcg(const ushort2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 145
{ }
#endif
# 146 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline ushort4 __ldcg(const ushort4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 146
{ }
#endif
# 147 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uint2 __ldcg(const uint2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 147
{ }
#endif
# 148 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uint4 __ldcg(const uint4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 148
{ }
#endif
# 149 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline ulonglong2 __ldcg(const ulonglong2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 149
{ }
#endif
# 151 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline float __ldcg(const float *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 151
{ }
#endif
# 152 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline double __ldcg(const double *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 152
{ }
#endif
# 153 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline float2 __ldcg(const float2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 153
{ }
#endif
# 154 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline float4 __ldcg(const float4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 154
{ }
#endif
# 155 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline double2 __ldcg(const double2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 155
{ }
#endif
# 159 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline long __ldca(const long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 159
{ }
#endif
# 160 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long __ldca(const unsigned long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 160
{ }
#endif
# 162 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline char __ldca(const char *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 162
{ }
#endif
# 163 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline signed char __ldca(const signed char *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 163
{ }
#endif
# 164 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline short __ldca(const short *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 164
{ }
#endif
# 165 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline int __ldca(const int *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 165
{ }
#endif
# 166 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline long long __ldca(const long long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 166
{ }
#endif
# 167 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline char2 __ldca(const char2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 167
{ }
#endif
# 168 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline char4 __ldca(const char4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 168
{ }
#endif
# 169 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline short2 __ldca(const short2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 169
{ }
#endif
# 170 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline short4 __ldca(const short4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 170
{ }
#endif
# 171 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline int2 __ldca(const int2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 171
{ }
#endif
# 172 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline int4 __ldca(const int4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 172
{ }
#endif
# 173 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline longlong2 __ldca(const longlong2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 173
{ }
#endif
# 175 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned char __ldca(const unsigned char *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 175
{ }
#endif
# 176 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned short __ldca(const unsigned short *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 176
{ }
#endif
# 177 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __ldca(const unsigned *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 177
{ }
#endif
# 178 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long long __ldca(const unsigned long long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 178
{ }
#endif
# 179 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uchar2 __ldca(const uchar2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 179
{ }
#endif
# 180 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uchar4 __ldca(const uchar4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 180
{ }
#endif
# 181 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline ushort2 __ldca(const ushort2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 181
{ }
#endif
# 182 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline ushort4 __ldca(const ushort4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 182
{ }
#endif
# 183 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uint2 __ldca(const uint2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 183
{ }
#endif
# 184 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uint4 __ldca(const uint4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 184
{ }
#endif
# 185 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline ulonglong2 __ldca(const ulonglong2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 185
{ }
#endif
# 187 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline float __ldca(const float *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 187
{ }
#endif
# 188 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline double __ldca(const double *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 188
{ }
#endif
# 189 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline float2 __ldca(const float2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 189
{ }
#endif
# 190 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline float4 __ldca(const float4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 190
{ }
#endif
# 191 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline double2 __ldca(const double2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 191
{ }
#endif
# 195 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline long __ldcs(const long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 195
{ }
#endif
# 196 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long __ldcs(const unsigned long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 196
{ }
#endif
# 198 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline char __ldcs(const char *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 198
{ }
#endif
# 199 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline signed char __ldcs(const signed char *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 199
{ }
#endif
# 200 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline short __ldcs(const short *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 200
{ }
#endif
# 201 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline int __ldcs(const int *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 201
{ }
#endif
# 202 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline long long __ldcs(const long long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 202
{ }
#endif
# 203 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline char2 __ldcs(const char2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 203
{ }
#endif
# 204 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline char4 __ldcs(const char4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 204
{ }
#endif
# 205 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline short2 __ldcs(const short2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 205
{ }
#endif
# 206 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline short4 __ldcs(const short4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 206
{ }
#endif
# 207 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline int2 __ldcs(const int2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 207
{ }
#endif
# 208 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline int4 __ldcs(const int4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 208
{ }
#endif
# 209 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline longlong2 __ldcs(const longlong2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 209
{ }
#endif
# 211 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned char __ldcs(const unsigned char *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 211
{ }
#endif
# 212 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned short __ldcs(const unsigned short *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 212
{ }
#endif
# 213 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __ldcs(const unsigned *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 213
{ }
#endif
# 214 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned long long __ldcs(const unsigned long long *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 214
{ }
#endif
# 215 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uchar2 __ldcs(const uchar2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 215
{ }
#endif
# 216 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uchar4 __ldcs(const uchar4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 216
{ }
#endif
# 217 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline ushort2 __ldcs(const ushort2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 217
{ }
#endif
# 218 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline ushort4 __ldcs(const ushort4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 218
{ }
#endif
# 219 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uint2 __ldcs(const uint2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 219
{ }
#endif
# 220 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline uint4 __ldcs(const uint4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 220
{ }
#endif
# 221 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline ulonglong2 __ldcs(const ulonglong2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 221
{ }
#endif
# 223 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline float __ldcs(const float *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 223
{ }
#endif
# 224 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline double __ldcs(const double *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 224
{ }
#endif
# 225 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline float2 __ldcs(const float2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 225
{ }
#endif
# 226 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline float4 __ldcs(const float4 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 226
{ }
#endif
# 227 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline double2 __ldcs(const double2 *ptr) {int volatile ___ = 1;(void)ptr;::exit(___);}
#if 0
# 227
{ }
#endif
# 244 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __funnelshift_l(unsigned lo, unsigned hi, unsigned shift) {int volatile ___ = 1;(void)lo;(void)hi;(void)shift;::exit(___);}
#if 0
# 244
{ }
#endif
# 256 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __funnelshift_lc(unsigned lo, unsigned hi, unsigned shift) {int volatile ___ = 1;(void)lo;(void)hi;(void)shift;::exit(___);}
#if 0
# 256
{ }
#endif
# 269 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __funnelshift_r(unsigned lo, unsigned hi, unsigned shift) {int volatile ___ = 1;(void)lo;(void)hi;(void)shift;::exit(___);}
#if 0
# 269
{ }
#endif
# 281 "/usr/local/cuda-10.1/include/sm_32_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __funnelshift_rc(unsigned lo, unsigned hi, unsigned shift) {int volatile ___ = 1;(void)lo;(void)hi;(void)shift;::exit(___);}
#if 0
# 281
{ }
#endif
# 89 "/usr/local/cuda-10.1/include/sm_61_intrinsics.h" 3
__attribute__((unused)) static inline int __dp2a_lo(int srcA, int srcB, int c) {int volatile ___ = 1;(void)srcA;(void)srcB;(void)c;::exit(___);}
#if 0
# 89
{ }
#endif
# 90 "/usr/local/cuda-10.1/include/sm_61_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __dp2a_lo(unsigned srcA, unsigned srcB, unsigned c) {int volatile ___ = 1;(void)srcA;(void)srcB;(void)c;::exit(___);}
#if 0
# 90
{ }
#endif
# 92 "/usr/local/cuda-10.1/include/sm_61_intrinsics.h" 3
__attribute__((unused)) static inline int __dp2a_lo(short2 srcA, char4 srcB, int c) {int volatile ___ = 1;(void)srcA;(void)srcB;(void)c;::exit(___);}
#if 0
# 92
{ }
#endif
# 93 "/usr/local/cuda-10.1/include/sm_61_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __dp2a_lo(ushort2 srcA, uchar4 srcB, unsigned c) {int volatile ___ = 1;(void)srcA;(void)srcB;(void)c;::exit(___);}
#if 0
# 93
{ }
#endif
# 95 "/usr/local/cuda-10.1/include/sm_61_intrinsics.h" 3
__attribute__((unused)) static inline int __dp2a_hi(int srcA, int srcB, int c) {int volatile ___ = 1;(void)srcA;(void)srcB;(void)c;::exit(___);}
#if 0
# 95
{ }
#endif
# 96 "/usr/local/cuda-10.1/include/sm_61_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __dp2a_hi(unsigned srcA, unsigned srcB, unsigned c) {int volatile ___ = 1;(void)srcA;(void)srcB;(void)c;::exit(___);}
#if 0
# 96
{ }
#endif
# 98 "/usr/local/cuda-10.1/include/sm_61_intrinsics.h" 3
__attribute__((unused)) static inline int __dp2a_hi(short2 srcA, char4 srcB, int c) {int volatile ___ = 1;(void)srcA;(void)srcB;(void)c;::exit(___);}
#if 0
# 98
{ }
#endif
# 99 "/usr/local/cuda-10.1/include/sm_61_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __dp2a_hi(ushort2 srcA, uchar4 srcB, unsigned c) {int volatile ___ = 1;(void)srcA;(void)srcB;(void)c;::exit(___);}
#if 0
# 99
{ }
#endif
# 106 "/usr/local/cuda-10.1/include/sm_61_intrinsics.h" 3
__attribute__((unused)) static inline int __dp4a(int srcA, int srcB, int c) {int volatile ___ = 1;(void)srcA;(void)srcB;(void)c;::exit(___);}
#if 0
# 106
{ }
#endif
# 107 "/usr/local/cuda-10.1/include/sm_61_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __dp4a(unsigned srcA, unsigned srcB, unsigned c) {int volatile ___ = 1;(void)srcA;(void)srcB;(void)c;::exit(___);}
#if 0
# 107
{ }
#endif
# 109 "/usr/local/cuda-10.1/include/sm_61_intrinsics.h" 3
__attribute__((unused)) static inline int __dp4a(char4 srcA, char4 srcB, int c) {int volatile ___ = 1;(void)srcA;(void)srcB;(void)c;::exit(___);}
#if 0
# 109
{ }
#endif
# 110 "/usr/local/cuda-10.1/include/sm_61_intrinsics.h" 3
__attribute__((unused)) static inline unsigned __dp4a(uchar4 srcA, uchar4 srcB, unsigned c) {int volatile ___ = 1;(void)srcA;(void)srcB;(void)c;::exit(___);}
#if 0
# 110
{ }
#endif
# 93 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_any_sync(unsigned mask, unsigned value) {int volatile ___ = 1;(void)mask;(void)value;::exit(___);}
#if 0
# 93
{ }
#endif
# 94 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_any_sync(unsigned mask, int value) {int volatile ___ = 1;(void)mask;(void)value;::exit(___);}
#if 0
# 94
{ }
#endif
# 95 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_any_sync(unsigned mask, unsigned long value) {int volatile ___ = 1;(void)mask;(void)value;::exit(___);}
#if 0
# 95
{ }
#endif
# 96 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_any_sync(unsigned mask, long value) {int volatile ___ = 1;(void)mask;(void)value;::exit(___);}
#if 0
# 96
{ }
#endif
# 97 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_any_sync(unsigned mask, unsigned long long value) {int volatile ___ = 1;(void)mask;(void)value;::exit(___);}
#if 0
# 97
{ }
#endif
# 98 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_any_sync(unsigned mask, long long value) {int volatile ___ = 1;(void)mask;(void)value;::exit(___);}
#if 0
# 98
{ }
#endif
# 99 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_any_sync(unsigned mask, float value) {int volatile ___ = 1;(void)mask;(void)value;::exit(___);}
#if 0
# 99
{ }
#endif
# 100 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_any_sync(unsigned mask, double value) {int volatile ___ = 1;(void)mask;(void)value;::exit(___);}
#if 0
# 100
{ }
#endif
# 102 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_all_sync(unsigned mask, unsigned value, int *pred) {int volatile ___ = 1;(void)mask;(void)value;(void)pred;::exit(___);}
#if 0
# 102
{ }
#endif
# 103 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_all_sync(unsigned mask, int value, int *pred) {int volatile ___ = 1;(void)mask;(void)value;(void)pred;::exit(___);}
#if 0
# 103
{ }
#endif
# 104 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_all_sync(unsigned mask, unsigned long value, int *pred) {int volatile ___ = 1;(void)mask;(void)value;(void)pred;::exit(___);}
#if 0
# 104
{ }
#endif
# 105 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_all_sync(unsigned mask, long value, int *pred) {int volatile ___ = 1;(void)mask;(void)value;(void)pred;::exit(___);}
#if 0
# 105
{ }
#endif
# 106 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_all_sync(unsigned mask, unsigned long long value, int *pred) {int volatile ___ = 1;(void)mask;(void)value;(void)pred;::exit(___);}
#if 0
# 106
{ }
#endif
# 107 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_all_sync(unsigned mask, long long value, int *pred) {int volatile ___ = 1;(void)mask;(void)value;(void)pred;::exit(___);}
#if 0
# 107
{ }
#endif
# 108 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_all_sync(unsigned mask, float value, int *pred) {int volatile ___ = 1;(void)mask;(void)value;(void)pred;::exit(___);}
#if 0
# 108
{ }
#endif
# 109 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned __match_all_sync(unsigned mask, double value, int *pred) {int volatile ___ = 1;(void)mask;(void)value;(void)pred;::exit(___);}
#if 0
# 109
{ }
#endif
# 111 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline void __nanosleep(unsigned ns) {int volatile ___ = 1;(void)ns;::exit(___);}
#if 0
# 111
{ }
#endif
# 113 "/usr/local/cuda-10.1/include/crt/sm_70_rt.h" 3
__attribute__((unused)) static inline unsigned short atomicCAS(unsigned short *address, unsigned short compare, unsigned short val) {int volatile ___ = 1;(void)address;(void)compare;(void)val;::exit(___);}
#if 0
# 113
{ }
#endif
# 114 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 115
__attribute((always_inline)) __attribute__((unused)) static inline void surf1Dread(T *res, surface< void, 1> surf, int x, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 116
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)s;(void)mode;
# 120
::exit(___);}
#if 0
# 116
{
# 120
}
#endif
# 122 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 123
__attribute((always_inline)) __attribute__((unused)) static inline T surf1Dread(surface< void, 1> surf, int x, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 124
{int volatile ___ = 1;(void)surf;(void)x;(void)mode;
# 130
::exit(___);}
#if 0
# 124
{
# 130
}
#endif
# 132 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 133
__attribute((always_inline)) __attribute__((unused)) static inline void surf1Dread(T *res, surface< void, 1> surf, int x, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 134
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)mode;
# 138
::exit(___);}
#if 0
# 134
{
# 138
}
#endif
# 141 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 142
__attribute((always_inline)) __attribute__((unused)) static inline void surf2Dread(T *res, surface< void, 2> surf, int x, int y, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 143
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)y;(void)s;(void)mode;
# 147
::exit(___);}
#if 0
# 143
{
# 147
}
#endif
# 149 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 150
__attribute((always_inline)) __attribute__((unused)) static inline T surf2Dread(surface< void, 2> surf, int x, int y, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 151
{int volatile ___ = 1;(void)surf;(void)x;(void)y;(void)mode;
# 157
::exit(___);}
#if 0
# 151
{
# 157
}
#endif
# 159 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 160
__attribute((always_inline)) __attribute__((unused)) static inline void surf2Dread(T *res, surface< void, 2> surf, int x, int y, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 161
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)y;(void)mode;
# 165
::exit(___);}
#if 0
# 161
{
# 165
}
#endif
# 168 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 169
__attribute((always_inline)) __attribute__((unused)) static inline void surf3Dread(T *res, surface< void, 3> surf, int x, int y, int z, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 170
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)y;(void)z;(void)s;(void)mode;
# 174
::exit(___);}
#if 0
# 170
{
# 174
}
#endif
# 176 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 177
__attribute((always_inline)) __attribute__((unused)) static inline T surf3Dread(surface< void, 3> surf, int x, int y, int z, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 178
{int volatile ___ = 1;(void)surf;(void)x;(void)y;(void)z;(void)mode;
# 184
::exit(___);}
#if 0
# 178
{
# 184
}
#endif
# 186 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 187
__attribute((always_inline)) __attribute__((unused)) static inline void surf3Dread(T *res, surface< void, 3> surf, int x, int y, int z, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 188
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)y;(void)z;(void)mode;
# 192
::exit(___);}
#if 0
# 188
{
# 192
}
#endif
# 196 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 197
__attribute((always_inline)) __attribute__((unused)) static inline void surf1DLayeredread(T *res, surface< void, 241> surf, int x, int layer, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 198
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)layer;(void)s;(void)mode;
# 202
::exit(___);}
#if 0
# 198
{
# 202
}
#endif
# 204 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 205
__attribute((always_inline)) __attribute__((unused)) static inline T surf1DLayeredread(surface< void, 241> surf, int x, int layer, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 206
{int volatile ___ = 1;(void)surf;(void)x;(void)layer;(void)mode;
# 212
::exit(___);}
#if 0
# 206
{
# 212
}
#endif
# 215 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 216
__attribute((always_inline)) __attribute__((unused)) static inline void surf1DLayeredread(T *res, surface< void, 241> surf, int x, int layer, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 217
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)layer;(void)mode;
# 221
::exit(___);}
#if 0
# 217
{
# 221
}
#endif
# 224 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 225
__attribute((always_inline)) __attribute__((unused)) static inline void surf2DLayeredread(T *res, surface< void, 242> surf, int x, int y, int layer, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 226
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)y;(void)layer;(void)s;(void)mode;
# 230
::exit(___);}
#if 0
# 226
{
# 230
}
#endif
# 232 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 233
__attribute((always_inline)) __attribute__((unused)) static inline T surf2DLayeredread(surface< void, 242> surf, int x, int y, int layer, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 234
{int volatile ___ = 1;(void)surf;(void)x;(void)y;(void)layer;(void)mode;
# 240
::exit(___);}
#if 0
# 234
{
# 240
}
#endif
# 243 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 244
__attribute((always_inline)) __attribute__((unused)) static inline void surf2DLayeredread(T *res, surface< void, 242> surf, int x, int y, int layer, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 245
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)y;(void)layer;(void)mode;
# 249
::exit(___);}
#if 0
# 245
{
# 249
}
#endif
# 252 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 253
__attribute((always_inline)) __attribute__((unused)) static inline void surfCubemapread(T *res, surface< void, 12> surf, int x, int y, int face, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 254
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)y;(void)face;(void)s;(void)mode;
# 258
::exit(___);}
#if 0
# 254
{
# 258
}
#endif
# 260 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 261
__attribute((always_inline)) __attribute__((unused)) static inline T surfCubemapread(surface< void, 12> surf, int x, int y, int face, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 262
{int volatile ___ = 1;(void)surf;(void)x;(void)y;(void)face;(void)mode;
# 269
::exit(___);}
#if 0
# 262
{
# 269
}
#endif
# 271 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 272
__attribute((always_inline)) __attribute__((unused)) static inline void surfCubemapread(T *res, surface< void, 12> surf, int x, int y, int face, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 273
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)y;(void)face;(void)mode;
# 277
::exit(___);}
#if 0
# 273
{
# 277
}
#endif
# 280 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 281
__attribute((always_inline)) __attribute__((unused)) static inline void surfCubemapLayeredread(T *res, surface< void, 252> surf, int x, int y, int layerFace, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 282
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)y;(void)layerFace;(void)s;(void)mode;
# 286
::exit(___);}
#if 0
# 282
{
# 286
}
#endif
# 288 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 289
__attribute((always_inline)) __attribute__((unused)) static inline T surfCubemapLayeredread(surface< void, 252> surf, int x, int y, int layerFace, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 290
{int volatile ___ = 1;(void)surf;(void)x;(void)y;(void)layerFace;(void)mode;
# 296
::exit(___);}
#if 0
# 290
{
# 296
}
#endif
# 298 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 299
__attribute((always_inline)) __attribute__((unused)) static inline void surfCubemapLayeredread(T *res, surface< void, 252> surf, int x, int y, int layerFace, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 300
{int volatile ___ = 1;(void)res;(void)surf;(void)x;(void)y;(void)layerFace;(void)mode;
# 304
::exit(___);}
#if 0
# 300
{
# 304
}
#endif
# 307 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 308
__attribute((always_inline)) __attribute__((unused)) static inline void surf1Dwrite(T val, surface< void, 1> surf, int x, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 309
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)s;(void)mode;
# 313
::exit(___);}
#if 0
# 309
{
# 313
}
#endif
# 315 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 316
__attribute((always_inline)) __attribute__((unused)) static inline void surf1Dwrite(T val, surface< void, 1> surf, int x, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 317
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)mode;
# 321
::exit(___);}
#if 0
# 317
{
# 321
}
#endif
# 325 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 326
__attribute((always_inline)) __attribute__((unused)) static inline void surf2Dwrite(T val, surface< void, 2> surf, int x, int y, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 327
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)y;(void)s;(void)mode;
# 331
::exit(___);}
#if 0
# 327
{
# 331
}
#endif
# 333 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 334
__attribute((always_inline)) __attribute__((unused)) static inline void surf2Dwrite(T val, surface< void, 2> surf, int x, int y, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 335
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)y;(void)mode;
# 339
::exit(___);}
#if 0
# 335
{
# 339
}
#endif
# 342 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 343
__attribute((always_inline)) __attribute__((unused)) static inline void surf3Dwrite(T val, surface< void, 3> surf, int x, int y, int z, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 344
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)y;(void)z;(void)s;(void)mode;
# 348
::exit(___);}
#if 0
# 344
{
# 348
}
#endif
# 350 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 351
__attribute((always_inline)) __attribute__((unused)) static inline void surf3Dwrite(T val, surface< void, 3> surf, int x, int y, int z, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 352
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)y;(void)z;(void)mode;
# 356
::exit(___);}
#if 0
# 352
{
# 356
}
#endif
# 359 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 360
__attribute((always_inline)) __attribute__((unused)) static inline void surf1DLayeredwrite(T val, surface< void, 241> surf, int x, int layer, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 361
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)layer;(void)s;(void)mode;
# 365
::exit(___);}
#if 0
# 361
{
# 365
}
#endif
# 367 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 368
__attribute((always_inline)) __attribute__((unused)) static inline void surf1DLayeredwrite(T val, surface< void, 241> surf, int x, int layer, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 369
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)layer;(void)mode;
# 373
::exit(___);}
#if 0
# 369
{
# 373
}
#endif
# 376 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 377
__attribute((always_inline)) __attribute__((unused)) static inline void surf2DLayeredwrite(T val, surface< void, 242> surf, int x, int y, int layer, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 378
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)y;(void)layer;(void)s;(void)mode;
# 382
::exit(___);}
#if 0
# 378
{
# 382
}
#endif
# 384 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 385
__attribute((always_inline)) __attribute__((unused)) static inline void surf2DLayeredwrite(T val, surface< void, 242> surf, int x, int y, int layer, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 386
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)y;(void)layer;(void)mode;
# 390
::exit(___);}
#if 0
# 386
{
# 390
}
#endif
# 393 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 394
__attribute((always_inline)) __attribute__((unused)) static inline void surfCubemapwrite(T val, surface< void, 12> surf, int x, int y, int face, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 395
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)y;(void)face;(void)s;(void)mode;
# 399
::exit(___);}
#if 0
# 395
{
# 399
}
#endif
# 401 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 402
__attribute((always_inline)) __attribute__((unused)) static inline void surfCubemapwrite(T val, surface< void, 12> surf, int x, int y, int face, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 403
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)y;(void)face;(void)mode;
# 407
::exit(___);}
#if 0
# 403
{
# 407
}
#endif
# 411 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 412
__attribute((always_inline)) __attribute__((unused)) static inline void surfCubemapLayeredwrite(T val, surface< void, 252> surf, int x, int y, int layerFace, int s, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 413
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)y;(void)layerFace;(void)s;(void)mode;
# 417
::exit(___);}
#if 0
# 413
{
# 417
}
#endif
# 419 "/usr/local/cuda-10.1/include/surface_functions.h" 3
template< class T>
# 420
__attribute((always_inline)) __attribute__((unused)) static inline void surfCubemapLayeredwrite(T val, surface< void, 252> surf, int x, int y, int layerFace, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 421
{int volatile ___ = 1;(void)val;(void)surf;(void)x;(void)y;(void)layerFace;(void)mode;
# 425
::exit(___);}
#if 0
# 421
{
# 425
}
#endif
# 66 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 67
struct __nv_tex_rmet_ret { };
# 69
template<> struct __nv_tex_rmet_ret< char> { typedef char type; };
# 70
template<> struct __nv_tex_rmet_ret< signed char> { typedef signed char type; };
# 71
template<> struct __nv_tex_rmet_ret< unsigned char> { typedef unsigned char type; };
# 72
template<> struct __nv_tex_rmet_ret< char1> { typedef char1 type; };
# 73
template<> struct __nv_tex_rmet_ret< uchar1> { typedef uchar1 type; };
# 74
template<> struct __nv_tex_rmet_ret< char2> { typedef char2 type; };
# 75
template<> struct __nv_tex_rmet_ret< uchar2> { typedef uchar2 type; };
# 76
template<> struct __nv_tex_rmet_ret< char4> { typedef char4 type; };
# 77
template<> struct __nv_tex_rmet_ret< uchar4> { typedef uchar4 type; };
# 79
template<> struct __nv_tex_rmet_ret< short> { typedef short type; };
# 80
template<> struct __nv_tex_rmet_ret< unsigned short> { typedef unsigned short type; };
# 81
template<> struct __nv_tex_rmet_ret< short1> { typedef short1 type; };
# 82
template<> struct __nv_tex_rmet_ret< ushort1> { typedef ushort1 type; };
# 83
template<> struct __nv_tex_rmet_ret< short2> { typedef short2 type; };
# 84
template<> struct __nv_tex_rmet_ret< ushort2> { typedef ushort2 type; };
# 85
template<> struct __nv_tex_rmet_ret< short4> { typedef short4 type; };
# 86
template<> struct __nv_tex_rmet_ret< ushort4> { typedef ushort4 type; };
# 88
template<> struct __nv_tex_rmet_ret< int> { typedef int type; };
# 89
template<> struct __nv_tex_rmet_ret< unsigned> { typedef unsigned type; };
# 90
template<> struct __nv_tex_rmet_ret< int1> { typedef int1 type; };
# 91
template<> struct __nv_tex_rmet_ret< uint1> { typedef uint1 type; };
# 92
template<> struct __nv_tex_rmet_ret< int2> { typedef int2 type; };
# 93
template<> struct __nv_tex_rmet_ret< uint2> { typedef uint2 type; };
# 94
template<> struct __nv_tex_rmet_ret< int4> { typedef int4 type; };
# 95
template<> struct __nv_tex_rmet_ret< uint4> { typedef uint4 type; };
# 107 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template<> struct __nv_tex_rmet_ret< float> { typedef float type; };
# 108
template<> struct __nv_tex_rmet_ret< float1> { typedef float1 type; };
# 109
template<> struct __nv_tex_rmet_ret< float2> { typedef float2 type; };
# 110
template<> struct __nv_tex_rmet_ret< float4> { typedef float4 type; };
# 113
template< class T> struct __nv_tex_rmet_cast { typedef T *type; };
# 125 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 126
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex1Dfetch(texture< T, 1, cudaReadModeElementType> t, int x)
# 127
{int volatile ___ = 1;(void)t;(void)x;
# 133
::exit(___);}
#if 0
# 127
{
# 133
}
#endif
# 135 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 136
struct __nv_tex_rmnf_ret { };
# 138
template<> struct __nv_tex_rmnf_ret< char> { typedef float type; };
# 139
template<> struct __nv_tex_rmnf_ret< signed char> { typedef float type; };
# 140
template<> struct __nv_tex_rmnf_ret< unsigned char> { typedef float type; };
# 141
template<> struct __nv_tex_rmnf_ret< short> { typedef float type; };
# 142
template<> struct __nv_tex_rmnf_ret< unsigned short> { typedef float type; };
# 143
template<> struct __nv_tex_rmnf_ret< char1> { typedef float1 type; };
# 144
template<> struct __nv_tex_rmnf_ret< uchar1> { typedef float1 type; };
# 145
template<> struct __nv_tex_rmnf_ret< short1> { typedef float1 type; };
# 146
template<> struct __nv_tex_rmnf_ret< ushort1> { typedef float1 type; };
# 147
template<> struct __nv_tex_rmnf_ret< char2> { typedef float2 type; };
# 148
template<> struct __nv_tex_rmnf_ret< uchar2> { typedef float2 type; };
# 149
template<> struct __nv_tex_rmnf_ret< short2> { typedef float2 type; };
# 150
template<> struct __nv_tex_rmnf_ret< ushort2> { typedef float2 type; };
# 151
template<> struct __nv_tex_rmnf_ret< char4> { typedef float4 type; };
# 152
template<> struct __nv_tex_rmnf_ret< uchar4> { typedef float4 type; };
# 153
template<> struct __nv_tex_rmnf_ret< short4> { typedef float4 type; };
# 154
template<> struct __nv_tex_rmnf_ret< ushort4> { typedef float4 type; };
# 156
template< class T>
# 157
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex1Dfetch(texture< T, 1, cudaReadModeNormalizedFloat> t, int x)
# 158
{int volatile ___ = 1;(void)t;(void)x;
# 165
::exit(___);}
#if 0
# 158
{
# 165
}
#endif
# 168 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 169
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex1D(texture< T, 1, cudaReadModeElementType> t, float x)
# 170
{int volatile ___ = 1;(void)t;(void)x;
# 176
::exit(___);}
#if 0
# 170
{
# 176
}
#endif
# 178 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 179
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex1D(texture< T, 1, cudaReadModeNormalizedFloat> t, float x)
# 180
{int volatile ___ = 1;(void)t;(void)x;
# 187
::exit(___);}
#if 0
# 180
{
# 187
}
#endif
# 191 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 192
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex2D(texture< T, 2, cudaReadModeElementType> t, float x, float y)
# 193
{int volatile ___ = 1;(void)t;(void)x;(void)y;
# 200
::exit(___);}
#if 0
# 193
{
# 200
}
#endif
# 202 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 203
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex2D(texture< T, 2, cudaReadModeNormalizedFloat> t, float x, float y)
# 204
{int volatile ___ = 1;(void)t;(void)x;(void)y;
# 211
::exit(___);}
#if 0
# 204
{
# 211
}
#endif
# 215 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 216
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex1DLayered(texture< T, 241, cudaReadModeElementType> t, float x, int layer)
# 217
{int volatile ___ = 1;(void)t;(void)x;(void)layer;
# 223
::exit(___);}
#if 0
# 217
{
# 223
}
#endif
# 225 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 226
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex1DLayered(texture< T, 241, cudaReadModeNormalizedFloat> t, float x, int layer)
# 227
{int volatile ___ = 1;(void)t;(void)x;(void)layer;
# 234
::exit(___);}
#if 0
# 227
{
# 234
}
#endif
# 238 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 239
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex2DLayered(texture< T, 242, cudaReadModeElementType> t, float x, float y, int layer)
# 240
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)layer;
# 246
::exit(___);}
#if 0
# 240
{
# 246
}
#endif
# 248 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 249
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex2DLayered(texture< T, 242, cudaReadModeNormalizedFloat> t, float x, float y, int layer)
# 250
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)layer;
# 257
::exit(___);}
#if 0
# 250
{
# 257
}
#endif
# 260 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 261
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex3D(texture< T, 3, cudaReadModeElementType> t, float x, float y, float z)
# 262
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;
# 268
::exit(___);}
#if 0
# 262
{
# 268
}
#endif
# 270 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 271
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex3D(texture< T, 3, cudaReadModeNormalizedFloat> t, float x, float y, float z)
# 272
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;
# 279
::exit(___);}
#if 0
# 272
{
# 279
}
#endif
# 282 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 283
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type texCubemap(texture< T, 12, cudaReadModeElementType> t, float x, float y, float z)
# 284
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;
# 290
::exit(___);}
#if 0
# 284
{
# 290
}
#endif
# 292 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 293
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type texCubemap(texture< T, 12, cudaReadModeNormalizedFloat> t, float x, float y, float z)
# 294
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;
# 301
::exit(___);}
#if 0
# 294
{
# 301
}
#endif
# 304 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 305
struct __nv_tex2dgather_ret { };
# 306
template<> struct __nv_tex2dgather_ret< char> { typedef char4 type; };
# 307
template<> struct __nv_tex2dgather_ret< signed char> { typedef char4 type; };
# 308
template<> struct __nv_tex2dgather_ret< char1> { typedef char4 type; };
# 309
template<> struct __nv_tex2dgather_ret< char2> { typedef char4 type; };
# 310
template<> struct __nv_tex2dgather_ret< char3> { typedef char4 type; };
# 311
template<> struct __nv_tex2dgather_ret< char4> { typedef char4 type; };
# 312
template<> struct __nv_tex2dgather_ret< unsigned char> { typedef uchar4 type; };
# 313
template<> struct __nv_tex2dgather_ret< uchar1> { typedef uchar4 type; };
# 314
template<> struct __nv_tex2dgather_ret< uchar2> { typedef uchar4 type; };
# 315
template<> struct __nv_tex2dgather_ret< uchar3> { typedef uchar4 type; };
# 316
template<> struct __nv_tex2dgather_ret< uchar4> { typedef uchar4 type; };
# 318
template<> struct __nv_tex2dgather_ret< short> { typedef short4 type; };
# 319
template<> struct __nv_tex2dgather_ret< short1> { typedef short4 type; };
# 320
template<> struct __nv_tex2dgather_ret< short2> { typedef short4 type; };
# 321
template<> struct __nv_tex2dgather_ret< short3> { typedef short4 type; };
# 322
template<> struct __nv_tex2dgather_ret< short4> { typedef short4 type; };
# 323
template<> struct __nv_tex2dgather_ret< unsigned short> { typedef ushort4 type; };
# 324
template<> struct __nv_tex2dgather_ret< ushort1> { typedef ushort4 type; };
# 325
template<> struct __nv_tex2dgather_ret< ushort2> { typedef ushort4 type; };
# 326
template<> struct __nv_tex2dgather_ret< ushort3> { typedef ushort4 type; };
# 327
template<> struct __nv_tex2dgather_ret< ushort4> { typedef ushort4 type; };
# 329
template<> struct __nv_tex2dgather_ret< int> { typedef int4 type; };
# 330
template<> struct __nv_tex2dgather_ret< int1> { typedef int4 type; };
# 331
template<> struct __nv_tex2dgather_ret< int2> { typedef int4 type; };
# 332
template<> struct __nv_tex2dgather_ret< int3> { typedef int4 type; };
# 333
template<> struct __nv_tex2dgather_ret< int4> { typedef int4 type; };
# 334
template<> struct __nv_tex2dgather_ret< unsigned> { typedef uint4 type; };
# 335
template<> struct __nv_tex2dgather_ret< uint1> { typedef uint4 type; };
# 336
template<> struct __nv_tex2dgather_ret< uint2> { typedef uint4 type; };
# 337
template<> struct __nv_tex2dgather_ret< uint3> { typedef uint4 type; };
# 338
template<> struct __nv_tex2dgather_ret< uint4> { typedef uint4 type; };
# 340
template<> struct __nv_tex2dgather_ret< float> { typedef float4 type; };
# 341
template<> struct __nv_tex2dgather_ret< float1> { typedef float4 type; };
# 342
template<> struct __nv_tex2dgather_ret< float2> { typedef float4 type; };
# 343
template<> struct __nv_tex2dgather_ret< float3> { typedef float4 type; };
# 344
template<> struct __nv_tex2dgather_ret< float4> { typedef float4 type; };
# 346
template< class T>
# 347
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex2dgather_ret< T> ::type tex2Dgather(texture< T, 2, cudaReadModeElementType> t, float x, float y, int comp = 0)
# 348
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)comp;
# 355
::exit(___);}
#if 0
# 348
{
# 355
}
#endif
# 358 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T> struct __nv_tex2dgather_rmnf_ret { };
# 359
template<> struct __nv_tex2dgather_rmnf_ret< char> { typedef float4 type; };
# 360
template<> struct __nv_tex2dgather_rmnf_ret< signed char> { typedef float4 type; };
# 361
template<> struct __nv_tex2dgather_rmnf_ret< unsigned char> { typedef float4 type; };
# 362
template<> struct __nv_tex2dgather_rmnf_ret< char1> { typedef float4 type; };
# 363
template<> struct __nv_tex2dgather_rmnf_ret< uchar1> { typedef float4 type; };
# 364
template<> struct __nv_tex2dgather_rmnf_ret< char2> { typedef float4 type; };
# 365
template<> struct __nv_tex2dgather_rmnf_ret< uchar2> { typedef float4 type; };
# 366
template<> struct __nv_tex2dgather_rmnf_ret< char3> { typedef float4 type; };
# 367
template<> struct __nv_tex2dgather_rmnf_ret< uchar3> { typedef float4 type; };
# 368
template<> struct __nv_tex2dgather_rmnf_ret< char4> { typedef float4 type; };
# 369
template<> struct __nv_tex2dgather_rmnf_ret< uchar4> { typedef float4 type; };
# 370
template<> struct __nv_tex2dgather_rmnf_ret< signed short> { typedef float4 type; };
# 371
template<> struct __nv_tex2dgather_rmnf_ret< unsigned short> { typedef float4 type; };
# 372
template<> struct __nv_tex2dgather_rmnf_ret< short1> { typedef float4 type; };
# 373
template<> struct __nv_tex2dgather_rmnf_ret< ushort1> { typedef float4 type; };
# 374
template<> struct __nv_tex2dgather_rmnf_ret< short2> { typedef float4 type; };
# 375
template<> struct __nv_tex2dgather_rmnf_ret< ushort2> { typedef float4 type; };
# 376
template<> struct __nv_tex2dgather_rmnf_ret< short3> { typedef float4 type; };
# 377
template<> struct __nv_tex2dgather_rmnf_ret< ushort3> { typedef float4 type; };
# 378
template<> struct __nv_tex2dgather_rmnf_ret< short4> { typedef float4 type; };
# 379
template<> struct __nv_tex2dgather_rmnf_ret< ushort4> { typedef float4 type; };
# 381
template< class T>
# 382
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex2dgather_rmnf_ret< T> ::type tex2Dgather(texture< T, 2, cudaReadModeNormalizedFloat> t, float x, float y, int comp = 0)
# 383
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)comp;
# 390
::exit(___);}
#if 0
# 383
{
# 390
}
#endif
# 394 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 395
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex1DLod(texture< T, 1, cudaReadModeElementType> t, float x, float level)
# 396
{int volatile ___ = 1;(void)t;(void)x;(void)level;
# 402
::exit(___);}
#if 0
# 396
{
# 402
}
#endif
# 404 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 405
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex1DLod(texture< T, 1, cudaReadModeNormalizedFloat> t, float x, float level)
# 406
{int volatile ___ = 1;(void)t;(void)x;(void)level;
# 413
::exit(___);}
#if 0
# 406
{
# 413
}
#endif
# 416 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 417
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex2DLod(texture< T, 2, cudaReadModeElementType> t, float x, float y, float level)
# 418
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)level;
# 424
::exit(___);}
#if 0
# 418
{
# 424
}
#endif
# 426 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 427
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex2DLod(texture< T, 2, cudaReadModeNormalizedFloat> t, float x, float y, float level)
# 428
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)level;
# 435
::exit(___);}
#if 0
# 428
{
# 435
}
#endif
# 438 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 439
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex1DLayeredLod(texture< T, 241, cudaReadModeElementType> t, float x, int layer, float level)
# 440
{int volatile ___ = 1;(void)t;(void)x;(void)layer;(void)level;
# 446
::exit(___);}
#if 0
# 440
{
# 446
}
#endif
# 448 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 449
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex1DLayeredLod(texture< T, 241, cudaReadModeNormalizedFloat> t, float x, int layer, float level)
# 450
{int volatile ___ = 1;(void)t;(void)x;(void)layer;(void)level;
# 457
::exit(___);}
#if 0
# 450
{
# 457
}
#endif
# 460 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 461
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex2DLayeredLod(texture< T, 242, cudaReadModeElementType> t, float x, float y, int layer, float level)
# 462
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)layer;(void)level;
# 468
::exit(___);}
#if 0
# 462
{
# 468
}
#endif
# 470 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 471
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex2DLayeredLod(texture< T, 242, cudaReadModeNormalizedFloat> t, float x, float y, int layer, float level)
# 472
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)layer;(void)level;
# 479
::exit(___);}
#if 0
# 472
{
# 479
}
#endif
# 482 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 483
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex3DLod(texture< T, 3, cudaReadModeElementType> t, float x, float y, float z, float level)
# 484
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)level;
# 490
::exit(___);}
#if 0
# 484
{
# 490
}
#endif
# 492 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 493
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex3DLod(texture< T, 3, cudaReadModeNormalizedFloat> t, float x, float y, float z, float level)
# 494
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)level;
# 501
::exit(___);}
#if 0
# 494
{
# 501
}
#endif
# 504 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 505
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type texCubemapLod(texture< T, 12, cudaReadModeElementType> t, float x, float y, float z, float level)
# 506
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)level;
# 512
::exit(___);}
#if 0
# 506
{
# 512
}
#endif
# 514 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 515
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type texCubemapLod(texture< T, 12, cudaReadModeNormalizedFloat> t, float x, float y, float z, float level)
# 516
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)level;
# 523
::exit(___);}
#if 0
# 516
{
# 523
}
#endif
# 527 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 528
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type texCubemapLayered(texture< T, 252, cudaReadModeElementType> t, float x, float y, float z, int layer)
# 529
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)layer;
# 535
::exit(___);}
#if 0
# 529
{
# 535
}
#endif
# 537 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 538
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type texCubemapLayered(texture< T, 252, cudaReadModeNormalizedFloat> t, float x, float y, float z, int layer)
# 539
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)layer;
# 546
::exit(___);}
#if 0
# 539
{
# 546
}
#endif
# 550 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 551
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type texCubemapLayeredLod(texture< T, 252, cudaReadModeElementType> t, float x, float y, float z, int layer, float level)
# 552
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)layer;(void)level;
# 558
::exit(___);}
#if 0
# 552
{
# 558
}
#endif
# 560 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 561
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type texCubemapLayeredLod(texture< T, 252, cudaReadModeNormalizedFloat> t, float x, float y, float z, int layer, float level)
# 562
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)layer;(void)level;
# 569
::exit(___);}
#if 0
# 562
{
# 569
}
#endif
# 573 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 574
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type texCubemapGrad(texture< T, 12, cudaReadModeElementType> t, float x, float y, float z, float4 dPdx, float4 dPdy)
# 575
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)dPdx;(void)dPdy;
# 581
::exit(___);}
#if 0
# 575
{
# 581
}
#endif
# 583 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 584
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type texCubemapGrad(texture< T, 12, cudaReadModeNormalizedFloat> t, float x, float y, float z, float4 dPdx, float4 dPdy)
# 585
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)dPdx;(void)dPdy;
# 592
::exit(___);}
#if 0
# 585
{
# 592
}
#endif
# 596 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 597
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type texCubemapLayeredGrad(texture< T, 252, cudaReadModeElementType> t, float x, float y, float z, int layer, float4 dPdx, float4 dPdy)
# 598
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)layer;(void)dPdx;(void)dPdy;
# 604
::exit(___);}
#if 0
# 598
{
# 604
}
#endif
# 606 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 607
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type texCubemapLayeredGrad(texture< T, 252, cudaReadModeNormalizedFloat> t, float x, float y, float z, int layer, float4 dPdx, float4 dPdy)
# 608
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)layer;(void)dPdx;(void)dPdy;
# 615
::exit(___);}
#if 0
# 608
{
# 615
}
#endif
# 619 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 620
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex1DGrad(texture< T, 1, cudaReadModeElementType> t, float x, float dPdx, float dPdy)
# 621
{int volatile ___ = 1;(void)t;(void)x;(void)dPdx;(void)dPdy;
# 627
::exit(___);}
#if 0
# 621
{
# 627
}
#endif
# 629 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 630
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex1DGrad(texture< T, 1, cudaReadModeNormalizedFloat> t, float x, float dPdx, float dPdy)
# 631
{int volatile ___ = 1;(void)t;(void)x;(void)dPdx;(void)dPdy;
# 638
::exit(___);}
#if 0
# 631
{
# 638
}
#endif
# 642 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 643
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex2DGrad(texture< T, 2, cudaReadModeElementType> t, float x, float y, float2 dPdx, float2 dPdy)
# 644
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)dPdx;(void)dPdy;
# 650
::exit(___);}
#if 0
# 644
{
# 650
}
#endif
# 652 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 653
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex2DGrad(texture< T, 2, cudaReadModeNormalizedFloat> t, float x, float y, float2 dPdx, float2 dPdy)
# 654
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)dPdx;(void)dPdy;
# 661
::exit(___);}
#if 0
# 654
{
# 661
}
#endif
# 664 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 665
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex1DLayeredGrad(texture< T, 241, cudaReadModeElementType> t, float x, int layer, float dPdx, float dPdy)
# 666
{int volatile ___ = 1;(void)t;(void)x;(void)layer;(void)dPdx;(void)dPdy;
# 672
::exit(___);}
#if 0
# 666
{
# 672
}
#endif
# 674 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 675
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex1DLayeredGrad(texture< T, 241, cudaReadModeNormalizedFloat> t, float x, int layer, float dPdx, float dPdy)
# 676
{int volatile ___ = 1;(void)t;(void)x;(void)layer;(void)dPdx;(void)dPdy;
# 683
::exit(___);}
#if 0
# 676
{
# 683
}
#endif
# 686 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 687
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex2DLayeredGrad(texture< T, 242, cudaReadModeElementType> t, float x, float y, int layer, float2 dPdx, float2 dPdy)
# 688
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)layer;(void)dPdx;(void)dPdy;
# 694
::exit(___);}
#if 0
# 688
{
# 694
}
#endif
# 696 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 697
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex2DLayeredGrad(texture< T, 242, cudaReadModeNormalizedFloat> t, float x, float y, int layer, float2 dPdx, float2 dPdy)
# 698
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)layer;(void)dPdx;(void)dPdy;
# 705
::exit(___);}
#if 0
# 698
{
# 705
}
#endif
# 708 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 709
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmet_ret< T> ::type tex3DGrad(texture< T, 3, cudaReadModeElementType> t, float x, float y, float z, float4 dPdx, float4 dPdy)
# 710
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)dPdx;(void)dPdy;
# 716
::exit(___);}
#if 0
# 710
{
# 716
}
#endif
# 718 "/usr/local/cuda-10.1/include/texture_fetch_functions.h" 3
template< class T>
# 719
__attribute((always_inline)) __attribute__((unused)) static inline typename __nv_tex_rmnf_ret< T> ::type tex3DGrad(texture< T, 3, cudaReadModeNormalizedFloat> t, float x, float y, float z, float4 dPdx, float4 dPdy)
# 720
{int volatile ___ = 1;(void)t;(void)x;(void)y;(void)z;(void)dPdx;(void)dPdy;
# 727
::exit(___);}
#if 0
# 720
{
# 727
}
#endif
# 60 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> struct __nv_itex_trait { };
# 61
template<> struct __nv_itex_trait< char> { typedef void type; };
# 62
template<> struct __nv_itex_trait< signed char> { typedef void type; };
# 63
template<> struct __nv_itex_trait< char1> { typedef void type; };
# 64
template<> struct __nv_itex_trait< char2> { typedef void type; };
# 65
template<> struct __nv_itex_trait< char4> { typedef void type; };
# 66
template<> struct __nv_itex_trait< unsigned char> { typedef void type; };
# 67
template<> struct __nv_itex_trait< uchar1> { typedef void type; };
# 68
template<> struct __nv_itex_trait< uchar2> { typedef void type; };
# 69
template<> struct __nv_itex_trait< uchar4> { typedef void type; };
# 70
template<> struct __nv_itex_trait< short> { typedef void type; };
# 71
template<> struct __nv_itex_trait< short1> { typedef void type; };
# 72
template<> struct __nv_itex_trait< short2> { typedef void type; };
# 73
template<> struct __nv_itex_trait< short4> { typedef void type; };
# 74
template<> struct __nv_itex_trait< unsigned short> { typedef void type; };
# 75
template<> struct __nv_itex_trait< ushort1> { typedef void type; };
# 76
template<> struct __nv_itex_trait< ushort2> { typedef void type; };
# 77
template<> struct __nv_itex_trait< ushort4> { typedef void type; };
# 78
template<> struct __nv_itex_trait< int> { typedef void type; };
# 79
template<> struct __nv_itex_trait< int1> { typedef void type; };
# 80
template<> struct __nv_itex_trait< int2> { typedef void type; };
# 81
template<> struct __nv_itex_trait< int4> { typedef void type; };
# 82
template<> struct __nv_itex_trait< unsigned> { typedef void type; };
# 83
template<> struct __nv_itex_trait< uint1> { typedef void type; };
# 84
template<> struct __nv_itex_trait< uint2> { typedef void type; };
# 85
template<> struct __nv_itex_trait< uint4> { typedef void type; };
# 96 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template<> struct __nv_itex_trait< float> { typedef void type; };
# 97
template<> struct __nv_itex_trait< float1> { typedef void type; };
# 98
template<> struct __nv_itex_trait< float2> { typedef void type; };
# 99
template<> struct __nv_itex_trait< float4> { typedef void type; };
# 103
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 104
tex1Dfetch(T *ptr, cudaTextureObject_t obj, int x)
# 105
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;
# 109
::exit(___);}
#if 0
# 105
{
# 109
}
#endif
# 111 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 112
tex1Dfetch(cudaTextureObject_t texObject, int x)
# 113
{int volatile ___ = 1;(void)texObject;(void)x;
# 119
::exit(___);}
#if 0
# 113
{
# 119
}
#endif
# 121 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 122
tex1D(T *ptr, cudaTextureObject_t obj, float x)
# 123
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;
# 127
::exit(___);}
#if 0
# 123
{
# 127
}
#endif
# 130 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 131
tex1D(cudaTextureObject_t texObject, float x)
# 132
{int volatile ___ = 1;(void)texObject;(void)x;
# 138
::exit(___);}
#if 0
# 132
{
# 138
}
#endif
# 141 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 142
tex2D(T *ptr, cudaTextureObject_t obj, float x, float y)
# 143
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;
# 147
::exit(___);}
#if 0
# 143
{
# 147
}
#endif
# 149 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 150
tex2D(cudaTextureObject_t texObject, float x, float y)
# 151
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;
# 157
::exit(___);}
#if 0
# 151
{
# 157
}
#endif
# 159 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 160
tex3D(T *ptr, cudaTextureObject_t obj, float x, float y, float z)
# 161
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)z;
# 165
::exit(___);}
#if 0
# 161
{
# 165
}
#endif
# 167 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 168
tex3D(cudaTextureObject_t texObject, float x, float y, float z)
# 169
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)z;
# 175
::exit(___);}
#if 0
# 169
{
# 175
}
#endif
# 177 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 178
tex1DLayered(T *ptr, cudaTextureObject_t obj, float x, int layer)
# 179
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)layer;
# 183
::exit(___);}
#if 0
# 179
{
# 183
}
#endif
# 185 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 186
tex1DLayered(cudaTextureObject_t texObject, float x, int layer)
# 187
{int volatile ___ = 1;(void)texObject;(void)x;(void)layer;
# 193
::exit(___);}
#if 0
# 187
{
# 193
}
#endif
# 195 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 196
tex2DLayered(T *ptr, cudaTextureObject_t obj, float x, float y, int layer)
# 197
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)layer;
# 201
::exit(___);}
#if 0
# 197
{
# 201
}
#endif
# 203 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 204
tex2DLayered(cudaTextureObject_t texObject, float x, float y, int layer)
# 205
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)layer;
# 211
::exit(___);}
#if 0
# 205
{
# 211
}
#endif
# 214 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 215
texCubemap(T *ptr, cudaTextureObject_t obj, float x, float y, float z)
# 216
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)z;
# 220
::exit(___);}
#if 0
# 216
{
# 220
}
#endif
# 223 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 224
texCubemap(cudaTextureObject_t texObject, float x, float y, float z)
# 225
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)z;
# 231
::exit(___);}
#if 0
# 225
{
# 231
}
#endif
# 234 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 235
texCubemapLayered(T *ptr, cudaTextureObject_t obj, float x, float y, float z, int layer)
# 236
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)z;(void)layer;
# 240
::exit(___);}
#if 0
# 236
{
# 240
}
#endif
# 242 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 243
texCubemapLayered(cudaTextureObject_t texObject, float x, float y, float z, int layer)
# 244
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)z;(void)layer;
# 250
::exit(___);}
#if 0
# 244
{
# 250
}
#endif
# 252 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 253
tex2Dgather(T *ptr, cudaTextureObject_t obj, float x, float y, int comp = 0)
# 254
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)comp;
# 258
::exit(___);}
#if 0
# 254
{
# 258
}
#endif
# 260 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 261
tex2Dgather(cudaTextureObject_t to, float x, float y, int comp = 0)
# 262
{int volatile ___ = 1;(void)to;(void)x;(void)y;(void)comp;
# 268
::exit(___);}
#if 0
# 262
{
# 268
}
#endif
# 272 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 273
tex1DLod(T *ptr, cudaTextureObject_t obj, float x, float level)
# 274
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)level;
# 278
::exit(___);}
#if 0
# 274
{
# 278
}
#endif
# 280 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 281
tex1DLod(cudaTextureObject_t texObject, float x, float level)
# 282
{int volatile ___ = 1;(void)texObject;(void)x;(void)level;
# 288
::exit(___);}
#if 0
# 282
{
# 288
}
#endif
# 291 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 292
tex2DLod(T *ptr, cudaTextureObject_t obj, float x, float y, float level)
# 293
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)level;
# 297
::exit(___);}
#if 0
# 293
{
# 297
}
#endif
# 299 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 300
tex2DLod(cudaTextureObject_t texObject, float x, float y, float level)
# 301
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)level;
# 307
::exit(___);}
#if 0
# 301
{
# 307
}
#endif
# 310 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 311
tex3DLod(T *ptr, cudaTextureObject_t obj, float x, float y, float z, float level)
# 312
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)z;(void)level;
# 316
::exit(___);}
#if 0
# 312
{
# 316
}
#endif
# 318 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 319
tex3DLod(cudaTextureObject_t texObject, float x, float y, float z, float level)
# 320
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)z;(void)level;
# 326
::exit(___);}
#if 0
# 320
{
# 326
}
#endif
# 329 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 330
tex1DLayeredLod(T *ptr, cudaTextureObject_t obj, float x, int layer, float level)
# 331
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)layer;(void)level;
# 335
::exit(___);}
#if 0
# 331
{
# 335
}
#endif
# 337 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 338
tex1DLayeredLod(cudaTextureObject_t texObject, float x, int layer, float level)
# 339
{int volatile ___ = 1;(void)texObject;(void)x;(void)layer;(void)level;
# 345
::exit(___);}
#if 0
# 339
{
# 345
}
#endif
# 348 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 349
tex2DLayeredLod(T *ptr, cudaTextureObject_t obj, float x, float y, int layer, float level)
# 350
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)layer;(void)level;
# 354
::exit(___);}
#if 0
# 350
{
# 354
}
#endif
# 356 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 357
tex2DLayeredLod(cudaTextureObject_t texObject, float x, float y, int layer, float level)
# 358
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)layer;(void)level;
# 364
::exit(___);}
#if 0
# 358
{
# 364
}
#endif
# 367 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 368
texCubemapLod(T *ptr, cudaTextureObject_t obj, float x, float y, float z, float level)
# 369
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)z;(void)level;
# 373
::exit(___);}
#if 0
# 369
{
# 373
}
#endif
# 375 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 376
texCubemapLod(cudaTextureObject_t texObject, float x, float y, float z, float level)
# 377
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)z;(void)level;
# 383
::exit(___);}
#if 0
# 377
{
# 383
}
#endif
# 386 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 387
texCubemapGrad(T *ptr, cudaTextureObject_t obj, float x, float y, float z, float4 dPdx, float4 dPdy)
# 388
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)z;(void)dPdx;(void)dPdy;
# 392
::exit(___);}
#if 0
# 388
{
# 392
}
#endif
# 394 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 395
texCubemapGrad(cudaTextureObject_t texObject, float x, float y, float z, float4 dPdx, float4 dPdy)
# 396
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)z;(void)dPdx;(void)dPdy;
# 402
::exit(___);}
#if 0
# 396
{
# 402
}
#endif
# 404 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 405
texCubemapLayeredLod(T *ptr, cudaTextureObject_t obj, float x, float y, float z, int layer, float level)
# 406
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)z;(void)layer;(void)level;
# 410
::exit(___);}
#if 0
# 406
{
# 410
}
#endif
# 412 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 413
texCubemapLayeredLod(cudaTextureObject_t texObject, float x, float y, float z, int layer, float level)
# 414
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)z;(void)layer;(void)level;
# 420
::exit(___);}
#if 0
# 414
{
# 420
}
#endif
# 422 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 423
tex1DGrad(T *ptr, cudaTextureObject_t obj, float x, float dPdx, float dPdy)
# 424
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)dPdx;(void)dPdy;
# 428
::exit(___);}
#if 0
# 424
{
# 428
}
#endif
# 430 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 431
tex1DGrad(cudaTextureObject_t texObject, float x, float dPdx, float dPdy)
# 432
{int volatile ___ = 1;(void)texObject;(void)x;(void)dPdx;(void)dPdy;
# 438
::exit(___);}
#if 0
# 432
{
# 438
}
#endif
# 441 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 442
tex2DGrad(T *ptr, cudaTextureObject_t obj, float x, float y, float2 dPdx, float2 dPdy)
# 443
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)dPdx;(void)dPdy;
# 448
::exit(___);}
#if 0
# 443
{
# 448
}
#endif
# 450 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 451
tex2DGrad(cudaTextureObject_t texObject, float x, float y, float2 dPdx, float2 dPdy)
# 452
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)dPdx;(void)dPdy;
# 458
::exit(___);}
#if 0
# 452
{
# 458
}
#endif
# 461 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 462
tex3DGrad(T *ptr, cudaTextureObject_t obj, float x, float y, float z, float4 dPdx, float4 dPdy)
# 463
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)z;(void)dPdx;(void)dPdy;
# 467
::exit(___);}
#if 0
# 463
{
# 467
}
#endif
# 469 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 470
tex3DGrad(cudaTextureObject_t texObject, float x, float y, float z, float4 dPdx, float4 dPdy)
# 471
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)z;(void)dPdx;(void)dPdy;
# 477
::exit(___);}
#if 0
# 471
{
# 477
}
#endif
# 480 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 481
tex1DLayeredGrad(T *ptr, cudaTextureObject_t obj, float x, int layer, float dPdx, float dPdy)
# 482
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)layer;(void)dPdx;(void)dPdy;
# 486
::exit(___);}
#if 0
# 482
{
# 486
}
#endif
# 488 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 489
tex1DLayeredGrad(cudaTextureObject_t texObject, float x, int layer, float dPdx, float dPdy)
# 490
{int volatile ___ = 1;(void)texObject;(void)x;(void)layer;(void)dPdx;(void)dPdy;
# 496
::exit(___);}
#if 0
# 490
{
# 496
}
#endif
# 499 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 500
tex2DLayeredGrad(T *ptr, cudaTextureObject_t obj, float x, float y, int layer, float2 dPdx, float2 dPdy)
# 501
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)layer;(void)dPdx;(void)dPdy;
# 505
::exit(___);}
#if 0
# 501
{
# 505
}
#endif
# 507 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 508
tex2DLayeredGrad(cudaTextureObject_t texObject, float x, float y, int layer, float2 dPdx, float2 dPdy)
# 509
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)layer;(void)dPdx;(void)dPdy;
# 515
::exit(___);}
#if 0
# 509
{
# 515
}
#endif
# 518 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_itex_trait< T> ::type
# 519
texCubemapLayeredGrad(T *ptr, cudaTextureObject_t obj, float x, float y, float z, int layer, float4 dPdx, float4 dPdy)
# 520
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)z;(void)layer;(void)dPdx;(void)dPdy;
# 524
::exit(___);}
#if 0
# 520
{
# 524
}
#endif
# 526 "/usr/local/cuda-10.1/include/texture_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 527
texCubemapLayeredGrad(cudaTextureObject_t texObject, float x, float y, float z, int layer, float4 dPdx, float4 dPdy)
# 528
{int volatile ___ = 1;(void)texObject;(void)x;(void)y;(void)z;(void)layer;(void)dPdx;(void)dPdy;
# 534
::exit(___);}
#if 0
# 528
{
# 534
}
#endif
# 59 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> struct __nv_isurf_trait { };
# 60
template<> struct __nv_isurf_trait< char> { typedef void type; };
# 61
template<> struct __nv_isurf_trait< signed char> { typedef void type; };
# 62
template<> struct __nv_isurf_trait< char1> { typedef void type; };
# 63
template<> struct __nv_isurf_trait< unsigned char> { typedef void type; };
# 64
template<> struct __nv_isurf_trait< uchar1> { typedef void type; };
# 65
template<> struct __nv_isurf_trait< short> { typedef void type; };
# 66
template<> struct __nv_isurf_trait< short1> { typedef void type; };
# 67
template<> struct __nv_isurf_trait< unsigned short> { typedef void type; };
# 68
template<> struct __nv_isurf_trait< ushort1> { typedef void type; };
# 69
template<> struct __nv_isurf_trait< int> { typedef void type; };
# 70
template<> struct __nv_isurf_trait< int1> { typedef void type; };
# 71
template<> struct __nv_isurf_trait< unsigned> { typedef void type; };
# 72
template<> struct __nv_isurf_trait< uint1> { typedef void type; };
# 73
template<> struct __nv_isurf_trait< long long> { typedef void type; };
# 74
template<> struct __nv_isurf_trait< longlong1> { typedef void type; };
# 75
template<> struct __nv_isurf_trait< unsigned long long> { typedef void type; };
# 76
template<> struct __nv_isurf_trait< ulonglong1> { typedef void type; };
# 77
template<> struct __nv_isurf_trait< float> { typedef void type; };
# 78
template<> struct __nv_isurf_trait< float1> { typedef void type; };
# 80
template<> struct __nv_isurf_trait< char2> { typedef void type; };
# 81
template<> struct __nv_isurf_trait< uchar2> { typedef void type; };
# 82
template<> struct __nv_isurf_trait< short2> { typedef void type; };
# 83
template<> struct __nv_isurf_trait< ushort2> { typedef void type; };
# 84
template<> struct __nv_isurf_trait< int2> { typedef void type; };
# 85
template<> struct __nv_isurf_trait< uint2> { typedef void type; };
# 86
template<> struct __nv_isurf_trait< longlong2> { typedef void type; };
# 87
template<> struct __nv_isurf_trait< ulonglong2> { typedef void type; };
# 88
template<> struct __nv_isurf_trait< float2> { typedef void type; };
# 90
template<> struct __nv_isurf_trait< char4> { typedef void type; };
# 91
template<> struct __nv_isurf_trait< uchar4> { typedef void type; };
# 92
template<> struct __nv_isurf_trait< short4> { typedef void type; };
# 93
template<> struct __nv_isurf_trait< ushort4> { typedef void type; };
# 94
template<> struct __nv_isurf_trait< int4> { typedef void type; };
# 95
template<> struct __nv_isurf_trait< uint4> { typedef void type; };
# 96
template<> struct __nv_isurf_trait< float4> { typedef void type; };
# 99
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 100
surf1Dread(T *ptr, cudaSurfaceObject_t obj, int x, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 101
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)mode;
# 105
::exit(___);}
#if 0
# 101
{
# 105
}
#endif
# 107 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 108
surf1Dread(cudaSurfaceObject_t surfObject, int x, cudaSurfaceBoundaryMode boundaryMode = cudaBoundaryModeTrap)
# 109
{int volatile ___ = 1;(void)surfObject;(void)x;(void)boundaryMode;
# 115
::exit(___);}
#if 0
# 109
{
# 115
}
#endif
# 117 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 118
surf2Dread(T *ptr, cudaSurfaceObject_t obj, int x, int y, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 119
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)mode;
# 123
::exit(___);}
#if 0
# 119
{
# 123
}
#endif
# 125 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 126
surf2Dread(cudaSurfaceObject_t surfObject, int x, int y, cudaSurfaceBoundaryMode boundaryMode = cudaBoundaryModeTrap)
# 127
{int volatile ___ = 1;(void)surfObject;(void)x;(void)y;(void)boundaryMode;
# 133
::exit(___);}
#if 0
# 127
{
# 133
}
#endif
# 136 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 137
surf3Dread(T *ptr, cudaSurfaceObject_t obj, int x, int y, int z, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 138
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)z;(void)mode;
# 142
::exit(___);}
#if 0
# 138
{
# 142
}
#endif
# 144 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 145
surf3Dread(cudaSurfaceObject_t surfObject, int x, int y, int z, cudaSurfaceBoundaryMode boundaryMode = cudaBoundaryModeTrap)
# 146
{int volatile ___ = 1;(void)surfObject;(void)x;(void)y;(void)z;(void)boundaryMode;
# 152
::exit(___);}
#if 0
# 146
{
# 152
}
#endif
# 154 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 155
surf1DLayeredread(T *ptr, cudaSurfaceObject_t obj, int x, int layer, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 156
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)layer;(void)mode;
# 160
::exit(___);}
#if 0
# 156
{
# 160
}
#endif
# 162 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 163
surf1DLayeredread(cudaSurfaceObject_t surfObject, int x, int layer, cudaSurfaceBoundaryMode boundaryMode = cudaBoundaryModeTrap)
# 164
{int volatile ___ = 1;(void)surfObject;(void)x;(void)layer;(void)boundaryMode;
# 170
::exit(___);}
#if 0
# 164
{
# 170
}
#endif
# 172 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 173
surf2DLayeredread(T *ptr, cudaSurfaceObject_t obj, int x, int y, int layer, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 174
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)layer;(void)mode;
# 178
::exit(___);}
#if 0
# 174
{
# 178
}
#endif
# 180 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 181
surf2DLayeredread(cudaSurfaceObject_t surfObject, int x, int y, int layer, cudaSurfaceBoundaryMode boundaryMode = cudaBoundaryModeTrap)
# 182
{int volatile ___ = 1;(void)surfObject;(void)x;(void)y;(void)layer;(void)boundaryMode;
# 188
::exit(___);}
#if 0
# 182
{
# 188
}
#endif
# 190 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 191
surfCubemapread(T *ptr, cudaSurfaceObject_t obj, int x, int y, int face, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 192
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)face;(void)mode;
# 196
::exit(___);}
#if 0
# 192
{
# 196
}
#endif
# 198 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 199
surfCubemapread(cudaSurfaceObject_t surfObject, int x, int y, int face, cudaSurfaceBoundaryMode boundaryMode = cudaBoundaryModeTrap)
# 200
{int volatile ___ = 1;(void)surfObject;(void)x;(void)y;(void)face;(void)boundaryMode;
# 206
::exit(___);}
#if 0
# 200
{
# 206
}
#endif
# 208 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 209
surfCubemapLayeredread(T *ptr, cudaSurfaceObject_t obj, int x, int y, int layerface, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 210
{int volatile ___ = 1;(void)ptr;(void)obj;(void)x;(void)y;(void)layerface;(void)mode;
# 214
::exit(___);}
#if 0
# 210
{
# 214
}
#endif
# 216 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static T
# 217
surfCubemapLayeredread(cudaSurfaceObject_t surfObject, int x, int y, int layerface, cudaSurfaceBoundaryMode boundaryMode = cudaBoundaryModeTrap)
# 218
{int volatile ___ = 1;(void)surfObject;(void)x;(void)y;(void)layerface;(void)boundaryMode;
# 224
::exit(___);}
#if 0
# 218
{
# 224
}
#endif
# 226 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 227
surf1Dwrite(T val, cudaSurfaceObject_t obj, int x, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 228
{int volatile ___ = 1;(void)val;(void)obj;(void)x;(void)mode;
# 232
::exit(___);}
#if 0
# 228
{
# 232
}
#endif
# 234 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 235
surf2Dwrite(T val, cudaSurfaceObject_t obj, int x, int y, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 236
{int volatile ___ = 1;(void)val;(void)obj;(void)x;(void)y;(void)mode;
# 240
::exit(___);}
#if 0
# 236
{
# 240
}
#endif
# 242 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 243
surf3Dwrite(T val, cudaSurfaceObject_t obj, int x, int y, int z, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 244
{int volatile ___ = 1;(void)val;(void)obj;(void)x;(void)y;(void)z;(void)mode;
# 248
::exit(___);}
#if 0
# 244
{
# 248
}
#endif
# 250 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 251
surf1DLayeredwrite(T val, cudaSurfaceObject_t obj, int x, int layer, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 252
{int volatile ___ = 1;(void)val;(void)obj;(void)x;(void)layer;(void)mode;
# 256
::exit(___);}
#if 0
# 252
{
# 256
}
#endif
# 258 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 259
surf2DLayeredwrite(T val, cudaSurfaceObject_t obj, int x, int y, int layer, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 260
{int volatile ___ = 1;(void)val;(void)obj;(void)x;(void)y;(void)layer;(void)mode;
# 264
::exit(___);}
#if 0
# 260
{
# 264
}
#endif
# 266 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 267
surfCubemapwrite(T val, cudaSurfaceObject_t obj, int x, int y, int face, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 268
{int volatile ___ = 1;(void)val;(void)obj;(void)x;(void)y;(void)face;(void)mode;
# 272
::exit(___);}
#if 0
# 268
{
# 272
}
#endif
# 274 "/usr/local/cuda-10.1/include/surface_indirect_functions.h" 3
template< class T> __attribute__((unused)) static typename __nv_isurf_trait< T> ::type
# 275
surfCubemapLayeredwrite(T val, cudaSurfaceObject_t obj, int x, int y, int layerface, cudaSurfaceBoundaryMode mode = cudaBoundaryModeTrap)
# 276
{int volatile ___ = 1;(void)val;(void)obj;(void)x;(void)y;(void)layerface;(void)mode;
# 280
::exit(___);}
#if 0
# 276
{
# 280
}
#endif
# 3296 "/usr/local/cuda-10.1/include/crt/device_functions.h" 3
extern "C" unsigned __cudaPushCallConfiguration(dim3 gridDim, dim3 blockDim, size_t sharedMem = 0, CUstream_st * stream = 0);
# 68 "/usr/local/cuda-10.1/include/device_launch_parameters.h" 3
extern "C" {
# 71
extern const uint3 __device_builtin_variable_threadIdx;
# 72
extern const uint3 __device_builtin_variable_blockIdx;
# 73
extern const dim3 __device_builtin_variable_blockDim;
# 74
extern const dim3 __device_builtin_variable_gridDim;
# 75
extern const int __device_builtin_variable_warpSize;
# 80
}
# 199 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 200
cudaLaunchKernel(const T *
# 201
func, dim3
# 202
gridDim, dim3
# 203
blockDim, void **
# 204
args, size_t
# 205
sharedMem = 0, cudaStream_t
# 206
stream = 0)
# 208
{
# 209
return ::cudaLaunchKernel((const void *)func, gridDim, blockDim, args, sharedMem, stream);
# 210
}
# 261 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 262
cudaLaunchCooperativeKernel(const T *
# 263
func, dim3
# 264
gridDim, dim3
# 265
blockDim, void **
# 266
args, size_t
# 267
sharedMem = 0, cudaStream_t
# 268
stream = 0)
# 270
{
# 271
return ::cudaLaunchCooperativeKernel((const void *)func, gridDim, blockDim, args, sharedMem, stream);
# 272
}
# 305 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
static inline cudaError_t cudaEventCreate(cudaEvent_t *
# 306
event, unsigned
# 307
flags)
# 309
{
# 310
return ::cudaEventCreateWithFlags(event, flags);
# 311
}
# 370 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
static inline cudaError_t cudaMallocHost(void **
# 371
ptr, size_t
# 372
size, unsigned
# 373
flags)
# 375
{
# 376
return ::cudaHostAlloc(ptr, size, flags);
# 377
}
# 379
template< class T> static inline cudaError_t
# 380
cudaHostAlloc(T **
# 381
ptr, size_t
# 382
size, unsigned
# 383
flags)
# 385
{
# 386
return ::cudaHostAlloc((void **)((void *)ptr), size, flags);
# 387
}
# 389
template< class T> static inline cudaError_t
# 390
cudaHostGetDevicePointer(T **
# 391
pDevice, void *
# 392
pHost, unsigned
# 393
flags)
# 395
{
# 396
return ::cudaHostGetDevicePointer((void **)((void *)pDevice), pHost, flags);
# 397
}
# 499 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 500
cudaMallocManaged(T **
# 501
devPtr, size_t
# 502
size, unsigned
# 503
flags = 1)
# 505
{
# 506
return ::cudaMallocManaged((void **)((void *)devPtr), size, flags);
# 507
}
# 589 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 590
cudaStreamAttachMemAsync(cudaStream_t
# 591
stream, T *
# 592
devPtr, size_t
# 593
length = 0, unsigned
# 594
flags = 4)
# 596
{
# 597
return ::cudaStreamAttachMemAsync(stream, (void *)devPtr, length, flags);
# 598
}
# 600
template< class T> inline cudaError_t
# 601
cudaMalloc(T **
# 602
devPtr, size_t
# 603
size)
# 605
{
# 606
return ::cudaMalloc((void **)((void *)devPtr), size);
# 607
}
# 609
template< class T> static inline cudaError_t
# 610
cudaMallocHost(T **
# 611
ptr, size_t
# 612
size, unsigned
# 613
flags = 0)
# 615
{
# 616
return cudaMallocHost((void **)((void *)ptr), size, flags);
# 617
}
# 619
template< class T> static inline cudaError_t
# 620
cudaMallocPitch(T **
# 621
devPtr, size_t *
# 622
pitch, size_t
# 623
width, size_t
# 624
height)
# 626
{
# 627
return ::cudaMallocPitch((void **)((void *)devPtr), pitch, width, height);
# 628
}
# 667 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 668
cudaMemcpyToSymbol(const T &
# 669
symbol, const void *
# 670
src, size_t
# 671
count, size_t
# 672
offset = 0, cudaMemcpyKind
# 673
kind = cudaMemcpyHostToDevice)
# 675
{
# 676
return ::cudaMemcpyToSymbol((const void *)(&symbol), src, count, offset, kind);
# 677
}
# 721 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 722
cudaMemcpyToSymbolAsync(const T &
# 723
symbol, const void *
# 724
src, size_t
# 725
count, size_t
# 726
offset = 0, cudaMemcpyKind
# 727
kind = cudaMemcpyHostToDevice, cudaStream_t
# 728
stream = 0)
# 730
{
# 731
return ::cudaMemcpyToSymbolAsync((const void *)(&symbol), src, count, offset, kind, stream);
# 732
}
# 769 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 770
cudaMemcpyFromSymbol(void *
# 771
dst, const T &
# 772
symbol, size_t
# 773
count, size_t
# 774
offset = 0, cudaMemcpyKind
# 775
kind = cudaMemcpyDeviceToHost)
# 777
{
# 778
return ::cudaMemcpyFromSymbol(dst, (const void *)(&symbol), count, offset, kind);
# 779
}
# 823 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 824
cudaMemcpyFromSymbolAsync(void *
# 825
dst, const T &
# 826
symbol, size_t
# 827
count, size_t
# 828
offset = 0, cudaMemcpyKind
# 829
kind = cudaMemcpyDeviceToHost, cudaStream_t
# 830
stream = 0)
# 832
{
# 833
return ::cudaMemcpyFromSymbolAsync(dst, (const void *)(&symbol), count, offset, kind, stream);
# 834
}
# 859 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 860
cudaGetSymbolAddress(void **
# 861
devPtr, const T &
# 862
symbol)
# 864
{
# 865
return ::cudaGetSymbolAddress(devPtr, (const void *)(&symbol));
# 866
}
# 891 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 892
cudaGetSymbolSize(size_t *
# 893
size, const T &
# 894
symbol)
# 896
{
# 897
return ::cudaGetSymbolSize(size, (const void *)(&symbol));
# 898
}
# 935 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T, int dim, cudaTextureReadMode readMode> static inline cudaError_t
# 936
cudaBindTexture(size_t *
# 937
offset, const texture< T, dim, readMode> &
# 938
tex, const void *
# 939
devPtr, const cudaChannelFormatDesc &
# 940
desc, size_t
# 941
size = ((2147483647) * 2U) + 1U)
# 943
{
# 944
return ::cudaBindTexture(offset, &tex, devPtr, &desc, size);
# 945
}
# 981 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T, int dim, cudaTextureReadMode readMode> static inline cudaError_t
# 982
cudaBindTexture(size_t *
# 983
offset, const texture< T, dim, readMode> &
# 984
tex, const void *
# 985
devPtr, size_t
# 986
size = ((2147483647) * 2U) + 1U)
# 988
{
# 989
return cudaBindTexture(offset, tex, devPtr, (tex.channelDesc), size);
# 990
}
# 1038 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T, int dim, cudaTextureReadMode readMode> static inline cudaError_t
# 1039
cudaBindTexture2D(size_t *
# 1040
offset, const texture< T, dim, readMode> &
# 1041
tex, const void *
# 1042
devPtr, const cudaChannelFormatDesc &
# 1043
desc, size_t
# 1044
width, size_t
# 1045
height, size_t
# 1046
pitch)
# 1048
{
# 1049
return ::cudaBindTexture2D(offset, &tex, devPtr, &desc, width, height, pitch);
# 1050
}
# 1097 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T, int dim, cudaTextureReadMode readMode> static inline cudaError_t
# 1098
cudaBindTexture2D(size_t *
# 1099
offset, const texture< T, dim, readMode> &
# 1100
tex, const void *
# 1101
devPtr, size_t
# 1102
width, size_t
# 1103
height, size_t
# 1104
pitch)
# 1106
{
# 1107
return ::cudaBindTexture2D(offset, &tex, devPtr, &(tex.channelDesc), width, height, pitch);
# 1108
}
# 1140 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T, int dim, cudaTextureReadMode readMode> static inline cudaError_t
# 1141
cudaBindTextureToArray(const texture< T, dim, readMode> &
# 1142
tex, cudaArray_const_t
# 1143
array, const cudaChannelFormatDesc &
# 1144
desc)
# 1146
{
# 1147
return ::cudaBindTextureToArray(&tex, array, &desc);
# 1148
}
# 1179 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T, int dim, cudaTextureReadMode readMode> static inline cudaError_t
# 1180
cudaBindTextureToArray(const texture< T, dim, readMode> &
# 1181
tex, cudaArray_const_t
# 1182
array)
# 1184
{
# 1185
cudaChannelFormatDesc desc;
# 1186
cudaError_t err = ::cudaGetChannelDesc(&desc, array);
# 1188
return (err == (cudaSuccess)) ? cudaBindTextureToArray(tex, array, desc) : err;
# 1189
}
# 1221 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T, int dim, cudaTextureReadMode readMode> static inline cudaError_t
# 1222
cudaBindTextureToMipmappedArray(const texture< T, dim, readMode> &
# 1223
tex, cudaMipmappedArray_const_t
# 1224
mipmappedArray, const cudaChannelFormatDesc &
# 1225
desc)
# 1227
{
# 1228
return ::cudaBindTextureToMipmappedArray(&tex, mipmappedArray, &desc);
# 1229
}
# 1260 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T, int dim, cudaTextureReadMode readMode> static inline cudaError_t
# 1261
cudaBindTextureToMipmappedArray(const texture< T, dim, readMode> &
# 1262
tex, cudaMipmappedArray_const_t
# 1263
mipmappedArray)
# 1265
{
# 1266
cudaChannelFormatDesc desc;
# 1267
cudaArray_t levelArray;
# 1268
cudaError_t err = ::cudaGetMipmappedArrayLevel(&levelArray, mipmappedArray, 0);
# 1270
if (err != (cudaSuccess)) {
# 1271
return err;
# 1272
}
# 1273
err = ::cudaGetChannelDesc(&desc, levelArray);
# 1275
return (err == (cudaSuccess)) ? cudaBindTextureToMipmappedArray(tex, mipmappedArray, desc) : err;
# 1276
}
# 1303 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T, int dim, cudaTextureReadMode readMode> static inline cudaError_t
# 1304
cudaUnbindTexture(const texture< T, dim, readMode> &
# 1305
tex)
# 1307
{
# 1308
return ::cudaUnbindTexture(&tex);
# 1309
}
# 1339 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T, int dim, cudaTextureReadMode readMode> static inline cudaError_t
# 1340
cudaGetTextureAlignmentOffset(size_t *
# 1341
offset, const texture< T, dim, readMode> &
# 1342
tex)
# 1344
{
# 1345
return ::cudaGetTextureAlignmentOffset(offset, &tex);
# 1346
}
# 1391 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 1392
cudaFuncSetCacheConfig(T *
# 1393
func, cudaFuncCache
# 1394
cacheConfig)
# 1396
{
# 1397
return ::cudaFuncSetCacheConfig((const void *)func, cacheConfig);
# 1398
}
# 1400
template< class T> static inline cudaError_t
# 1401
cudaFuncSetSharedMemConfig(T *
# 1402
func, cudaSharedMemConfig
# 1403
config)
# 1405
{
# 1406
return ::cudaFuncSetSharedMemConfig((const void *)func, config);
# 1407
}
# 1436 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> inline cudaError_t
# 1437
cudaOccupancyMaxActiveBlocksPerMultiprocessor(int *
# 1438
numBlocks, T
# 1439
func, int
# 1440
blockSize, size_t
# 1441
dynamicSMemSize)
# 1442
{
# 1443
return ::cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, (const void *)func, blockSize, dynamicSMemSize, 0);
# 1444
}
# 1487 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> inline cudaError_t
# 1488
cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *
# 1489
numBlocks, T
# 1490
func, int
# 1491
blockSize, size_t
# 1492
dynamicSMemSize, unsigned
# 1493
flags)
# 1494
{
# 1495
return ::cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, (const void *)func, blockSize, dynamicSMemSize, flags);
# 1496
}
# 1501
class __cudaOccupancyB2DHelper {
# 1502
size_t n;
# 1504
public: __cudaOccupancyB2DHelper(size_t n_) : n(n_) { }
# 1505
size_t operator()(int)
# 1506
{
# 1507
return n;
# 1508
}
# 1509
};
# 1556 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class UnaryFunction, class T> static inline cudaError_t
# 1557
cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags(int *
# 1558
minGridSize, int *
# 1559
blockSize, T
# 1560
func, UnaryFunction
# 1561
blockSizeToDynamicSMemSize, int
# 1562
blockSizeLimit = 0, unsigned
# 1563
flags = 0)
# 1564
{
# 1565
cudaError_t status;
# 1568
int device;
# 1569
cudaFuncAttributes attr;
# 1572
int maxThreadsPerMultiProcessor;
# 1573
int warpSize;
# 1574
int devMaxThreadsPerBlock;
# 1575
int multiProcessorCount;
# 1576
int funcMaxThreadsPerBlock;
# 1577
int occupancyLimit;
# 1578
int granularity;
# 1581
int maxBlockSize = 0;
# 1582
int numBlocks = 0;
# 1583
int maxOccupancy = 0;
# 1586
int blockSizeToTryAligned;
# 1587
int blockSizeToTry;
# 1588
int blockSizeLimitAligned;
# 1589
int occupancyInBlocks;
# 1590
int occupancyInThreads;
# 1591
size_t dynamicSMemSize;
# 1597
if (((!minGridSize) || (!blockSize)) || (!func)) {
# 1598
return cudaErrorInvalidValue;
# 1599
}
# 1605
status = ::cudaGetDevice(&device);
# 1606
if (status != (cudaSuccess)) {
# 1607
return status;
# 1608
}
# 1610
status = cudaDeviceGetAttribute(&maxThreadsPerMultiProcessor, cudaDevAttrMaxThreadsPerMultiProcessor, device);
# 1614
if (status != (cudaSuccess)) {
# 1615
return status;
# 1616
}
# 1618
status = cudaDeviceGetAttribute(&warpSize, cudaDevAttrWarpSize, device);
# 1622
if (status != (cudaSuccess)) {
# 1623
return status;
# 1624
}
# 1626
status = cudaDeviceGetAttribute(&devMaxThreadsPerBlock, cudaDevAttrMaxThreadsPerBlock, device);
# 1630
if (status != (cudaSuccess)) {
# 1631
return status;
# 1632
}
# 1634
status = cudaDeviceGetAttribute(&multiProcessorCount, cudaDevAttrMultiProcessorCount, device);
# 1638
if (status != (cudaSuccess)) {
# 1639
return status;
# 1640
}
# 1642
status = cudaFuncGetAttributes(&attr, func);
# 1643
if (status != (cudaSuccess)) {
# 1644
return status;
# 1645
}
# 1647
funcMaxThreadsPerBlock = (attr.maxThreadsPerBlock);
# 1653
occupancyLimit = maxThreadsPerMultiProcessor;
# 1654
granularity = warpSize;
# 1656
if (blockSizeLimit == 0) {
# 1657
blockSizeLimit = devMaxThreadsPerBlock;
# 1658
}
# 1660
if (devMaxThreadsPerBlock < blockSizeLimit) {
# 1661
blockSizeLimit = devMaxThreadsPerBlock;
# 1662
}
# 1664
if (funcMaxThreadsPerBlock < blockSizeLimit) {
# 1665
blockSizeLimit = funcMaxThreadsPerBlock;
# 1666
}
# 1668
blockSizeLimitAligned = (((blockSizeLimit + (granularity - 1)) / granularity) * granularity);
# 1670
for (blockSizeToTryAligned = blockSizeLimitAligned; blockSizeToTryAligned > 0; blockSizeToTryAligned -= granularity) {
# 1674
if (blockSizeLimit < blockSizeToTryAligned) {
# 1675
blockSizeToTry = blockSizeLimit;
# 1676
} else {
# 1677
blockSizeToTry = blockSizeToTryAligned;
# 1678
}
# 1680
dynamicSMemSize = blockSizeToDynamicSMemSize(blockSizeToTry);
# 1682
status = cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(&occupancyInBlocks, func, blockSizeToTry, dynamicSMemSize, flags);
# 1689
if (status != (cudaSuccess)) {
# 1690
return status;
# 1691
}
# 1693
occupancyInThreads = (blockSizeToTry * occupancyInBlocks);
# 1695
if (occupancyInThreads > maxOccupancy) {
# 1696
maxBlockSize = blockSizeToTry;
# 1697
numBlocks = occupancyInBlocks;
# 1698
maxOccupancy = occupancyInThreads;
# 1699
}
# 1703
if (occupancyLimit == maxOccupancy) {
# 1704
break;
# 1705
}
# 1706
}
# 1714
(*minGridSize) = (numBlocks * multiProcessorCount);
# 1715
(*blockSize) = maxBlockSize;
# 1717
return status;
# 1718
}
# 1751 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class UnaryFunction, class T> static inline cudaError_t
# 1752
cudaOccupancyMaxPotentialBlockSizeVariableSMem(int *
# 1753
minGridSize, int *
# 1754
blockSize, T
# 1755
func, UnaryFunction
# 1756
blockSizeToDynamicSMemSize, int
# 1757
blockSizeLimit = 0)
# 1758
{
# 1759
return cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags(minGridSize, blockSize, func, blockSizeToDynamicSMemSize, blockSizeLimit, 0);
# 1760
}
# 1796 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 1797
cudaOccupancyMaxPotentialBlockSize(int *
# 1798
minGridSize, int *
# 1799
blockSize, T
# 1800
func, size_t
# 1801
dynamicSMemSize = 0, int
# 1802
blockSizeLimit = 0)
# 1803
{
# 1804
return cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags(minGridSize, blockSize, func, ((__cudaOccupancyB2DHelper)(dynamicSMemSize)), blockSizeLimit, 0);
# 1805
}
# 1855 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 1856
cudaOccupancyMaxPotentialBlockSizeWithFlags(int *
# 1857
minGridSize, int *
# 1858
blockSize, T
# 1859
func, size_t
# 1860
dynamicSMemSize = 0, int
# 1861
blockSizeLimit = 0, unsigned
# 1862
flags = 0)
# 1863
{
# 1864
return cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags(minGridSize, blockSize, func, ((__cudaOccupancyB2DHelper)(dynamicSMemSize)), blockSizeLimit, flags);
# 1865
}
# 1896 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> inline cudaError_t
# 1897
cudaFuncGetAttributes(cudaFuncAttributes *
# 1898
attr, T *
# 1899
entry)
# 1901
{
# 1902
return ::cudaFuncGetAttributes(attr, (const void *)entry);
# 1903
}
# 1941 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T> static inline cudaError_t
# 1942
cudaFuncSetAttribute(T *
# 1943
entry, cudaFuncAttribute
# 1944
attr, int
# 1945
value)
# 1947
{
# 1948
return ::cudaFuncSetAttribute((const void *)entry, attr, value);
# 1949
}
# 1973 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T, int dim>
# 1974
__attribute((deprecated)) static inline cudaError_t cudaBindSurfaceToArray(const surface< T, dim> &
# 1975
surf, cudaArray_const_t
# 1976
array, const cudaChannelFormatDesc &
# 1977
desc)
# 1979
{
# 1980
return ::cudaBindSurfaceToArray(&surf, array, &desc);
# 1981
}
# 2004 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
template< class T, int dim>
# 2005
__attribute((deprecated)) static inline cudaError_t cudaBindSurfaceToArray(const surface< T, dim> &
# 2006
surf, cudaArray_const_t
# 2007
array)
# 2009
{
# 2010
cudaChannelFormatDesc desc;
# 2011
cudaError_t err = ::cudaGetChannelDesc(&desc, array);
# 2013
return (err == (cudaSuccess)) ? cudaBindSurfaceToArray(surf, array, desc) : err;
# 2014
}
# 2025 "/usr/local/cuda-10.1/include/cuda_runtime.h" 3
#pragma GCC diagnostic pop
# 65 "/usr/include/assert.h" 3
extern "C" {
# 68
extern void __assert_fail(const char * __assertion, const char * __file, unsigned __line, const char * __function) throw()
# 70
__attribute((__noreturn__));
# 73
extern void __assert_perror_fail(int __errnum, const char * __file, unsigned __line, const char * __function) throw()
# 75
__attribute((__noreturn__));
# 80
extern void __assert(const char * __assertion, const char * __file, int __line) throw()
# 81
__attribute((__noreturn__));
# 84
}
# 40 "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/stdarg.h" 3
typedef __builtin_va_list __gnuc_va_list;
# 98 "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/stdarg.h" 3
typedef __gnuc_va_list va_list;
# 29 "/usr/include/stdio.h" 3
extern "C" {
# 44 "/usr/include/stdio.h" 3
struct _IO_FILE;
# 48
typedef _IO_FILE FILE;
# 64 "/usr/include/stdio.h" 3
typedef _IO_FILE __FILE;
# 94 "/usr/include/wchar.h" 3
typedef
# 83
struct {
# 84
int __count;
# 86
union {
# 88
unsigned __wch;
# 92
char __wchb[4];
# 93
} __value;
# 94
} __mbstate_t;
# 25 "/usr/include/_G_config.h" 3
typedef
# 22
struct {
# 23
__off_t __pos;
# 24
__mbstate_t __state;
# 25
} _G_fpos_t;
# 30
typedef
# 27
struct {
# 28
__off64_t __pos;
# 29
__mbstate_t __state;
# 30
} _G_fpos64_t;
# 145 "/usr/include/libio.h" 3
struct _IO_jump_t; struct _IO_FILE;
# 155 "/usr/include/libio.h" 3
typedef void _IO_lock_t;
# 161
struct _IO_marker {
# 162
_IO_marker *_next;
# 163
_IO_FILE *_sbuf;
# 167
int _pos;
# 178 "/usr/include/libio.h" 3
};
# 181
enum __codecvt_result {
# 183
__codecvt_ok,
# 184
__codecvt_partial,
# 185
__codecvt_error,
# 186
__codecvt_noconv
# 187
};
# 246 "/usr/include/libio.h" 3
struct _IO_FILE {
# 247
int _flags;
# 252
char *_IO_read_ptr;
# 253
char *_IO_read_end;
# 254
char *_IO_read_base;
# 255
char *_IO_write_base;
# 256
char *_IO_write_ptr;
# 257
char *_IO_write_end;
# 258
char *_IO_buf_base;
# 259
char *_IO_buf_end;
# 261
char *_IO_save_base;
# 262
char *_IO_backup_base;
# 263
char *_IO_save_end;
# 265
_IO_marker *_markers;
# 267
_IO_FILE *_chain;
# 269
int _fileno;
# 273
int _flags2;
# 275
__off_t _old_offset;
# 279
unsigned short _cur_column;
# 280
signed char _vtable_offset;
# 281
char _shortbuf[1];
# 285
_IO_lock_t *_lock;
# 294 "/usr/include/libio.h" 3
__off64_t _offset;
# 303 "/usr/include/libio.h" 3
void *__pad1;
# 304
void *__pad2;
# 305
void *__pad3;
# 306
void *__pad4;
# 307
size_t __pad5;
# 309
int _mode;
# 311
char _unused2[(((15) * sizeof(int)) - ((4) * sizeof(void *))) - sizeof(size_t)];
# 313
};
# 319
struct _IO_FILE_plus;
# 321
extern _IO_FILE_plus _IO_2_1_stdin_;
# 322
extern _IO_FILE_plus _IO_2_1_stdout_;
# 323
extern _IO_FILE_plus _IO_2_1_stderr_;
# 339 "/usr/include/libio.h" 3
typedef __ssize_t __io_read_fn(void * __cookie, char * __buf, size_t __nbytes);
# 347
typedef __ssize_t __io_write_fn(void * __cookie, const char * __buf, size_t __n);
# 356
typedef int __io_seek_fn(void * __cookie, __off64_t * __pos, int __w);
# 359
typedef int __io_close_fn(void * __cookie);
# 364
typedef __io_read_fn cookie_read_function_t;
# 365
typedef __io_write_fn cookie_write_function_t;
# 366
typedef __io_seek_fn cookie_seek_function_t;
# 367
typedef __io_close_fn cookie_close_function_t;
# 376
typedef
# 371
struct {
# 372
__io_read_fn *read;
# 373
__io_write_fn *write;
# 374
__io_seek_fn *seek;
# 375
__io_close_fn *close;
# 376
} _IO_cookie_io_functions_t;
# 377
typedef _IO_cookie_io_functions_t cookie_io_functions_t;
# 379
struct _IO_cookie_file;
# 382
extern void _IO_cookie_init(_IO_cookie_file * __cfile, int __read_write, void * __cookie, _IO_cookie_io_functions_t __fns);
# 388
extern "C" {
# 391
extern int __underflow(_IO_FILE *);
# 392
extern int __uflow(_IO_FILE *);
# 393
extern int __overflow(_IO_FILE *, int);
# 435 "/usr/include/libio.h" 3
extern int _IO_getc(_IO_FILE * __fp);
# 436
extern int _IO_putc(int __c, _IO_FILE * __fp);
# 437
extern int _IO_feof(_IO_FILE * __fp) throw();
# 438
extern int _IO_ferror(_IO_FILE * __fp) throw();
# 440
extern int _IO_peekc_locked(_IO_FILE * __fp);
# 446
extern void _IO_flockfile(_IO_FILE *) throw();
# 447
extern void _IO_funlockfile(_IO_FILE *) throw();
# 448
extern int _IO_ftrylockfile(_IO_FILE *) throw();
# 465 "/usr/include/libio.h" 3
extern int _IO_vfscanf(_IO_FILE *__restrict__, const char *__restrict__, __gnuc_va_list, int *__restrict__);
# 467
extern int _IO_vfprintf(_IO_FILE *__restrict__, const char *__restrict__, __gnuc_va_list);
# 469
extern __ssize_t _IO_padn(_IO_FILE *, int, __ssize_t);
# 470
extern size_t _IO_sgetn(_IO_FILE *, void *, size_t);
# 472
extern __off64_t _IO_seekoff(_IO_FILE *, __off64_t, int, int);
# 473
extern __off64_t _IO_seekpos(_IO_FILE *, __off64_t, int);
# 475
extern void _IO_free_backup_area(_IO_FILE *) throw();
# 527 "/usr/include/libio.h" 3
}
# 110 "/usr/include/stdio.h" 3
typedef _G_fpos_t fpos_t;
# 116
typedef _G_fpos64_t fpos64_t;
# 168 "/usr/include/stdio.h" 3
extern _IO_FILE *stdin;
# 169
extern _IO_FILE *stdout;
# 170
extern _IO_FILE *stderr;
# 178
extern int remove(const char * __filename) throw();
# 180
extern int rename(const char * __old, const char * __new) throw();
# 185
extern int renameat(int __oldfd, const char * __old, int __newfd, const char * __new) throw();
# 195
extern FILE *tmpfile();
# 205 "/usr/include/stdio.h" 3
extern FILE *tmpfile64();
# 209
extern char *tmpnam(char * __s) throw();
# 215
extern char *tmpnam_r(char * __s) throw();
# 227 "/usr/include/stdio.h" 3
extern char *tempnam(const char * __dir, const char * __pfx) throw()
# 228
__attribute((__malloc__));
# 237
extern int fclose(FILE * __stream);
# 242
extern int fflush(FILE * __stream);
# 252 "/usr/include/stdio.h" 3
extern int fflush_unlocked(FILE * __stream);
# 262 "/usr/include/stdio.h" 3
extern int fcloseall();
# 272
extern FILE *fopen(const char *__restrict__ __filename, const char *__restrict__ __modes);
# 278
extern FILE *freopen(const char *__restrict__ __filename, const char *__restrict__ __modes, FILE *__restrict__ __stream);
# 297 "/usr/include/stdio.h" 3
extern FILE *fopen64(const char *__restrict__ __filename, const char *__restrict__ __modes);
# 299
extern FILE *freopen64(const char *__restrict__ __filename, const char *__restrict__ __modes, FILE *__restrict__ __stream);
# 306
extern FILE *fdopen(int __fd, const char * __modes) throw();
# 312
extern FILE *fopencookie(void *__restrict__ __magic_cookie, const char *__restrict__ __modes, _IO_cookie_io_functions_t __io_funcs) throw();
# 319
extern FILE *fmemopen(void * __s, size_t __len, const char * __modes) throw();
# 325
extern FILE *open_memstream(char ** __bufloc, size_t * __sizeloc) throw();
# 332
extern void setbuf(FILE *__restrict__ __stream, char *__restrict__ __buf) throw();
# 336
extern int setvbuf(FILE *__restrict__ __stream, char *__restrict__ __buf, int __modes, size_t __n) throw();
# 343
extern void setbuffer(FILE *__restrict__ __stream, char *__restrict__ __buf, size_t __size) throw();
# 347
extern void setlinebuf(FILE * __stream) throw();
# 356
extern int fprintf(FILE *__restrict__ __stream, const char *__restrict__ __format, ...);
# 362
extern int printf(const char *__restrict__ __format, ...);
# 364
extern int sprintf(char *__restrict__ __s, const char *__restrict__ __format, ...) throw();
# 371
extern int vfprintf(FILE *__restrict__ __s, const char *__restrict__ __format, __gnuc_va_list __arg);
# 377
extern int vprintf(const char *__restrict__ __format, __gnuc_va_list __arg);
# 379
extern int vsprintf(char *__restrict__ __s, const char *__restrict__ __format, __gnuc_va_list __arg) throw();
# 386
extern int snprintf(char *__restrict__ __s, size_t __maxlen, const char *__restrict__ __format, ...) throw()
# 388
__attribute((__format__(__printf__, 3, 4)));
# 390
extern int vsnprintf(char *__restrict__ __s, size_t __maxlen, const char *__restrict__ __format, __gnuc_va_list __arg) throw()
# 392
__attribute((__format__(__printf__, 3, 0)));
# 399
extern int vasprintf(char **__restrict__ __ptr, const char *__restrict__ __f, __gnuc_va_list __arg) throw()
# 401
__attribute((__format__(__printf__, 2, 0)));
# 402
extern int __asprintf(char **__restrict__ __ptr, const char *__restrict__ __fmt, ...) throw()
# 404
__attribute((__format__(__printf__, 2, 3)));
# 405
extern int asprintf(char **__restrict__ __ptr, const char *__restrict__ __fmt, ...) throw()
# 407
__attribute((__format__(__printf__, 2, 3)));
# 412
extern int vdprintf(int __fd, const char *__restrict__ __fmt, __gnuc_va_list __arg)
# 414
__attribute((__format__(__printf__, 2, 0)));
# 415
extern int dprintf(int __fd, const char *__restrict__ __fmt, ...)
# 416
__attribute((__format__(__printf__, 2, 3)));
# 425
extern int fscanf(FILE *__restrict__ __stream, const char *__restrict__ __format, ...);
# 431
extern int scanf(const char *__restrict__ __format, ...);
# 433
extern int sscanf(const char *__restrict__ __s, const char *__restrict__ __format, ...) throw();
# 471 "/usr/include/stdio.h" 3
extern int vfscanf(FILE *__restrict__ __s, const char *__restrict__ __format, __gnuc_va_list __arg)
# 473
__attribute((__format__(__scanf__, 2, 0)));
# 479
extern int vscanf(const char *__restrict__ __format, __gnuc_va_list __arg)
# 480
__attribute((__format__(__scanf__, 1, 0)));
# 483
extern int vsscanf(const char *__restrict__ __s, const char *__restrict__ __format, __gnuc_va_list __arg) throw()
# 485
__attribute((__format__(__scanf__, 2, 0)));
# 531 "/usr/include/stdio.h" 3
extern int fgetc(FILE * __stream);
# 532
extern int getc(FILE * __stream);
# 538
extern int getchar();
# 550 "/usr/include/stdio.h" 3
extern int getc_unlocked(FILE * __stream);
# 551
extern int getchar_unlocked();
# 561 "/usr/include/stdio.h" 3
extern int fgetc_unlocked(FILE * __stream);
# 573
extern int fputc(int __c, FILE * __stream);
# 574
extern int putc(int __c, FILE * __stream);
# 580
extern int putchar(int __c);
# 594 "/usr/include/stdio.h" 3
extern int fputc_unlocked(int __c, FILE * __stream);
# 602
extern int putc_unlocked(int __c, FILE * __stream);
# 603
extern int putchar_unlocked(int __c);
# 610
extern int getw(FILE * __stream);
# 613
extern int putw(int __w, FILE * __stream);
# 622
extern char *fgets(char *__restrict__ __s, int __n, FILE *__restrict__ __stream);
# 638 "/usr/include/stdio.h" 3
extern char *gets(char * __s) __attribute((__deprecated__));
# 649 "/usr/include/stdio.h" 3
extern char *fgets_unlocked(char *__restrict__ __s, int __n, FILE *__restrict__ __stream);
# 665 "/usr/include/stdio.h" 3
extern __ssize_t __getdelim(char **__restrict__ __lineptr, size_t *__restrict__ __n, int __delimiter, FILE *__restrict__ __stream);
# 668
extern __ssize_t getdelim(char **__restrict__ __lineptr, size_t *__restrict__ __n, int __delimiter, FILE *__restrict__ __stream);
# 678
extern __ssize_t getline(char **__restrict__ __lineptr, size_t *__restrict__ __n, FILE *__restrict__ __stream);
# 689
extern int fputs(const char *__restrict__ __s, FILE *__restrict__ __stream);
# 695
extern int puts(const char * __s);
# 702
extern int ungetc(int __c, FILE * __stream);
# 709
extern size_t fread(void *__restrict__ __ptr, size_t __size, size_t __n, FILE *__restrict__ __stream);
# 715
extern size_t fwrite(const void *__restrict__ __ptr, size_t __size, size_t __n, FILE *__restrict__ __s);
# 726 "/usr/include/stdio.h" 3
extern int fputs_unlocked(const char *__restrict__ __s, FILE *__restrict__ __stream);
# 737 "/usr/include/stdio.h" 3
extern size_t fread_unlocked(void *__restrict__ __ptr, size_t __size, size_t __n, FILE *__restrict__ __stream);
# 739
extern size_t fwrite_unlocked(const void *__restrict__ __ptr, size_t __size, size_t __n, FILE *__restrict__ __stream);
# 749
extern int fseek(FILE * __stream, long __off, int __whence);
# 754
extern long ftell(FILE * __stream);
# 759
extern void rewind(FILE * __stream);
# 773 "/usr/include/stdio.h" 3
extern int fseeko(FILE * __stream, __off_t __off, int __whence);
# 778
extern __off_t ftello(FILE * __stream);
# 798 "/usr/include/stdio.h" 3
extern int fgetpos(FILE *__restrict__ __stream, fpos_t *__restrict__ __pos);
# 803
extern int fsetpos(FILE * __stream, const fpos_t * __pos);
# 818 "/usr/include/stdio.h" 3
extern int fseeko64(FILE * __stream, __off64_t __off, int __whence);
# 819
extern __off64_t ftello64(FILE * __stream);
# 820
extern int fgetpos64(FILE *__restrict__ __stream, fpos64_t *__restrict__ __pos);
# 821
extern int fsetpos64(FILE * __stream, const fpos64_t * __pos);
# 826
extern void clearerr(FILE * __stream) throw();
# 828
extern int feof(FILE * __stream) throw();
# 830
extern int ferror(FILE * __stream) throw();
# 835
extern void clearerr_unlocked(FILE * __stream) throw();
# 836
extern int feof_unlocked(FILE * __stream) throw();
# 837
extern int ferror_unlocked(FILE * __stream) throw();
# 846
extern void perror(const char * __s);
# 26 "/usr/include/bits/sys_errlist.h" 3
extern int sys_nerr;
# 27
extern const char *const sys_errlist[];
# 30
extern int _sys_nerr;
# 31
extern const char *const _sys_errlist[];
# 858 "/usr/include/stdio.h" 3
extern int fileno(FILE * __stream) throw();
# 863
extern int fileno_unlocked(FILE * __stream) throw();
# 873 "/usr/include/stdio.h" 3
extern FILE *popen(const char * __command, const char * __modes);
# 879
extern int pclose(FILE * __stream);
# 885
extern char *ctermid(char * __s) throw();
# 891
extern char *cuserid(char * __s);
# 896
struct obstack;
# 899
extern int obstack_printf(obstack *__restrict__ __obstack, const char *__restrict__ __format, ...) throw()
# 901
__attribute((__format__(__printf__, 2, 3)));
# 902
extern int obstack_vprintf(obstack *__restrict__ __obstack, const char *__restrict__ __format, __gnuc_va_list __args) throw()
# 905
__attribute((__format__(__printf__, 2, 0)));
# 913
extern void flockfile(FILE * __stream) throw();
# 917
extern int ftrylockfile(FILE * __stream) throw();
# 920
extern void funlockfile(FILE * __stream) throw();
# 943 "/usr/include/stdio.h" 3
}
# 20 ".././mpi_s/mpi.h"
extern "C" {
# 25
typedef int MPI_Handle;
# 26
typedef MPI_Handle MPI_Comm;
# 27
typedef MPI_Handle MPI_Group;
# 28
typedef MPI_Handle MPI_Datatype;
# 29
typedef MPI_Handle MPI_Request;
# 30
typedef MPI_Handle MPI_Op;
# 31
typedef MPI_Handle MPI_Errhandler;
# 36
typedef
# 33
struct {
# 34
int MPI_SOURCE;
# 35
int MPI_TAG;
# 36
} MPI_Status;
# 38
typedef MPI_Handle MPI_Aint;
# 44
enum return_codes { MPI_SUCCESS};
# 56 ".././mpi_s/mpi.h"
enum error_specifiers { MPI_ERRORS_ARE_FATAL, MPI_ERRORS_RETURN};
# 58
enum elementary_datatypes { MPI_CHAR,
# 59
MPI_SHORT,
# 60
MPI_INT,
# 61
MPI_LONG,
# 62
MPI_UNSIGNED_CHAR,
# 63
MPI_UNSIGNED_SHORT,
# 64
MPI_UNSIGNED,
# 65
MPI_UNSIGNED_LONG,
# 66
MPI_FLOAT,
# 67
MPI_DOUBLE,
# 68
MPI_LONG_DOUBLE,
# 69
MPI_BYTE,
# 70
MPI_PACKED};
# 72
enum collective_operations { MPI_MAX,
# 73
MPI_MIN,
# 74
MPI_SUM,
# 75
MPI_PROD,
# 76
MPI_MAXLOC,
# 77
MPI_MINLOC,
# 78
MPI_BAND,
# 79
MPI_BOR,
# 80
MPI_BXOR,
# 81
MPI_LAND,
# 82
MPI_LOR,
# 83
MPI_LXOR};
# 92 ".././mpi_s/mpi.h"
enum reserved_communicators { MPI_COMM_WORLD, MPI_COMM_SELF};
# 109 ".././mpi_s/mpi.h"
int MPI_Barrier(MPI_Comm comm);
# 110
int MPI_Bcast(void * buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
# 112
int MPI_Comm_rank(MPI_Comm comm, int * rank);
# 113
int MPI_Comm_size(MPI_Comm comm, int * size);
# 114
int MPI_Comm_group(MPI_Comm comm, MPI_Group * grp);
# 116
int MPI_Send(void * buf, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm);
# 119
int MPI_Recv(void * buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status * status);
# 121
int MPI_Irecv(void * buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request * request);
# 124
int MPI_Ssend(void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm);
# 126
int MPI_Isend(void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request * request);
# 128
int MPI_Issend(void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request * request);
# 132
int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status * status);
# 133
int MPI_Sendrecv(void * sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void * recvbuf, int recvcount, MPI_Datatype recvtype, int source, MPI_Datatype recvtag, MPI_Comm comm, MPI_Status * status);
# 138
int MPI_Reduce(void * sendbuf, void * recvbuf, int count, MPI_Datatype type, MPI_Op op, int root, MPI_Comm comm);
# 142
int MPI_Type_indexed(int count, int * array_of_blocklengths, int * array_of_displacements, MPI_Datatype oldtype, MPI_Datatype * newtype);
# 145
int MPI_Type_contiguous(int count, MPI_Datatype oldtype, MPI_Datatype * newtype);
# 147
int MPI_Type_vector(int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Datatype * newtype);
# 149
int MPI_Type_struct(int count, int * array_of_blocklengths, MPI_Aint * array_of_displacements, MPI_Datatype * array_of_types, MPI_Datatype * newtype);
# 152
int MPI_Address(void * location, MPI_Aint * address);
# 153
int MPI_Type_commit(MPI_Datatype * datatype);
# 154
int MPI_Type_free(MPI_Datatype * datatype);
# 155
int MPI_Waitall(int count, MPI_Request * array_of_requests, MPI_Status * array_of_statuses);
# 157
int MPI_Waitany(int count, MPI_Request array_of_req[], int * index, MPI_Status * status);
# 159
int MPI_Gather(void * sendbuf, int sendcount, MPI_Datatype sendtype, void * recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
# 162
int MPI_Gatherv(const void * sendbuf, int sendcount, MPI_Datatype sendtype, void * recvbuf, const int * recvcounts, const int * displ, MPI_Datatype recvtype, int root, MPI_Comm comm);
# 165
int MPI_Allgather(void * sendbuf, int sendcount, MPI_Datatype sendtype, void * recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm);
# 168
int MPI_Allreduce(void * send, void * recv, int count, MPI_Datatype type, MPI_Op op, MPI_Comm comm);
# 171
int MPI_Comm_split(MPI_Comm comm, int colour, int key, MPI_Comm * newcomm);
# 172
int MPI_Comm_free(MPI_Comm * comm);
# 173
int MPI_Comm_dup(MPI_Comm oldcomm, MPI_Comm * newcomm);
# 178
int MPI_Cart_create(MPI_Comm comm_old, int ndims, int * dims, int * periods, int reoerder, MPI_Comm * comm_cart);
# 180
int MPI_Dims_create(int nnodes, int ndims, int * dims);
# 181
int MPI_Cart_get(MPI_Comm comm, int maxdims, int * dims, int * periods, int * coords);
# 183
int MPI_Cart_rank(MPI_Comm comm, int * coords, int * rank);
# 184
int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int * coords);
# 185
int MPI_Cart_shift(MPI_Comm comm, int direction, int disp, int * rank_source, int * rank_dest);
# 187
int MPI_Cart_sub(MPI_Comm comm, int * remain_dims, MPI_Comm * new_comm);
# 191
int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler);
# 193
double MPI_Wtime();
# 194
double MPI_Wtick();
# 196
int MPI_Init(int * argc, char *** argv);
# 197
int MPI_Finalize();
# 198
int MPI_Initialized(int * flag);
# 199
int MPI_Abort(MPI_Comm comm, int errorcode);
# 208 ".././mpi_s/mpi.h"
int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler erhandler);
# 209
int MPI_Get_address(const void * location, MPI_Aint * address);
# 210
int MPI_Group_translate_ranks(MPI_Group grp1, int n, const int * ranks1, MPI_Group grp2, int * ranks2);
# 212
int MPI_Type_create_struct(int count, int * arry_of_blocklens, const MPI_Aint * array_of_displacements, const MPI_Datatype * array_of_datatypes, MPI_Datatype * newtype);
# 216
int MPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint ub, MPI_Aint extent, MPI_Datatype * newtype);
# 220
}
# 48 "/usr/include/stdint.h" 3
typedef unsigned char uint8_t;
# 49
typedef unsigned short uint16_t;
# 51
typedef unsigned uint32_t;
# 55
typedef unsigned long uint64_t;
# 65 "/usr/include/stdint.h" 3
typedef signed char int_least8_t;
# 66
typedef short int_least16_t;
# 67
typedef int int_least32_t;
# 69
typedef long int_least64_t;
# 76
typedef unsigned char uint_least8_t;
# 77
typedef unsigned short uint_least16_t;
# 78
typedef unsigned uint_least32_t;
# 80
typedef unsigned long uint_least64_t;
# 90 "/usr/include/stdint.h" 3
typedef signed char int_fast8_t;
# 92
typedef long int_fast16_t;
# 93
typedef long int_fast32_t;
# 94
typedef long int_fast64_t;
# 103 "/usr/include/stdint.h" 3
typedef unsigned char uint_fast8_t;
# 105
typedef unsigned long uint_fast16_t;
# 106
typedef unsigned long uint_fast32_t;
# 107
typedef unsigned long uint_fast64_t;
# 119 "/usr/include/stdint.h" 3
typedef long intptr_t;
# 122
typedef unsigned long uintptr_t;
# 134 "/usr/include/stdint.h" 3
typedef long intmax_t;
# 135
typedef unsigned long uintmax_t;
# 65 "/usr/include/assert.h" 3
extern "C" {
# 68
extern void __assert_fail(const char * __assertion, const char * __file, unsigned __line, const char * __function) throw()
# 70
__attribute((__noreturn__));
# 73
extern void __assert_perror_fail(int __errnum, const char * __file, unsigned __line, const char * __function) throw()
# 75
__attribute((__noreturn__));
# 80
extern void __assert(const char * __assertion, const char * __file, int __line) throw()
# 81
__attribute((__noreturn__));
# 84
}
# 37 "/opt/rocm-3.3.0/hip/include/hip/hip_runtime_api.h" 3
enum {
# 38
HIP_SUCCESS,
# 39
HIP_ERROR_INVALID_VALUE,
# 40
HIP_ERROR_NOT_INITIALIZED,
# 41
HIP_ERROR_LAUNCH_OUT_OF_RESOURCES
# 42
};
# 73
typedef
# 44
struct {
# 46
unsigned hasGlobalInt32Atomics:1;
# 47
unsigned hasGlobalFloatAtomicExch:1;
# 48
unsigned hasSharedInt32Atomics:1;
# 49
unsigned hasSharedFloatAtomicExch:1;
# 50
unsigned hasFloatAtomicAdd:1;
# 53
unsigned hasGlobalInt64Atomics:1;
# 54
unsigned hasSharedInt64Atomics:1;
# 57
unsigned hasDoubles:1;
# 60
unsigned hasWarpVote:1;
# 61
unsigned hasWarpBallot:1;
# 62
unsigned hasWarpShuffle:1;
# 63
unsigned hasFunnelShift:1;
# 66
unsigned hasThreadFenceSystem:1;
# 67
unsigned hasSyncThreadsExt:1;
# 70
unsigned hasSurfaceFuncs:1;
# 71
unsigned has3dGrid:1;
# 72
unsigned hasDynamicParallelism:1;
# 73
} hipDeviceArch_t;
# 132 "/opt/rocm-3.3.0/hip/include/hip/hip_runtime_api.h" 3
typedef
# 83
struct hipDeviceProp_t {
# 84
char name[256];
# 85
size_t totalGlobalMem;
# 86
size_t sharedMemPerBlock;
# 87
int regsPerBlock;
# 88
int warpSize;
# 89
int maxThreadsPerBlock;
# 90
int maxThreadsDim[3];
# 91
int maxGridSize[3];
# 92
int clockRate;
# 93
int memoryClockRate;
# 94
int memoryBusWidth;
# 95
size_t totalConstMem;
# 96
int major;
# 99
int minor;
# 102
int multiProcessorCount;
# 103
int l2CacheSize;
# 104
int maxThreadsPerMultiProcessor;
# 105
int computeMode;
# 106
int clockInstructionRate;
# 108
hipDeviceArch_t arch;
# 109
int concurrentKernels;
# 110
int pciDomainID;
# 111
int pciBusID;
# 112
int pciDeviceID;
# 113
size_t maxSharedMemoryPerMultiProcessor;
# 114
int isMultiGpuBoard;
# 115
int canMapHostMemory;
# 116
int gcnArch;
# 117
int integrated;
# 118
int cooperativeLaunch;
# 119
int cooperativeMultiDeviceLaunch;
# 120
int maxTexture1D;
# 121
int maxTexture2D[2];
# 122
int maxTexture3D[3];
# 123
unsigned *hdpMemFlushCntl;
# 124
unsigned *hdpRegFlushCntl;
# 125
size_t memPitch;
# 126
size_t textureAlignment;
# 127
size_t texturePitchAlignment;
# 128
int kernelExecTimeoutEnabled;
# 129
int ECCEnabled;
# 130
int tccDriver;
# 132
} hipDeviceProp_t;
# 145
typedef
# 138
enum hipMemoryType {
# 139
hipMemoryTypeHost,
# 140
hipMemoryTypeDevice,
# 142
hipMemoryTypeArray,
# 144
hipMemoryTypeUnified
# 145
} hipMemoryType;
# 159
typedef
# 151
struct hipPointerAttribute_t {
# 152
enum hipMemoryType memoryType;
# 153
int device;
# 154
void *devicePointer;
# 155
void *hostPointer;
# 156
int isManaged;
# 157
unsigned allocationFlags;
# 159
} hipPointerAttribute_t;
# 270 "/opt/rocm-3.3.0/hip/include/hip/hip_runtime_api.h" 3
typedef
# 185
enum hipError_t {
# 186
hipSuccess,
# 187
hipErrorInvalidValue,
# 189
hipErrorOutOfMemory,
# 191
hipErrorMemoryAllocation = 2,
# 192
hipErrorNotInitialized,
# 194
hipErrorInitializationError = 3,
# 195
hipErrorDeinitialized,
# 196
hipErrorProfilerDisabled,
# 197
hipErrorProfilerNotInitialized,
# 198
hipErrorProfilerAlreadyStarted,
# 199
hipErrorProfilerAlreadyStopped,
# 200
hipErrorInvalidConfiguration,
# 201
hipErrorInvalidSymbol = 13,
# 202
hipErrorInvalidDevicePointer = 17,
# 203
hipErrorInvalidMemcpyDirection = 21,
# 204
hipErrorInsufficientDriver = 35,
# 205
hipErrorMissingConfiguration = 52,
# 206
hipErrorPriorLaunchFailure,
# 207
hipErrorInvalidDeviceFunction = 98,
# 208
hipErrorNoDevice = 100,
# 209
hipErrorInvalidDevice,
# 210
hipErrorInvalidImage = 200,
# 211
hipErrorInvalidContext,
# 212
hipErrorContextAlreadyCurrent,
# 213
hipErrorMapFailed = 205,
# 215
hipErrorMapBufferObjectFailed = 205,
# 216
hipErrorUnmapFailed,
# 217
hipErrorArrayIsMapped,
# 218
hipErrorAlreadyMapped,
# 219
hipErrorNoBinaryForGpu,
# 220
hipErrorAlreadyAcquired,
# 221
hipErrorNotMapped,
# 222
hipErrorNotMappedAsArray,
# 223
hipErrorNotMappedAsPointer,
# 224
hipErrorECCNotCorrectable,
# 225
hipErrorUnsupportedLimit,
# 226
hipErrorContextAlreadyInUse,
# 227
hipErrorPeerAccessUnsupported,
# 228
hipErrorInvalidKernelFile,
# 229
hipErrorInvalidGraphicsContext,
# 230
hipErrorInvalidSource = 300,
# 231
hipErrorFileNotFound,
# 232
hipErrorSharedObjectSymbolNotFound,
# 233
hipErrorSharedObjectInitFailed,
# 234
hipErrorOperatingSystem,
# 235
hipErrorInvalidHandle = 400,
# 237
hipErrorInvalidResourceHandle = 400,
# 238
hipErrorNotFound = 500,
# 239
hipErrorNotReady = 600,
# 243
hipErrorIllegalAddress = 700,
# 244
hipErrorLaunchOutOfResources,
# 245
hipErrorLaunchTimeOut,
# 246
hipErrorPeerAccessAlreadyEnabled = 704,
# 248
hipErrorPeerAccessNotEnabled,
# 250
hipErrorSetOnActiveProcess = 708,
# 251
hipErrorAssert = 710,
# 252
hipErrorHostMemoryAlreadyRegistered = 712,
# 254
hipErrorHostMemoryNotRegistered,
# 256
hipErrorLaunchFailure = 719,
# 258
hipErrorCooperativeLaunchTooLarge,
# 262
hipErrorNotSupported = 801,
# 263
hipErrorUnknown = 999,
# 265
hipErrorRuntimeMemory = 1052,
# 267
hipErrorRuntimeOther,
# 269
hipErrorTbd
# 270
} hipError_t;
# 334 "/opt/rocm-3.3.0/hip/include/hip/hip_runtime_api.h" 3
typedef
# 279
enum hipDeviceAttribute_t {
# 280
hipDeviceAttributeMaxThreadsPerBlock,
# 281
hipDeviceAttributeMaxBlockDimX,
# 282
hipDeviceAttributeMaxBlockDimY,
# 283
hipDeviceAttributeMaxBlockDimZ,
# 284
hipDeviceAttributeMaxGridDimX,
# 285
hipDeviceAttributeMaxGridDimY,
# 286
hipDeviceAttributeMaxGridDimZ,
# 287
hipDeviceAttributeMaxSharedMemoryPerBlock,
# 289
hipDeviceAttributeTotalConstantMemory,
# 290
hipDeviceAttributeWarpSize,
# 291
hipDeviceAttributeMaxRegistersPerBlock,
# 295
hipDeviceAttributeClockRate,
# 296
hipDeviceAttributeMemoryClockRate,
# 297
hipDeviceAttributeMemoryBusWidth,
# 298
hipDeviceAttributeMultiprocessorCount,
# 299
hipDeviceAttributeComputeMode,
# 300
hipDeviceAttributeL2CacheSize,
# 302
hipDeviceAttributeMaxThreadsPerMultiProcessor,
# 304
hipDeviceAttributeComputeCapabilityMajor,
# 305
hipDeviceAttributeComputeCapabilityMinor,
# 306
hipDeviceAttributeConcurrentKernels,
# 308
hipDeviceAttributePciBusId,
# 309
hipDeviceAttributePciDeviceId,
# 310
hipDeviceAttributeMaxSharedMemoryPerMultiprocessor,
# 312
hipDeviceAttributeIsMultiGpuBoard,
# 313
hipDeviceAttributeIntegrated,
# 314
hipDeviceAttributeCooperativeLaunch,
# 315
hipDeviceAttributeCooperativeMultiDeviceLaunch,
# 317
hipDeviceAttributeMaxTexture1DWidth,
# 318
hipDeviceAttributeMaxTexture2DWidth,
# 319
hipDeviceAttributeMaxTexture2DHeight,
# 320
hipDeviceAttributeMaxTexture3DWidth,
# 321
hipDeviceAttributeMaxTexture3DHeight,
# 322
hipDeviceAttributeMaxTexture3DDepth,
# 324
hipDeviceAttributeHdpMemFlushCntl,
# 325
hipDeviceAttributeHdpRegFlushCntl,
# 327
hipDeviceAttributeMaxPitch,
# 328
hipDeviceAttributeTextureAlignment,
# 329
hipDeviceAttributeTexturePitchAlignment,
# 330
hipDeviceAttributeKernelExecTimeout,
# 331
hipDeviceAttributeCanMapHostMemory,
# 332
hipDeviceAttributeEccEnabled
# 334
} hipDeviceAttribute_t;
# 336
enum hipComputeMode {
# 337
hipComputeModeDefault,
# 338
hipComputeModeExclusive,
# 339
hipComputeModeProhibited,
# 340
hipComputeModeExclusiveProcess
# 341
};
# 59 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef uint32_t cuuint32_t;
# 60
typedef uint64_t cuuint64_t;
# 240 "/usr/local/cuda-10.1/include/cuda.h" 3
extern "C" {
# 250 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef unsigned long long CUdeviceptr;
# 257
typedef int CUdevice;
# 258
typedef struct CUctx_st *CUcontext;
# 259
typedef struct CUmod_st *CUmodule;
# 260
typedef struct CUfunc_st *CUfunction;
# 261
typedef struct CUarray_st *CUarray;
# 262
typedef struct CUmipmappedArray_st *CUmipmappedArray;
# 263
typedef struct CUtexref_st *CUtexref;
# 264
typedef struct CUsurfref_st *CUsurfref;
# 265
typedef CUevent_st *CUevent;
# 266
typedef CUstream_st *CUstream;
# 267
typedef struct CUgraphicsResource_st *CUgraphicsResource;
# 268
typedef unsigned long long CUtexObject;
# 269
typedef unsigned long long CUsurfObject;
# 270
typedef struct CUextMemory_st *CUexternalMemory;
# 271
typedef struct CUextSemaphore_st *CUexternalSemaphore;
# 272
typedef CUgraph_st *CUgraph;
# 273
typedef CUgraphNode_st *CUgraphNode;
# 274
typedef CUgraphExec_st *CUgraphExec;
# 295 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef
# 293
struct CUipcEventHandle_st {
# 294
char reserved[64];
# 295
} CUipcEventHandle;
# 302
typedef
# 300
struct CUipcMemHandle_st {
# 301
char reserved[64];
# 302
} CUipcMemHandle;
# 309
typedef
# 307
enum CUipcMem_flags_enum {
# 308
CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = 1
# 309
} CUipcMem_flags;
# 320
typedef
# 316
enum CUmemAttach_flags_enum {
# 317
CU_MEM_ATTACH_GLOBAL = 1,
# 318
CU_MEM_ATTACH_HOST,
# 319
CU_MEM_ATTACH_SINGLE = 4
# 320
} CUmemAttach_flags;
# 337
typedef
# 325
enum CUctx_flags_enum {
# 326
CU_CTX_SCHED_AUTO,
# 327
CU_CTX_SCHED_SPIN,
# 328
CU_CTX_SCHED_YIELD,
# 329
CU_CTX_SCHED_BLOCKING_SYNC = 4,
# 330
CU_CTX_BLOCKING_SYNC = 4,
# 333
CU_CTX_SCHED_MASK = 7,
# 334
CU_CTX_MAP_HOST,
# 335
CU_CTX_LMEM_RESIZE_TO_MAX = 16,
# 336
CU_CTX_FLAGS_MASK = 31
# 337
} CUctx_flags;
# 345
typedef
# 342
enum CUstream_flags_enum {
# 343
CU_STREAM_DEFAULT,
# 344
CU_STREAM_NON_BLOCKING
# 345
} CUstream_flags;
# 375 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef
# 370
enum CUevent_flags_enum {
# 371
CU_EVENT_DEFAULT,
# 372
CU_EVENT_BLOCKING_SYNC,
# 373
CU_EVENT_DISABLE_TIMING,
# 374
CU_EVENT_INTERPROCESS = 4
# 375
} CUevent_flags;
# 399 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef
# 381 "/usr/local/cuda-10.1/include/cuda.h" 3
enum CUstreamWaitValue_flags_enum {
# 382
CU_STREAM_WAIT_VALUE_GEQ,
# 385
CU_STREAM_WAIT_VALUE_EQ,
# 386
CU_STREAM_WAIT_VALUE_AND,
# 387
CU_STREAM_WAIT_VALUE_NOR,
# 390
CU_STREAM_WAIT_VALUE_FLUSH = 1073741824
# 399 "/usr/local/cuda-10.1/include/cuda.h" 3
} CUstreamWaitValue_flags;
# 412
typedef
# 404
enum CUstreamWriteValue_flags_enum {
# 405
CU_STREAM_WRITE_VALUE_DEFAULT,
# 406
CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER
# 412
} CUstreamWriteValue_flags;
# 424
typedef
# 417
enum CUstreamBatchMemOpType_enum {
# 418
CU_STREAM_MEM_OP_WAIT_VALUE_32 = 1,
# 419
CU_STREAM_MEM_OP_WRITE_VALUE_32,
# 420
CU_STREAM_MEM_OP_WAIT_VALUE_64 = 4,
# 421
CU_STREAM_MEM_OP_WRITE_VALUE_64,
# 422
CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES = 3
# 424
} CUstreamBatchMemOpType;
# 456
typedef
# 429
union CUstreamBatchMemOpParams_union {
# 430
CUstreamBatchMemOpType operation;
# 431
struct CUstreamMemOpWaitValueParams_st {
# 432
CUstreamBatchMemOpType operation;
# 433
CUdeviceptr address;
# 434
union {
# 435
cuuint32_t value;
# 436
cuuint64_t value64;
# 437
};
# 438
unsigned flags;
# 439
CUdeviceptr alias;
# 440
} waitValue;
# 441
struct CUstreamMemOpWriteValueParams_st {
# 442
CUstreamBatchMemOpType operation;
# 443
CUdeviceptr address;
# 444
union {
# 445
cuuint32_t value;
# 446
cuuint64_t value64;
# 447
};
# 448
unsigned flags;
# 449
CUdeviceptr alias;
# 450
} writeValue;
# 451
struct CUstreamMemOpFlushRemoteWritesParams_st {
# 452
CUstreamBatchMemOpType operation;
# 453
unsigned flags;
# 454
} flushRemoteWrites;
# 455
cuuint64_t pad[6];
# 456
} CUstreamBatchMemOpParams;
# 465
typedef
# 462
enum CUoccupancy_flags_enum {
# 463
CU_OCCUPANCY_DEFAULT,
# 464
CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE
# 465
} CUoccupancy_flags;
# 479
typedef
# 470
enum CUarray_format_enum {
# 471
CU_AD_FORMAT_UNSIGNED_INT8 = 1,
# 472
CU_AD_FORMAT_UNSIGNED_INT16,
# 473
CU_AD_FORMAT_UNSIGNED_INT32,
# 474
CU_AD_FORMAT_SIGNED_INT8 = 8,
# 475
CU_AD_FORMAT_SIGNED_INT16,
# 476
CU_AD_FORMAT_SIGNED_INT32,
# 477
CU_AD_FORMAT_HALF = 16,
# 478
CU_AD_FORMAT_FLOAT = 32
# 479
} CUarray_format;
# 489
typedef
# 484
enum CUaddress_mode_enum {
# 485
CU_TR_ADDRESS_MODE_WRAP,
# 486
CU_TR_ADDRESS_MODE_CLAMP,
# 487
CU_TR_ADDRESS_MODE_MIRROR,
# 488
CU_TR_ADDRESS_MODE_BORDER
# 489
} CUaddress_mode;
# 497
typedef
# 494
enum CUfilter_mode_enum {
# 495
CU_TR_FILTER_MODE_POINT,
# 496
CU_TR_FILTER_MODE_LINEAR
# 497
} CUfilter_mode;
# 610
typedef
# 502
enum CUdevice_attribute_enum {
# 503
CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1,
# 504
CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X,
# 505
CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y,
# 506
CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z,
# 507
CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X,
# 508
CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y,
# 509
CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z,
# 510
CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK,
# 511
CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK = 8,
# 512
CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY,
# 513
CU_DEVICE_ATTRIBUTE_WARP_SIZE,
# 514
CU_DEVICE_ATTRIBUTE_MAX_PITCH,
# 515
CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK,
# 516
CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK = 12,
# 517
CU_DEVICE_ATTRIBUTE_CLOCK_RATE,
# 518
CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT,
# 519
CU_DEVICE_ATTRIBUTE_GPU_OVERLAP,
# 520
CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT,
# 521
CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT,
# 522
CU_DEVICE_ATTRIBUTE_INTEGRATED,
# 523
CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY,
# 524
CU_DEVICE_ATTRIBUTE_COMPUTE_MODE,
# 525
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH,
# 526
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH,
# 527
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT,
# 528
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH,
# 529
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT,
# 530
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH,
# 531
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH,
# 532
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT,
# 533
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS,
# 534
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH = 27,
# 535
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT,
# 536
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES,
# 537
CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT,
# 538
CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS,
# 539
CU_DEVICE_ATTRIBUTE_ECC_ENABLED,
# 540
CU_DEVICE_ATTRIBUTE_PCI_BUS_ID,
# 541
CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID,
# 542
CU_DEVICE_ATTRIBUTE_TCC_DRIVER,
# 543
CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE,
# 544
CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH,
# 545
CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE,
# 546
CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR,
# 547
CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT,
# 548
CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING,
# 549
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH,
# 550
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS,
# 551
CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER,
# 552
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH,
# 553
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT,
# 554
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE,
# 555
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE,
# 556
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE,
# 557
CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID,
# 558
CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT,
# 559
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH,
# 560
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH,
# 561
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS,
# 562
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH,
# 563
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH,
# 564
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT,
# 565
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH,
# 566
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT,
# 567
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH,
# 568
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH,
# 569
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS,
# 570
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH,
# 571
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT,
# 572
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS,
# 573
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH,
# 574
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH,
# 575
CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS,
# 576
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH,
# 577
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH,
# 578
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT,
# 579
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH,
# 580
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH,
# 581
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT,
# 582
CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR,
# 583
CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR,
# 584
CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH,
# 585
CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED,
# 586
CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED,
# 587
CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED,
# 588
CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR,
# 589
CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR,
# 590
CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY,
# 591
CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD,
# 592
CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID,
# 593
CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED,
# 594
CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO,
# 595
CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS,
# 596
CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS,
# 597
CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED,
# 598
CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM,
# 599
CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS,
# 600
CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS,
# 601
CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR,
# 602
CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH,
# 603
CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH,
# 604
CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN,
# 605
CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES,
# 606
CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED,
# 607
CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES,
# 608
CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST,
# 609
CU_DEVICE_ATTRIBUTE_MAX
# 610
} CUdevice_attribute;
# 626
typedef
# 615
struct CUdevprop_st {
# 616
int maxThreadsPerBlock;
# 617
int maxThreadsDim[3];
# 618
int maxGridSize[3];
# 619
int sharedMemPerBlock;
# 620
int totalConstantMemory;
# 621
int SIMDWidth;
# 622
int memPitch;
# 623
int regsPerBlock;
# 624
int clockRate;
# 625
int textureAlign;
# 626
} CUdevprop;
# 641
typedef
# 631
enum CUpointer_attribute_enum {
# 632
CU_POINTER_ATTRIBUTE_CONTEXT = 1,
# 633
CU_POINTER_ATTRIBUTE_MEMORY_TYPE,
# 634
CU_POINTER_ATTRIBUTE_DEVICE_POINTER,
# 635
CU_POINTER_ATTRIBUTE_HOST_POINTER,
# 636
CU_POINTER_ATTRIBUTE_P2P_TOKENS,
# 637
CU_POINTER_ATTRIBUTE_SYNC_MEMOPS,
# 638
CU_POINTER_ATTRIBUTE_BUFFER_ID,
# 639
CU_POINTER_ATTRIBUTE_IS_MANAGED,
# 640
CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL
# 641
} CUpointer_attribute;
# 719 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef
# 646 "/usr/local/cuda-10.1/include/cuda.h" 3
enum CUfunction_attribute_enum {
# 652
CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK,
# 659
CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES,
# 665
CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES,
# 670
CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES,
# 675
CU_FUNC_ATTRIBUTE_NUM_REGS,
# 684 "/usr/local/cuda-10.1/include/cuda.h" 3
CU_FUNC_ATTRIBUTE_PTX_VERSION,
# 693 "/usr/local/cuda-10.1/include/cuda.h" 3
CU_FUNC_ATTRIBUTE_BINARY_VERSION,
# 699
CU_FUNC_ATTRIBUTE_CACHE_MODE_CA,
# 707
CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES,
# 716 "/usr/local/cuda-10.1/include/cuda.h" 3
CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT,
# 718
CU_FUNC_ATTRIBUTE_MAX
# 719
} CUfunction_attribute;
# 729
typedef
# 724
enum CUfunc_cache_enum {
# 725
CU_FUNC_CACHE_PREFER_NONE,
# 726
CU_FUNC_CACHE_PREFER_SHARED,
# 727
CU_FUNC_CACHE_PREFER_L1,
# 728
CU_FUNC_CACHE_PREFER_EQUAL
# 729
} CUfunc_cache;
# 738
typedef
# 734
enum CUsharedconfig_enum {
# 735
CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE,
# 736
CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE,
# 737
CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE
# 738
} CUsharedconfig;
# 747
typedef
# 743
enum CUshared_carveout_enum {
# 744
CU_SHAREDMEM_CARVEOUT_DEFAULT = (-1),
# 745
CU_SHAREDMEM_CARVEOUT_MAX_SHARED = 100,
# 746
CU_SHAREDMEM_CARVEOUT_MAX_L1 = 0
# 747
} CUshared_carveout;
# 757
typedef
# 752
enum CUmemorytype_enum {
# 753
CU_MEMORYTYPE_HOST = 1,
# 754
CU_MEMORYTYPE_DEVICE,
# 755
CU_MEMORYTYPE_ARRAY,
# 756
CU_MEMORYTYPE_UNIFIED
# 757
} CUmemorytype;
# 766
typedef
# 762
enum CUcomputemode_enum {
# 763
CU_COMPUTEMODE_DEFAULT,
# 764
CU_COMPUTEMODE_PROHIBITED = 2,
# 765
CU_COMPUTEMODE_EXCLUSIVE_PROCESS
# 766
} CUcomputemode;
# 778
typedef
# 771
enum CUmem_advise_enum {
# 772
CU_MEM_ADVISE_SET_READ_MOSTLY = 1,
# 773
CU_MEM_ADVISE_UNSET_READ_MOSTLY,
# 774
CU_MEM_ADVISE_SET_PREFERRED_LOCATION,
# 775
CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION,
# 776
CU_MEM_ADVISE_SET_ACCESSED_BY,
# 777
CU_MEM_ADVISE_UNSET_ACCESSED_BY
# 778
} CUmem_advise;
# 785
typedef
# 780
enum CUmem_range_attribute_enum {
# 781
CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY = 1,
# 782
CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION,
# 783
CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY,
# 784
CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION
# 785
} CUmem_range_attribute;
# 960 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef
# 790 "/usr/local/cuda-10.1/include/cuda.h" 3
enum CUjit_option_enum {
# 797
CU_JIT_MAX_REGISTERS,
# 812 "/usr/local/cuda-10.1/include/cuda.h" 3
CU_JIT_THREADS_PER_BLOCK,
# 820
CU_JIT_WALL_TIME,
# 829 "/usr/local/cuda-10.1/include/cuda.h" 3
CU_JIT_INFO_LOG_BUFFER,
# 838 "/usr/local/cuda-10.1/include/cuda.h" 3
CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES,
# 847 "/usr/local/cuda-10.1/include/cuda.h" 3
CU_JIT_ERROR_LOG_BUFFER,
# 856 "/usr/local/cuda-10.1/include/cuda.h" 3
CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES,
# 864
CU_JIT_OPTIMIZATION_LEVEL,
# 872
CU_JIT_TARGET_FROM_CUCONTEXT,
# 880
CU_JIT_TARGET,
# 889 "/usr/local/cuda-10.1/include/cuda.h" 3
CU_JIT_FALLBACK_STRATEGY,
# 897
CU_JIT_GENERATE_DEBUG_INFO,
# 904
CU_JIT_LOG_VERBOSE,
# 911
CU_JIT_GENERATE_LINE_INFO,
# 919
CU_JIT_CACHE_MODE,
# 924
CU_JIT_NEW_SM3X_OPT,
# 925
CU_JIT_FAST_COMPILE,
# 939 "/usr/local/cuda-10.1/include/cuda.h" 3
CU_JIT_GLOBAL_SYMBOL_NAMES,
# 948 "/usr/local/cuda-10.1/include/cuda.h" 3
CU_JIT_GLOBAL_SYMBOL_ADDRESSES,
# 956
CU_JIT_GLOBAL_SYMBOL_COUNT,
# 958
CU_JIT_NUM_OPTIONS
# 960
} CUjit_option;
# 982
typedef
# 965
enum CUjit_target_enum {
# 967
CU_TARGET_COMPUTE_20 = 20,
# 968
CU_TARGET_COMPUTE_21,
# 969
CU_TARGET_COMPUTE_30 = 30,
# 970
CU_TARGET_COMPUTE_32 = 32,
# 971
CU_TARGET_COMPUTE_35 = 35,
# 972
CU_TARGET_COMPUTE_37 = 37,
# 973
CU_TARGET_COMPUTE_50 = 50,
# 974
CU_TARGET_COMPUTE_52 = 52,
# 975
CU_TARGET_COMPUTE_53,
# 976
CU_TARGET_COMPUTE_60 = 60,
# 977
CU_TARGET_COMPUTE_61,
# 978
CU_TARGET_COMPUTE_62,
# 979
CU_TARGET_COMPUTE_70 = 70,
# 980
CU_TARGET_COMPUTE_72 = 72,
# 981
CU_TARGET_COMPUTE_75 = 75
# 982
} CUjit_target;
# 993
typedef
# 987
enum CUjit_fallback_enum {
# 989
CU_PREFER_PTX,
# 991
CU_PREFER_BINARY
# 993
} CUjit_fallback;
# 1003
typedef
# 998
enum CUjit_cacheMode_enum {
# 1000
CU_JIT_CACHE_OPTION_NONE,
# 1001
CU_JIT_CACHE_OPTION_CG,
# 1002
CU_JIT_CACHE_OPTION_CA
# 1003
} CUjit_cacheMode;
# 1041
typedef
# 1008
enum CUjitInputType_enum {
# 1014
CU_JIT_INPUT_CUBIN,
# 1020
CU_JIT_INPUT_PTX,
# 1026
CU_JIT_INPUT_FATBINARY,
# 1032
CU_JIT_INPUT_OBJECT,
# 1038
CU_JIT_INPUT_LIBRARY,
# 1040
CU_JIT_NUM_INPUT_TYPES
# 1041
} CUjitInputType;
# 1044
typedef struct CUlinkState_st *CUlinkState;
# 1056
typedef
# 1050
enum CUgraphicsRegisterFlags_enum {
# 1051
CU_GRAPHICS_REGISTER_FLAGS_NONE,
# 1052
CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY,
# 1053
CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD,
# 1054
CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST = 4,
# 1055
CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = 8
# 1056
} CUgraphicsRegisterFlags;
# 1065
typedef
# 1061
enum CUgraphicsMapResourceFlags_enum {
# 1062
CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE,
# 1063
CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY,
# 1064
CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD
# 1065
} CUgraphicsMapResourceFlags;
# 1077
typedef
# 1070
enum CUarray_cubemap_face_enum {
# 1071
CU_CUBEMAP_FACE_POSITIVE_X,
# 1072
CU_CUBEMAP_FACE_NEGATIVE_X,
# 1073
CU_CUBEMAP_FACE_POSITIVE_Y,
# 1074
CU_CUBEMAP_FACE_NEGATIVE_Y,
# 1075
CU_CUBEMAP_FACE_POSITIVE_Z,
# 1076
CU_CUBEMAP_FACE_NEGATIVE_Z
# 1077
} CUarray_cubemap_face;
# 1090
typedef
# 1082
enum CUlimit_enum {
# 1083
CU_LIMIT_STACK_SIZE,
# 1084
CU_LIMIT_PRINTF_FIFO_SIZE,
# 1085
CU_LIMIT_MALLOC_HEAP_SIZE,
# 1086
CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH,
# 1087
CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT,
# 1088
CU_LIMIT_MAX_L2_FETCH_GRANULARITY,
# 1089
CU_LIMIT_MAX
# 1090
} CUlimit;
# 1100
typedef
# 1095
enum CUresourcetype_enum {
# 1096
CU_RESOURCE_TYPE_ARRAY,
# 1097
CU_RESOURCE_TYPE_MIPMAPPED_ARRAY,
# 1098
CU_RESOURCE_TYPE_LINEAR,
# 1099
CU_RESOURCE_TYPE_PITCH2D
# 1100
} CUresourcetype;
# 1114 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef void (*CUhostFn)(void * userData);
# 1130
typedef
# 1119
struct CUDA_KERNEL_NODE_PARAMS_st {
# 1120
CUfunction func;
# 1121
unsigned gridDimX;
# 1122
unsigned gridDimY;
# 1123
unsigned gridDimZ;
# 1124
unsigned blockDimX;
# 1125
unsigned blockDimY;
# 1126
unsigned blockDimZ;
# 1127
unsigned sharedMemBytes;
# 1128
void **kernelParams;
# 1129
void **extra;
# 1130
} CUDA_KERNEL_NODE_PARAMS;
# 1142
typedef
# 1135
struct CUDA_MEMSET_NODE_PARAMS_st {
# 1136
CUdeviceptr dst;
# 1137
size_t pitch;
# 1138
unsigned value;
# 1139
unsigned elementSize;
# 1140
size_t width;
# 1141
size_t height;
# 1142
} CUDA_MEMSET_NODE_PARAMS;
# 1150
typedef
# 1147
struct CUDA_HOST_NODE_PARAMS_st {
# 1148
CUhostFn fn;
# 1149
void *userData;
# 1150
} CUDA_HOST_NODE_PARAMS;
# 1163
typedef
# 1155
enum CUgraphNodeType_enum {
# 1156
CU_GRAPH_NODE_TYPE_KERNEL,
# 1157
CU_GRAPH_NODE_TYPE_MEMCPY,
# 1158
CU_GRAPH_NODE_TYPE_MEMSET,
# 1159
CU_GRAPH_NODE_TYPE_HOST,
# 1160
CU_GRAPH_NODE_TYPE_GRAPH,
# 1161
CU_GRAPH_NODE_TYPE_EMPTY,
# 1162
CU_GRAPH_NODE_TYPE_COUNT
# 1163
} CUgraphNodeType;
# 1173
typedef
# 1168
enum CUstreamCaptureStatus_enum {
# 1169
CU_STREAM_CAPTURE_STATUS_NONE,
# 1170
CU_STREAM_CAPTURE_STATUS_ACTIVE,
# 1171
CU_STREAM_CAPTURE_STATUS_INVALIDATED
# 1173
} CUstreamCaptureStatus;
# 1187 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef
# 1183
enum CUstreamCaptureMode_enum {
# 1184
CU_STREAM_CAPTURE_MODE_GLOBAL,
# 1185
CU_STREAM_CAPTURE_MODE_THREAD_LOCAL,
# 1186
CU_STREAM_CAPTURE_MODE_RELAXED
# 1187
} CUstreamCaptureMode;
# 1690 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef
# 1194 "/usr/local/cuda-10.1/include/cuda.h" 3
enum cudaError_enum {
# 1200
CUDA_SUCCESS,
# 1206
CUDA_ERROR_INVALID_VALUE,
# 1212
CUDA_ERROR_OUT_OF_MEMORY,
# 1218
CUDA_ERROR_NOT_INITIALIZED,
# 1223
CUDA_ERROR_DEINITIALIZED,
# 1230
CUDA_ERROR_PROFILER_DISABLED,
# 1238
CUDA_ERROR_PROFILER_NOT_INITIALIZED,
# 1245
CUDA_ERROR_PROFILER_ALREADY_STARTED,
# 1252
CUDA_ERROR_PROFILER_ALREADY_STOPPED,
# 1258
CUDA_ERROR_NO_DEVICE = 100,
# 1264
CUDA_ERROR_INVALID_DEVICE,
# 1271
CUDA_ERROR_INVALID_IMAGE = 200,
# 1281 "/usr/local/cuda-10.1/include/cuda.h" 3
CUDA_ERROR_INVALID_CONTEXT,
# 1290 "/usr/local/cuda-10.1/include/cuda.h" 3
CUDA_ERROR_CONTEXT_ALREADY_CURRENT,
# 1295
CUDA_ERROR_MAP_FAILED = 205,
# 1300
CUDA_ERROR_UNMAP_FAILED,
# 1306
CUDA_ERROR_ARRAY_IS_MAPPED,
# 1311
CUDA_ERROR_ALREADY_MAPPED,
# 1319
CUDA_ERROR_NO_BINARY_FOR_GPU,
# 1324
CUDA_ERROR_ALREADY_ACQUIRED,
# 1329
CUDA_ERROR_NOT_MAPPED,
# 1335
CUDA_ERROR_NOT_MAPPED_AS_ARRAY,
# 1341
CUDA_ERROR_NOT_MAPPED_AS_POINTER,
# 1347
CUDA_ERROR_ECC_UNCORRECTABLE,
# 1353
CUDA_ERROR_UNSUPPORTED_LIMIT,
# 1360
CUDA_ERROR_CONTEXT_ALREADY_IN_USE,
# 1366
CUDA_ERROR_PEER_ACCESS_UNSUPPORTED,
# 1371
CUDA_ERROR_INVALID_PTX,
# 1376
CUDA_ERROR_INVALID_GRAPHICS_CONTEXT,
# 1382
CUDA_ERROR_NVLINK_UNCORRECTABLE,
# 1387
CUDA_ERROR_JIT_COMPILER_NOT_FOUND,
# 1392
CUDA_ERROR_INVALID_SOURCE = 300,
# 1397
CUDA_ERROR_FILE_NOT_FOUND,
# 1402
CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND,
# 1407
CUDA_ERROR_SHARED_OBJECT_INIT_FAILED,
# 1412
CUDA_ERROR_OPERATING_SYSTEM,
# 1418
CUDA_ERROR_INVALID_HANDLE = 400,
# 1424
CUDA_ERROR_ILLEGAL_STATE,
# 1430
CUDA_ERROR_NOT_FOUND = 500,
# 1438
CUDA_ERROR_NOT_READY = 600,
# 1447 "/usr/local/cuda-10.1/include/cuda.h" 3
CUDA_ERROR_ILLEGAL_ADDRESS = 700,
# 1458 "/usr/local/cuda-10.1/include/cuda.h" 3
CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES,
# 1468 "/usr/local/cuda-10.1/include/cuda.h" 3
CUDA_ERROR_LAUNCH_TIMEOUT,
# 1474
CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING,
# 1481
CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED,
# 1488
CUDA_ERROR_PEER_ACCESS_NOT_ENABLED,
# 1494
CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE = 708,
# 1501
CUDA_ERROR_CONTEXT_IS_DESTROYED,
# 1509
CUDA_ERROR_ASSERT,
# 1516
CUDA_ERROR_TOO_MANY_PEERS,
# 1522
CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED,
# 1528
CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED,
# 1537 "/usr/local/cuda-10.1/include/cuda.h" 3
CUDA_ERROR_HARDWARE_STACK_ERROR,
# 1545
CUDA_ERROR_ILLEGAL_INSTRUCTION,
# 1554 "/usr/local/cuda-10.1/include/cuda.h" 3
CUDA_ERROR_MISALIGNED_ADDRESS,
# 1565 "/usr/local/cuda-10.1/include/cuda.h" 3
CUDA_ERROR_INVALID_ADDRESS_SPACE,
# 1573
CUDA_ERROR_INVALID_PC,
# 1584 "/usr/local/cuda-10.1/include/cuda.h" 3
CUDA_ERROR_LAUNCH_FAILED,
# 1593 "/usr/local/cuda-10.1/include/cuda.h" 3
CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE,
# 1598
CUDA_ERROR_NOT_PERMITTED = 800,
# 1604
CUDA_ERROR_NOT_SUPPORTED,
# 1613 "/usr/local/cuda-10.1/include/cuda.h" 3
CUDA_ERROR_SYSTEM_NOT_READY,
# 1620
CUDA_ERROR_SYSTEM_DRIVER_MISMATCH,
# 1629 "/usr/local/cuda-10.1/include/cuda.h" 3
CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE,
# 1635
CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED = 900,
# 1641
CUDA_ERROR_STREAM_CAPTURE_INVALIDATED,
# 1647
CUDA_ERROR_STREAM_CAPTURE_MERGE,
# 1652
CUDA_ERROR_STREAM_CAPTURE_UNMATCHED,
# 1658
CUDA_ERROR_STREAM_CAPTURE_UNJOINED,
# 1665
CUDA_ERROR_STREAM_CAPTURE_ISOLATION,
# 1671
CUDA_ERROR_STREAM_CAPTURE_IMPLICIT,
# 1677
CUDA_ERROR_CAPTURED_EVENT,
# 1684
CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD,
# 1689
CUDA_ERROR_UNKNOWN = 999
# 1690
} CUresult;
# 1701
typedef
# 1695
enum CUdevice_P2PAttribute_enum {
# 1696
CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK = 1,
# 1697
CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED,
# 1698
CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED,
# 1699
CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED,
# 1700
CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED = 4
# 1701
} CUdevice_P2PAttribute;
# 1709
typedef void (*CUstreamCallback)(CUstream hStream, CUresult status, void * userData);
# 1717
typedef size_t (*CUoccupancyB2DSize)(int blockSize);
# 1793 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef
# 1772
struct CUDA_MEMCPY2D_st {
# 1773
size_t srcXInBytes;
# 1774
size_t srcY;
# 1776
CUmemorytype srcMemoryType;
# 1777
const void *srcHost;
# 1778
CUdeviceptr srcDevice;
# 1779
CUarray srcArray;
# 1780
size_t srcPitch;
# 1782
size_t dstXInBytes;
# 1783
size_t dstY;
# 1785
CUmemorytype dstMemoryType;
# 1786
void *dstHost;
# 1787
CUdeviceptr dstDevice;
# 1788
CUarray dstArray;
# 1789
size_t dstPitch;
# 1791
size_t WidthInBytes;
# 1792
size_t Height;
# 1793
} CUDA_MEMCPY2D;
# 1826
typedef
# 1798
struct CUDA_MEMCPY3D_st {
# 1799
size_t srcXInBytes;
# 1800
size_t srcY;
# 1801
size_t srcZ;
# 1802
size_t srcLOD;
# 1803
CUmemorytype srcMemoryType;
# 1804
const void *srcHost;
# 1805
CUdeviceptr srcDevice;
# 1806
CUarray srcArray;
# 1807
void *reserved0;
# 1808
size_t srcPitch;
# 1809
size_t srcHeight;
# 1811
size_t dstXInBytes;
# 1812
size_t dstY;
# 1813
size_t dstZ;
# 1814
size_t dstLOD;
# 1815
CUmemorytype dstMemoryType;
# 1816
void *dstHost;
# 1817
CUdeviceptr dstDevice;
# 1818
CUarray dstArray;
# 1819
void *reserved1;
# 1820
size_t dstPitch;
# 1821
size_t dstHeight;
# 1823
size_t WidthInBytes;
# 1824
size_t Height;
# 1825
size_t Depth;
# 1826
} CUDA_MEMCPY3D;
# 1859
typedef
# 1831
struct CUDA_MEMCPY3D_PEER_st {
# 1832
size_t srcXInBytes;
# 1833
size_t srcY;
# 1834
size_t srcZ;
# 1835
size_t srcLOD;
# 1836
CUmemorytype srcMemoryType;
# 1837
const void *srcHost;
# 1838
CUdeviceptr srcDevice;
# 1839
CUarray srcArray;
# 1840
CUcontext srcContext;
# 1841
size_t srcPitch;
# 1842
size_t srcHeight;
# 1844
size_t dstXInBytes;
# 1845
size_t dstY;
# 1846
size_t dstZ;
# 1847
size_t dstLOD;
# 1848
CUmemorytype dstMemoryType;
# 1849
void *dstHost;
# 1850
CUdeviceptr dstDevice;
# 1851
CUarray dstArray;
# 1852
CUcontext dstContext;
# 1853
size_t dstPitch;
# 1854
size_t dstHeight;
# 1856
size_t WidthInBytes;
# 1857
size_t Height;
# 1858
size_t Depth;
# 1859
} CUDA_MEMCPY3D_PEER;
# 1871
typedef
# 1864
struct CUDA_ARRAY_DESCRIPTOR_st {
# 1866
size_t Width;
# 1867
size_t Height;
# 1869
CUarray_format Format;
# 1870
unsigned NumChannels;
# 1871
} CUDA_ARRAY_DESCRIPTOR;
# 1885
typedef
# 1876
struct CUDA_ARRAY3D_DESCRIPTOR_st {
# 1878
size_t Width;
# 1879
size_t Height;
# 1880
size_t Depth;
# 1882
CUarray_format Format;
# 1883
unsigned NumChannels;
# 1884
unsigned Flags;
# 1885
} CUDA_ARRAY3D_DESCRIPTOR;
# 1925 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef
# 1894
struct CUDA_RESOURCE_DESC_st {
# 1896
CUresourcetype resType;
# 1898
union {
# 1899
struct {
# 1900
CUarray hArray;
# 1901
} array;
# 1902
struct {
# 1903
CUmipmappedArray hMipmappedArray;
# 1904
} mipmap;
# 1905
struct {
# 1906
CUdeviceptr devPtr;
# 1907
CUarray_format format;
# 1908
unsigned numChannels;
# 1909
size_t sizeInBytes;
# 1910
} linear;
# 1911
struct {
# 1912
CUdeviceptr devPtr;
# 1913
CUarray_format format;
# 1914
unsigned numChannels;
# 1915
size_t width;
# 1916
size_t height;
# 1917
size_t pitchInBytes;
# 1918
} pitch2D;
# 1919
struct {
# 1920
int reserved[32];
# 1921
} reserved;
# 1922
} res;
# 1924
unsigned flags;
# 1925
} CUDA_RESOURCE_DESC;
# 1941
typedef
# 1930
struct CUDA_TEXTURE_DESC_st {
# 1931
CUaddress_mode addressMode[3];
# 1932
CUfilter_mode filterMode;
# 1933
unsigned flags;
# 1934
unsigned maxAnisotropy;
# 1935
CUfilter_mode mipmapFilterMode;
# 1936
float mipmapLevelBias;
# 1937
float minMipmapLevelClamp;
# 1938
float maxMipmapLevelClamp;
# 1939
float borderColor[4];
# 1940
int reserved[12];
# 1941
} CUDA_TEXTURE_DESC;
# 1983
typedef
# 1946
enum CUresourceViewFormat_enum {
# 1948
CU_RES_VIEW_FORMAT_NONE,
# 1949
CU_RES_VIEW_FORMAT_UINT_1X8,
# 1950
CU_RES_VIEW_FORMAT_UINT_2X8,
# 1951
CU_RES_VIEW_FORMAT_UINT_4X8,
# 1952
CU_RES_VIEW_FORMAT_SINT_1X8,
# 1953
CU_RES_VIEW_FORMAT_SINT_2X8,
# 1954
CU_RES_VIEW_FORMAT_SINT_4X8,
# 1955
CU_RES_VIEW_FORMAT_UINT_1X16,
# 1956
CU_RES_VIEW_FORMAT_UINT_2X16,
# 1957
CU_RES_VIEW_FORMAT_UINT_4X16,
# 1958
CU_RES_VIEW_FORMAT_SINT_1X16,
# 1959
CU_RES_VIEW_FORMAT_SINT_2X16,
# 1960
CU_RES_VIEW_FORMAT_SINT_4X16,
# 1961
CU_RES_VIEW_FORMAT_UINT_1X32,
# 1962
CU_RES_VIEW_FORMAT_UINT_2X32,
# 1963
CU_RES_VIEW_FORMAT_UINT_4X32,
# 1964
CU_RES_VIEW_FORMAT_SINT_1X32,
# 1965
CU_RES_VIEW_FORMAT_SINT_2X32,
# 1966
CU_RES_VIEW_FORMAT_SINT_4X32,
# 1967
CU_RES_VIEW_FORMAT_FLOAT_1X16,
# 1968
CU_RES_VIEW_FORMAT_FLOAT_2X16,
# 1969
CU_RES_VIEW_FORMAT_FLOAT_4X16,
# 1970
CU_RES_VIEW_FORMAT_FLOAT_1X32,
# 1971
CU_RES_VIEW_FORMAT_FLOAT_2X32,
# 1972
CU_RES_VIEW_FORMAT_FLOAT_4X32,
# 1973
CU_RES_VIEW_FORMAT_UNSIGNED_BC1,
# 1974
CU_RES_VIEW_FORMAT_UNSIGNED_BC2,
# 1975
CU_RES_VIEW_FORMAT_UNSIGNED_BC3,
# 1976
CU_RES_VIEW_FORMAT_UNSIGNED_BC4,
# 1977
CU_RES_VIEW_FORMAT_SIGNED_BC4,
# 1978
CU_RES_VIEW_FORMAT_UNSIGNED_BC5,
# 1979
CU_RES_VIEW_FORMAT_SIGNED_BC5,
# 1980
CU_RES_VIEW_FORMAT_UNSIGNED_BC6H,
# 1981
CU_RES_VIEW_FORMAT_SIGNED_BC6H,
# 1982
CU_RES_VIEW_FORMAT_UNSIGNED_BC7
# 1983
} CUresourceViewFormat;
# 1999
typedef
# 1988
struct CUDA_RESOURCE_VIEW_DESC_st {
# 1990
CUresourceViewFormat format;
# 1991
size_t width;
# 1992
size_t height;
# 1993
size_t depth;
# 1994
unsigned firstMipmapLevel;
# 1995
unsigned lastMipmapLevel;
# 1996
unsigned firstLayer;
# 1997
unsigned lastLayer;
# 1998
unsigned reserved[16];
# 1999
} CUDA_RESOURCE_VIEW_DESC;
# 2007
typedef
# 2004
struct CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st {
# 2005
unsigned long long p2pToken;
# 2006
unsigned vaSpaceToken;
# 2007
} CUDA_POINTER_ATTRIBUTE_P2P_TOKENS;
# 2027 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef
# 2016
struct CUDA_LAUNCH_PARAMS_st {
# 2017
CUfunction function;
# 2018
unsigned gridDimX;
# 2019
unsigned gridDimY;
# 2020
unsigned gridDimZ;
# 2021
unsigned blockDimX;
# 2022
unsigned blockDimY;
# 2023
unsigned blockDimZ;
# 2024
unsigned sharedMemBytes;
# 2025
CUstream hStream;
# 2026
void **kernelParams;
# 2027
} CUDA_LAUNCH_PARAMS;
# 2057 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef
# 2036
enum CUexternalMemoryHandleType_enum {
# 2040
CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD = 1,
# 2044
CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32,
# 2048
CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT,
# 2052
CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP,
# 2056
CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE
# 2057
} CUexternalMemoryHandleType;
# 2112 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef
# 2067 "/usr/local/cuda-10.1/include/cuda.h" 3
struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st {
# 2071
CUexternalMemoryHandleType type;
# 2072
union {
# 2078
int fd;
# 2091 "/usr/local/cuda-10.1/include/cuda.h" 3
struct {
# 2095
void *handle;
# 2100
const void *name;
# 2101
} win32;
# 2102
} handle;
# 2106
unsigned long long size;
# 2110
unsigned flags;
# 2111
unsigned reserved[16];
# 2112
} CUDA_EXTERNAL_MEMORY_HANDLE_DESC;
# 2131
typedef
# 2117
struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st {
# 2121
unsigned long long offset;
# 2125
unsigned long long size;
# 2129
unsigned flags;
# 2130
unsigned reserved[16];
# 2131
} CUDA_EXTERNAL_MEMORY_BUFFER_DESC;
# 2151
typedef
# 2136
struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st {
# 2141
unsigned long long offset;
# 2145
CUDA_ARRAY3D_DESCRIPTOR arrayDesc;
# 2149
unsigned numLevels;
# 2150
unsigned reserved[16];
# 2151
} CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC;
# 2173
typedef
# 2156
enum CUexternalSemaphoreHandleType_enum {
# 2160
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD = 1,
# 2164
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32,
# 2168
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT,
# 2172
CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE
# 2173
} CUexternalSemaphoreHandleType;
# 2218 "/usr/local/cuda-10.1/include/cuda.h" 3
typedef
# 2178 "/usr/local/cuda-10.1/include/cuda.h" 3
struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st {
# 2182
CUexternalSemaphoreHandleType type;
# 2183
union {
# 2189
int fd;
# 2201 "/usr/local/cuda-10.1/include/cuda.h" 3
struct {
# 2205
void *handle;
# 2210
const void *name;
# 2211
} win32;
# 2212
} handle;
# 2216
unsigned flags;
# 2217
unsigned reserved[16];
# 2218
} CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC;
# 2241
typedef
# 2223
struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st {
# 2224
struct {
# 2228
struct {
# 2232
unsigned long long value;
# 2233
} fence;
# 2234
unsigned reserved[16];
# 2235
} params;
# 2239
unsigned flags;
# 2240
unsigned reserved[16];
# 2241
} CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS;
# 2264
typedef
# 2246
struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st {
# 2247
struct {
# 2251
struct {
# 2255
unsigned long long value;
# 2256
} fence;
# 2257
unsigned reserved[16];
# 2258
} params;
# 2262
unsigned flags;
# 2263
unsigned reserved[16];
# 2264
} CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS;
# 2434 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGetErrorString(CUresult error, const char ** pStr);
# 2455 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGetErrorName(CUresult error, const char ** pStr);
# 2489 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuInit(unsigned Flags);
# 2527 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDriverGetVersion(int * driverVersion);
# 2569 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDeviceGet(CUdevice * device, int ordinal);
# 2597 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDeviceGetCount(int * count);
# 2628 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDeviceGetName(char * name, int len, CUdevice dev);
# 2657 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDeviceGetUuid(CUuuid * uuid, CUdevice dev);
# 2717 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDeviceTotalMem_v2(size_t * bytes, CUdevice dev);
# 2922 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDeviceGetAttribute(int * pi, CUdevice_attribute attrib, CUdevice dev);
# 3000 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuDeviceGetProperties(CUdevprop * prop, CUdevice dev);
# 3034 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuDeviceComputeCapability(int * major, int * minor, CUdevice dev);
# 3102 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDevicePrimaryCtxRetain(CUcontext * pctx, CUdevice dev);
# 3136 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDevicePrimaryCtxRelease(CUdevice dev);
# 3201 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDevicePrimaryCtxSetFlags(CUdevice dev, unsigned flags);
# 3227 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDevicePrimaryCtxGetState(CUdevice dev, unsigned * flags, int * active);
# 3265 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDevicePrimaryCtxReset(CUdevice dev);
# 3377 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxCreate_v2(CUcontext * pctx, unsigned flags, CUdevice dev);
# 3417 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxDestroy_v2(CUcontext ctx);
# 3453 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxPushCurrent_v2(CUcontext ctx);
# 3487 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxPopCurrent_v2(CUcontext * pctx);
# 3517 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxSetCurrent(CUcontext ctx);
# 3540 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxGetCurrent(CUcontext * pctx);
# 3571 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxGetDevice(CUdevice * device);
# 3600 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxGetFlags(unsigned * flags);
# 3631 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxSynchronize();
# 3723 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxSetLimit(CUlimit limit, size_t value);
# 3764 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxGetLimit(size_t * pvalue, CUlimit limit);
# 3808 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxGetCacheConfig(CUfunc_cache * pconfig);
# 3859 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxSetCacheConfig(CUfunc_cache config);
# 3902 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxGetSharedMemConfig(CUsharedconfig * pConfig);
# 3955 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxSetSharedMemConfig(CUsharedconfig config);
# 3994 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxGetApiVersion(CUcontext ctx, unsigned * version);
# 4034 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxGetStreamPriorityRange(int * leastPriority, int * greatestPriority);
# 4089 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuCtxAttach(CUcontext * pctx, unsigned flags);
# 4125 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuCtxDetach(CUcontext ctx);
# 4180 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuModuleLoad(CUmodule * module, const char * fname);
# 4217 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuModuleLoadData(CUmodule * module, const void * image);
# 4260 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuModuleLoadDataEx(CUmodule * module, const void * image, unsigned numOptions, CUjit_option * options, void ** optionValues);
# 4302 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuModuleLoadFatBinary(CUmodule * module, const void * fatCubin);
# 4327 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuModuleUnload(CUmodule hmod);
# 4357 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuModuleGetFunction(CUfunction * hfunc, CUmodule hmod, const char * name);
# 4393 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuModuleGetGlobal_v2(CUdeviceptr * dptr, size_t * bytes, CUmodule hmod, const char * name);
# 4428 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuModuleGetTexRef(CUtexref * pTexRef, CUmodule hmod, const char * name);
# 4460 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuModuleGetSurfRef(CUsurfref * pSurfRef, CUmodule hmod, const char * name);
# 4503 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuLinkCreate_v2(unsigned numOptions, CUjit_option * options, void ** optionValues, CUlinkState * stateOut);
# 4540 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuLinkAddData_v2(CUlinkState state, CUjitInputType type, void * data, size_t size, const char * name, unsigned numOptions, CUjit_option * options, void ** optionValues);
# 4579 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuLinkAddFile_v2(CUlinkState state, CUjitInputType type, const char * path, unsigned numOptions, CUjit_option * options, void ** optionValues);
# 4606 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuLinkComplete(CUlinkState state, void ** cubinOut, size_t * sizeOut);
# 4620 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuLinkDestroy(CUlinkState state);
# 4669 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemGetInfo_v2(size_t * free, size_t * total);
# 4703 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemAlloc_v2(CUdeviceptr * dptr, size_t bytesize);
# 4765 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemAllocPitch_v2(CUdeviceptr * dptr, size_t * pPitch, size_t WidthInBytes, size_t Height, unsigned ElementSizeBytes);
# 4795 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemFree_v2(CUdeviceptr dptr);
# 4829 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemGetAddressRange_v2(CUdeviceptr * pbase, size_t * psize, CUdeviceptr dptr);
# 4876 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemAllocHost_v2(void ** pp, size_t bytesize);
# 4907 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemFreeHost(void * p);
# 4989 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemHostAlloc(void ** pp, size_t bytesize, unsigned Flags);
# 5043 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemHostGetDevicePointer_v2(CUdeviceptr * pdptr, void * p, unsigned Flags);
# 5071 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemHostGetFlags(unsigned * pFlags, void * p);
# 5183 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemAllocManaged(CUdeviceptr * dptr, size_t bytesize, unsigned flags);
# 5216 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDeviceGetByPCIBusId(CUdevice * dev, const char * pciBusId);
# 5248 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDeviceGetPCIBusId(char * pciBusId, int len, CUdevice dev);
# 5293 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuIpcGetEventHandle(CUipcEventHandle * pHandle, CUevent event);
# 5333 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuIpcOpenEventHandle(CUevent * phEvent, CUipcEventHandle handle);
# 5373 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuIpcGetMemHandle(CUipcMemHandle * pHandle, CUdeviceptr dptr);
# 5430 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuIpcOpenMemHandle(CUdeviceptr * pdptr, CUipcMemHandle handle, unsigned Flags);
# 5463 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuIpcCloseMemHandle(CUdeviceptr dptr);
# 5549 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemHostRegister_v2(void * p, size_t bytesize, unsigned Flags);
# 5575 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemHostUnregister(void * p);
# 5614 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount);
# 5644 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount);
# 5682 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyHtoD_v2(CUdeviceptr dstDevice, const void * srcHost, size_t ByteCount);
# 5717 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyDtoH_v2(void * dstHost, CUdeviceptr srcDevice, size_t ByteCount);
# 5753 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyDtoD_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount);
# 5789 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyDtoA_v2(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount);
# 5827 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyAtoD_v2(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount);
# 5863 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyHtoA_v2(CUarray dstArray, size_t dstOffset, const void * srcHost, size_t ByteCount);
# 5899 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyAtoH_v2(void * dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount);
# 5939 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyAtoA_v2(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount);
# 6103 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpy2D_v2(const CUDA_MEMCPY2D * pCopy);
# 6265 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpy2DUnaligned_v2(const CUDA_MEMCPY2D * pCopy);
# 6434 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpy3D_v2(const CUDA_MEMCPY3D * pCopy);
# 6460 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER * pCopy);
# 6504 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream);
# 6537 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream);
# 6579 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyHtoDAsync_v2(CUdeviceptr dstDevice, const void * srcHost, size_t ByteCount, CUstream hStream);
# 6619 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyDtoHAsync_v2(void * dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream);
# 6660 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyDtoDAsync_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream);
# 6701 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyHtoAAsync_v2(CUarray dstArray, size_t dstOffset, const void * srcHost, size_t ByteCount, CUstream hStream);
# 6742 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpyAtoHAsync_v2(void * dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream);
# 6911 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpy2DAsync_v2(const CUDA_MEMCPY2D * pCopy, CUstream hStream);
# 7085 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpy3DAsync_v2(const CUDA_MEMCPY3D * pCopy, CUstream hStream);
# 7113 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER * pCopy, CUstream hStream);
# 7150 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemsetD8_v2(CUdeviceptr dstDevice, unsigned char uc, size_t N);
# 7185 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemsetD16_v2(CUdeviceptr dstDevice, unsigned short us, size_t N);
# 7220 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemsetD32_v2(CUdeviceptr dstDevice, unsigned ui, size_t N);
# 7260 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemsetD2D8_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height);
# 7301 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemsetD2D16_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height);
# 7342 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemsetD2D32_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned ui, size_t Width, size_t Height);
# 7379 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream);
# 7416 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream);
# 7452 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemsetD32Async(CUdeviceptr dstDevice, unsigned ui, size_t N, CUstream hStream);
# 7494 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemsetD2D8Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, CUstream hStream);
# 7537 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemsetD2D16Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream);
# 7580 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemsetD2D32Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned ui, size_t Width, size_t Height, CUstream hStream);
# 7684 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuArrayCreate_v2(CUarray * pHandle, const CUDA_ARRAY_DESCRIPTOR * pAllocateArray);
# 7718 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuArrayGetDescriptor_v2(CUDA_ARRAY_DESCRIPTOR * pArrayDescriptor, CUarray hArray);
# 7751 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuArrayDestroy(CUarray hArray);
# 7932 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuArray3DCreate_v2(CUarray * pHandle, const CUDA_ARRAY3D_DESCRIPTOR * pAllocateArray);
# 7970 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuArray3DGetDescriptor_v2(CUDA_ARRAY3D_DESCRIPTOR * pArrayDescriptor, CUarray hArray);
# 8115 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMipmappedArrayCreate(CUmipmappedArray * pHandle, const CUDA_ARRAY3D_DESCRIPTOR * pMipmappedArrayDesc, unsigned numMipmapLevels);
# 8145 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMipmappedArrayGetLevel(CUarray * pLevelArray, CUmipmappedArray hMipmappedArray, unsigned level);
# 8170 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray);
# 8422 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuPointerGetAttribute(void * data, CUpointer_attribute attribute, CUdeviceptr ptr);
# 8492 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream);
# 8606 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device);
# 8664 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemRangeGetAttribute(void * data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count);
# 8704 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuMemRangeGetAttributes(void ** data, size_t * dataSizes, CUmem_range_attribute * attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count);
# 8748 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuPointerSetAttribute(const void * value, CUpointer_attribute attribute, CUdeviceptr ptr);
# 8793 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuPointerGetAttributes(unsigned numAttributes, CUpointer_attribute * attributes, void ** data, CUdeviceptr ptr);
# 8843 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamCreate(CUstream * phStream, unsigned Flags);
# 8892 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamCreateWithPriority(CUstream * phStream, unsigned flags, int priority);
# 8923 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamGetPriority(CUstream hStream, int * priority);
# 8951 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamGetFlags(CUstream hStream, unsigned * flags);
# 8997 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamGetCtx(CUstream hStream, CUcontext * pctx);
# 9030 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned Flags);
# 9105 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void * userData, unsigned flags);
# 9145 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamBeginCapture_v2(CUstream hStream, CUstreamCaptureMode mode);
# 9201 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode * mode);
# 9234 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamEndCapture(CUstream hStream, CUgraph * phGraph);
# 9274 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus * captureStatus);
# 9302 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamGetCaptureInfo(CUstream hStream, CUstreamCaptureStatus * captureStatus, cuuint64_t * id);
# 9394 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned flags);
# 9426 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamQuery(CUstream hStream);
# 9455 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamSynchronize(CUstream hStream);
# 9486 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamDestroy_v2(CUstream hStream);
# 9543 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuEventCreate(CUevent * phEvent, unsigned Flags);
# 9584 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuEventRecord(CUevent hEvent, CUstream hStream);
# 9616 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuEventQuery(CUevent hEvent);
# 9647 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuEventSynchronize(CUevent hEvent);
# 9677 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuEventDestroy_v2(CUevent hEvent);
# 9722 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuEventElapsedTime(float * pMilliseconds, CUevent hStart, CUevent hEnd);
# 9862 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuImportExternalMemory(CUexternalMemory * extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC * memHandleDesc);
# 9915 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuExternalMemoryGetMappedBuffer(CUdeviceptr * devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC * bufferDesc);
# 9964 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray * mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC * mipmapDesc);
# 9986 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDestroyExternalMemory(CUexternalMemory extMem);
# 10083 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuImportExternalSemaphore(CUexternalSemaphore * extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC * semHandleDesc);
# 10121 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuSignalExternalSemaphoresAsync(const CUexternalSemaphore * extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS * paramsArray, unsigned numExtSems, CUstream stream);
# 10163 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuWaitExternalSemaphoresAsync(const CUexternalSemaphore * extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS * paramsArray, unsigned numExtSems, CUstream stream);
# 10184 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDestroyExternalSemaphore(CUexternalSemaphore extSem);
# 10271 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamWaitValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned flags);
# 10306 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamWaitValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned flags);
# 10341 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamWriteValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned flags);
# 10375 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamWriteValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned flags);
# 10410 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuStreamBatchMemOp(CUstream stream, unsigned count, CUstreamBatchMemOpParams * paramArray, unsigned flags);
# 10484 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuFuncGetAttribute(int * pi, CUfunction_attribute attrib, CUfunction hfunc);
# 10532 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value);
# 10577 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config);
# 10630 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config);
# 10745 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuLaunchKernel(CUfunction f, unsigned gridDimX, unsigned gridDimY, unsigned gridDimZ, unsigned blockDimX, unsigned blockDimY, unsigned blockDimZ, unsigned sharedMemBytes, CUstream hStream, void ** kernelParams, void ** extra);
# 10834 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuLaunchCooperativeKernel(CUfunction f, unsigned gridDimX, unsigned gridDimY, unsigned gridDimZ, unsigned blockDimX, unsigned blockDimY, unsigned blockDimZ, unsigned sharedMemBytes, CUstream hStream, void ** kernelParams);
# 10978 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS * launchParamsList, unsigned numDevices, unsigned flags);
# 11047 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void * userData);
# 11099 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z);
# 11133 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuFuncSetSharedSize(CUfunction hfunc, unsigned bytes);
# 11165 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuParamSetSize(CUfunction hfunc, unsigned numbytes);
# 11198 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuParamSeti(CUfunction hfunc, int offset, unsigned value);
# 11231 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuParamSetf(CUfunction hfunc, int offset, float value);
# 11266 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuParamSetv(CUfunction hfunc, int offset, void * ptr, unsigned numbytes);
# 11303 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuLaunch(CUfunction f);
# 11342 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuLaunchGrid(CUfunction f, int grid_width, int grid_height);
# 11389 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream);
# 11414 "/usr/local/cuda-10.1/include/cuda.h" 3
__attribute((deprecated)) CUresult cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef);
# 11461 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphCreate(CUgraph * phGraph, unsigned flags);
# 11560 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphAddKernelNode(CUgraphNode * phGraphNode, CUgraph hGraph, const CUgraphNode * dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS * nodeParams);
# 11592 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphKernelNodeGetParams(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS * nodeParams);
# 11615 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphKernelNodeSetParams(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS * nodeParams);
# 11663 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphAddMemcpyNode(CUgraphNode * phGraphNode, CUgraph hGraph, const CUgraphNode * dependencies, size_t numDependencies, const CUDA_MEMCPY3D * copyParams, CUcontext ctx);
# 11686 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D * nodeParams);
# 11709 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D * nodeParams);
# 11751 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphAddMemsetNode(CUgraphNode * phGraphNode, CUgraph hGraph, const CUgraphNode * dependencies, size_t numDependencies, const CUDA_MEMSET_NODE_PARAMS * memsetParams, CUcontext ctx);
# 11774 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS * nodeParams);
# 11797 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS * nodeParams);
# 11838 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphAddHostNode(CUgraphNode * phGraphNode, CUgraph hGraph, const CUgraphNode * dependencies, size_t numDependencies, const CUDA_HOST_NODE_PARAMS * nodeParams);
# 11861 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS * nodeParams);
# 11884 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS * nodeParams);
# 11922 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphAddChildGraphNode(CUgraphNode * phGraphNode, CUgraph hGraph, const CUgraphNode * dependencies, size_t numDependencies, CUgraph childGraph);
# 11946 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph * phGraph);
# 11984 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphAddEmptyNode(CUgraphNode * phGraphNode, CUgraph hGraph, const CUgraphNode * dependencies, size_t numDependencies);
# 12009 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphClone(CUgraph * phGraphClone, CUgraph originalGraph);
# 12035 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphNodeFindInClone(CUgraphNode * phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph);
# 12066 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType * type);
# 12097 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphGetNodes(CUgraph hGraph, CUgraphNode * nodes, size_t * numNodes);
# 12128 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode * rootNodes, size_t * numRootNodes);
# 12162 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphGetEdges(CUgraph hGraph, CUgraphNode * from, CUgraphNode * to, size_t * numEdges);
# 12193 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode * dependencies, size_t * numDependencies);
# 12225 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode * dependentNodes, size_t * numDependentNodes);
# 12254 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode * from, const CUgraphNode * to, size_t numDependencies);
# 12283 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode * from, const CUgraphNode * to, size_t numDependencies);
# 12307 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphDestroyNode(CUgraphNode hNode);
# 12343 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphInstantiate(CUgraphExec * phGraphExec, CUgraph hGraph, CUgraphNode * phErrorNode, char * logBuffer, size_t bufferSize);
# 12377 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphExecKernelNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS * nodeParams);
# 12404 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream);
# 12428 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphExecDestroy(CUgraphExec hGraphExec);
# 12448 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphDestroy(CUgraph hGraph);
# 12488 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuOccupancyMaxActiveBlocksPerMultiprocessor(int * numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize);
# 12530 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int * numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned flags);
# 12582 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuOccupancyMaxPotentialBlockSize(int * minGridSize, int * blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit);
# 12628 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuOccupancyMaxPotentialBlockSizeWithFlags(int * minGridSize, int * blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned flags);
# 12674 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned Flags);
# 12704 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned Flags);
# 12751 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefSetAddress_v2(size_t * ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t bytes);
# 12806 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefSetAddress2D_v3(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR * desc, CUdeviceptr dptr, size_t Pitch);
# 12842 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents);
# 12888 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am);
# 12924 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm);
# 12960 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm);
# 12989 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias);
# 13020 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp);
# 13050 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned maxAniso);
# 13086 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefSetBorderColor(CUtexref hTexRef, float * pBorderColor);
# 13127 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefSetFlags(CUtexref hTexRef, unsigned Flags);
# 13155 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefGetAddress_v2(CUdeviceptr * pdptr, CUtexref hTexRef);
# 13183 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefGetArray(CUarray * phArray, CUtexref hTexRef);
# 13210 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefGetMipmappedArray(CUmipmappedArray * phMipmappedArray, CUtexref hTexRef);
# 13238 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefGetAddressMode(CUaddress_mode * pam, CUtexref hTexRef, int dim);
# 13264 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefGetFilterMode(CUfilter_mode * pfm, CUtexref hTexRef);
# 13292 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefGetFormat(CUarray_format * pFormat, int * pNumChannels, CUtexref hTexRef);
# 13318 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefGetMipmapFilterMode(CUfilter_mode * pfm, CUtexref hTexRef);
# 13344 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefGetMipmapLevelBias(float * pbias, CUtexref hTexRef);
# 13371 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefGetMipmapLevelClamp(float * pminMipmapLevelClamp, float * pmaxMipmapLevelClamp, CUtexref hTexRef);
# 13397 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefGetMaxAnisotropy(int * pmaxAniso, CUtexref hTexRef);
# 13426 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefGetBorderColor(float * pBorderColor, CUtexref hTexRef);
# 13451 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefGetFlags(unsigned * pFlags, CUtexref hTexRef);
# 13476 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefCreate(CUtexref * pTexRef);
# 13496 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexRefDestroy(CUtexref hTexRef);
# 13540 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned Flags);
# 13563 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuSurfRefGetArray(CUarray * phArray, CUsurfref hSurfRef);
# 13787 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexObjectCreate(CUtexObject * pTexObject, const CUDA_RESOURCE_DESC * pResDesc, const CUDA_TEXTURE_DESC * pTexDesc, const CUDA_RESOURCE_VIEW_DESC * pResViewDesc);
# 13807 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexObjectDestroy(CUtexObject texObject);
# 13828 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC * pResDesc, CUtexObject texObject);
# 13849 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC * pTexDesc, CUtexObject texObject);
# 13871 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC * pResViewDesc, CUtexObject texObject);
# 13914 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuSurfObjectCreate(CUsurfObject * pSurfObject, const CUDA_RESOURCE_DESC * pResDesc);
# 13934 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuSurfObjectDestroy(CUsurfObject surfObject);
# 13955 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC * pResDesc, CUsurfObject surfObject);
# 14000 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDeviceCanAccessPeer(int * canAccessPeer, CUdevice dev, CUdevice peerDev);
# 14051 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxEnablePeerAccess(CUcontext peerContext, unsigned Flags);
# 14078 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuCtxDisablePeerAccess(CUcontext peerContext);
# 14122 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuDeviceGetP2PAttribute(int * value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice);
# 14168 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphicsUnregisterResource(CUgraphicsResource resource);
# 14208 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphicsSubResourceGetMappedArray(CUarray * pArray, CUgraphicsResource resource, unsigned arrayIndex, unsigned mipLevel);
# 14241 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray * pMipmappedArray, CUgraphicsResource resource);
# 14278 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphicsResourceGetMappedPointer_v2(CUdeviceptr * pDevPtr, size_t * pSize, CUgraphicsResource resource);
# 14320 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphicsResourceSetMapFlags_v2(CUgraphicsResource resource, unsigned flags);
# 14360 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphicsMapResources(unsigned count, CUgraphicsResource * resources, CUstream hStream);
# 14397 "/usr/local/cuda-10.1/include/cuda.h" 3
CUresult cuGraphicsUnmapResources(unsigned count, CUgraphicsResource * resources, CUstream hStream);
# 14401
CUresult cuGetExportTable(const void ** ppExportTable, const CUuuid * pExportTableId);
# 14746 "/usr/local/cuda-10.1/include/cuda.h" 3
}
# 56 "/usr/local/cuda-10.1/include/cuda_profiler_api.h" 3
extern "C" {
# 122 "/usr/local/cuda-10.1/include/cuda_profiler_api.h" 3
extern cudaError_t cudaProfilerInitialize(const char * configFile, const char * outputFile, cudaOutputMode_t outputMode);
# 147 "/usr/local/cuda-10.1/include/cuda_profiler_api.h" 3
extern cudaError_t cudaProfilerStart();
# 169 "/usr/local/cuda-10.1/include/cuda_profiler_api.h" 3
extern cudaError_t cudaProfilerStop();
# 174
}
# 31 "/opt/rocm-3.3.0/hip/include/hip/nvcc_detail/hip_runtime_api.h" 3
extern "C" {
# 51 "/opt/rocm-3.3.0/hip/include/hip/nvcc_detail/hip_runtime_api.h" 3
typedef
# 45
enum hipMemcpyKind {
# 46
hipMemcpyHostToHost,
# 47
hipMemcpyHostToDevice,
# 48
hipMemcpyDeviceToHost,
# 49
hipMemcpyDeviceToDevice,
# 50
hipMemcpyDefault
# 51
} hipMemcpyKind;
# 69 "/opt/rocm-3.3.0/hip/include/hip/nvcc_detail/hip_runtime_api.h" 3
typedef cudaTextureAddressMode hipTextureAddressMode;
# 76
typedef cudaTextureFilterMode hipTextureFilterMode;
# 81
typedef cudaTextureReadMode hipTextureReadMode;
# 86
typedef cudaChannelFormatKind hipChannelFormatKind;
# 171 "/opt/rocm-3.3.0/hip/include/hip/nvcc_detail/hip_runtime_api.h" 3
typedef cudaEvent_t hipEvent_t;
# 172
typedef cudaStream_t hipStream_t;
# 173
typedef cudaIpcEventHandle_t hipIpcEventHandle_t;
# 174
typedef cudaIpcMemHandle_t hipIpcMemHandle_t;
# 175
typedef cudaLimit hipLimit_t;
# 176
typedef cudaFuncCache hipFuncCache_t;
# 177
typedef CUcontext hipCtx_t;
# 178
typedef cudaSharedMemConfig hipSharedMemConfig;
# 179
typedef CUfunc_cache hipFuncCache;
# 180
typedef CUjit_option hipJitOption;
# 181
typedef CUdevice hipDevice_t;
# 182
typedef CUmodule hipModule_t;
# 183
typedef CUfunction hipFunction_t;
# 184
typedef CUdeviceptr hipDeviceptr_t;
# 185
typedef cudaArray hipArray;
# 186
typedef cudaArray *hipArray_t;
# 187
typedef cudaArray *hipArray_const_t;
# 188
typedef cudaFuncAttributes hipFuncAttributes;
# 198 "/opt/rocm-3.3.0/hip/include/hip/nvcc_detail/hip_runtime_api.h" 3
typedef cudaTextureObject_t hipTextureObject_t;
# 199
typedef cudaSurfaceObject_t hipSurfaceObject_t;
# 207
typedef cudaExtent hipExtent;
# 208
typedef cudaPitchedPtr hipPitchedPtr;
# 216
typedef cudaChannelFormatDesc hipChannelFormatDesc;
# 217
typedef cudaResourceDesc hipResourceDesc;
# 218
typedef cudaTextureDesc hipTextureDesc;
# 219
typedef cudaResourceViewDesc hipResourceViewDesc;
# 238 "/opt/rocm-3.3.0/hip/include/hip/nvcc_detail/hip_runtime_api.h" 3
static inline hipError_t hipCUDAErrorTohipError(cudaError_t cuError) {
# 239
switch (cuError) {
# 240
case cudaSuccess:
# 241
return hipSuccess;
# 242
case cudaErrorProfilerDisabled:
# 243
return hipErrorProfilerDisabled;
# 244
case cudaErrorProfilerNotInitialized:
# 245
return hipErrorProfilerNotInitialized;
# 246
case cudaErrorProfilerAlreadyStarted:
# 247
return hipErrorProfilerAlreadyStarted;
# 248
case cudaErrorProfilerAlreadyStopped:
# 249
return hipErrorProfilerAlreadyStopped;
# 250
case cudaErrorInsufficientDriver:
# 251
return hipErrorInsufficientDriver;
# 252
case cudaErrorUnsupportedLimit:
# 253
return hipErrorUnsupportedLimit;
# 254
case cudaErrorPeerAccessUnsupported:
# 255
return hipErrorPeerAccessUnsupported;
# 256
case cudaErrorInvalidGraphicsContext:
# 257
return hipErrorInvalidGraphicsContext;
# 258
case cudaErrorSharedObjectSymbolNotFound:
# 259
return hipErrorSharedObjectSymbolNotFound;
# 260
case cudaErrorSharedObjectInitFailed:
# 261
return hipErrorSharedObjectInitFailed;
# 262
case cudaErrorOperatingSystem:
# 263
return hipErrorOperatingSystem;
# 264
case cudaErrorSetOnActiveProcess:
# 265
return hipErrorSetOnActiveProcess;
# 266
case cudaErrorIllegalAddress:
# 267
return hipErrorIllegalAddress;
# 268
case cudaErrorInvalidSymbol:
# 269
return hipErrorInvalidSymbol;
# 270
case cudaErrorMissingConfiguration:
# 271
return hipErrorMissingConfiguration;
# 272
case cudaErrorMemoryAllocation:
# 273
return hipErrorOutOfMemory;
# 274
case cudaErrorInitializationError:
# 275
return hipErrorNotInitialized;
# 276
case cudaErrorLaunchFailure:
# 277
return hipErrorLaunchFailure;
# 278
case cudaErrorCooperativeLaunchTooLarge:
# 279
return hipErrorCooperativeLaunchTooLarge;
# 280
case cudaErrorPriorLaunchFailure:
# 281
return hipErrorPriorLaunchFailure;
# 282
case cudaErrorLaunchOutOfResources:
# 283
return hipErrorLaunchOutOfResources;
# 284
case cudaErrorInvalidDeviceFunction:
# 285
return hipErrorInvalidDeviceFunction;
# 286
case cudaErrorInvalidConfiguration:
# 287
return hipErrorInvalidConfiguration;
# 288
case cudaErrorInvalidDevice:
# 289
return hipErrorInvalidDevice;
# 290
case cudaErrorInvalidValue:
# 291
return hipErrorInvalidValue;
# 292
case cudaErrorInvalidDevicePointer:
# 293
return hipErrorInvalidDevicePointer;
# 294
case cudaErrorInvalidMemcpyDirection:
# 295
return hipErrorInvalidMemcpyDirection;
# 296
case cudaErrorInvalidResourceHandle:
# 297
return hipErrorInvalidHandle;
# 298
case cudaErrorNotReady:
# 299
return hipErrorNotReady;
# 300
case cudaErrorNoDevice:
# 301
return hipErrorNoDevice;
# 302
case cudaErrorPeerAccessAlreadyEnabled:
# 303
return hipErrorPeerAccessAlreadyEnabled;
# 304
case cudaErrorPeerAccessNotEnabled:
# 305
return hipErrorPeerAccessNotEnabled;
# 306
case cudaErrorHostMemoryAlreadyRegistered:
# 307
return hipErrorHostMemoryAlreadyRegistered;
# 308
case cudaErrorHostMemoryNotRegistered:
# 309
return hipErrorHostMemoryNotRegistered;
# 310
case cudaErrorMapBufferObjectFailed:
# 311
return hipErrorMapFailed;
# 312
case cudaErrorAssert:
# 313
return hipErrorAssert;
# 314
case cudaErrorNotSupported:
# 315
return hipErrorNotSupported;
# 316
case cudaErrorCudartUnloading:
# 317
return hipErrorDeinitialized;
# 318
case cudaErrorInvalidKernelImage:
# 319
return hipErrorInvalidImage;
# 320
case cudaErrorUnmapBufferObjectFailed:
# 321
return hipErrorUnmapFailed;
# 322
case cudaErrorNoKernelImageForDevice:
# 323
return hipErrorNoBinaryForGpu;
# 324
case cudaErrorECCUncorrectable:
# 325
return hipErrorECCNotCorrectable;
# 326
case cudaErrorDeviceAlreadyInUse:
# 327
return hipErrorContextAlreadyInUse;
# 328
case cudaErrorInvalidPtx:
# 329
return hipErrorInvalidKernelFile;
# 330
case cudaErrorLaunchTimeout:
# 331
return hipErrorLaunchTimeOut;
# 333
case cudaErrorInvalidSource:
# 334
return hipErrorInvalidSource;
# 335
case cudaErrorFileNotFound:
# 336
return hipErrorFileNotFound;
# 337
case cudaErrorSymbolNotFound:
# 338
return hipErrorNotFound;
# 339
case cudaErrorArrayIsMapped:
# 340
return hipErrorArrayIsMapped;
# 341
case cudaErrorNotMappedAsPointer:
# 342
return hipErrorNotMappedAsPointer;
# 343
case cudaErrorNotMappedAsArray:
# 344
return hipErrorNotMappedAsArray;
# 345
case cudaErrorNotMapped:
# 346
return hipErrorNotMapped;
# 347
case cudaErrorAlreadyAcquired:
# 348
return hipErrorAlreadyAcquired;
# 349
case cudaErrorAlreadyMapped:
# 350
return hipErrorAlreadyMapped;
# 356
case cudaErrorUnknown:
# 357
default:
# 358
return hipErrorUnknown;
# 359
}
# 360
}
# 362
static inline hipError_t hipCUResultTohipError(CUresult cuError) {
# 363
switch (cuError) {
# 364
case CUDA_SUCCESS:
# 365
return hipSuccess;
# 366
case CUDA_ERROR_OUT_OF_MEMORY:
# 367
return hipErrorOutOfMemory;
# 368
case CUDA_ERROR_INVALID_VALUE:
# 369
return hipErrorInvalidValue;
# 370
case CUDA_ERROR_INVALID_DEVICE:
# 371
return hipErrorInvalidDevice;
# 372
case CUDA_ERROR_DEINITIALIZED:
# 373
return hipErrorDeinitialized;
# 374
case CUDA_ERROR_NO_DEVICE:
# 375
return hipErrorNoDevice;
# 376
case CUDA_ERROR_INVALID_CONTEXT:
# 377
return hipErrorInvalidContext;
# 378
case CUDA_ERROR_NOT_INITIALIZED:
# 379
return hipErrorNotInitialized;
# 380
case CUDA_ERROR_INVALID_HANDLE:
# 381
return hipErrorInvalidHandle;
# 382
case CUDA_ERROR_MAP_FAILED:
# 383
return hipErrorMapFailed;
# 384
case CUDA_ERROR_PROFILER_DISABLED:
# 385
return hipErrorProfilerDisabled;
# 386
case CUDA_ERROR_PROFILER_NOT_INITIALIZED:
# 387
return hipErrorProfilerNotInitialized;
# 388
case CUDA_ERROR_PROFILER_ALREADY_STARTED:
# 389
return hipErrorProfilerAlreadyStarted;
# 390
case CUDA_ERROR_PROFILER_ALREADY_STOPPED:
# 391
return hipErrorProfilerAlreadyStopped;
# 392
case CUDA_ERROR_INVALID_IMAGE:
# 393
return hipErrorInvalidImage;
# 394
case CUDA_ERROR_CONTEXT_ALREADY_CURRENT:
# 395
return hipErrorContextAlreadyCurrent;
# 396
case CUDA_ERROR_UNMAP_FAILED:
# 397
return hipErrorUnmapFailed;
# 398
case CUDA_ERROR_ARRAY_IS_MAPPED:
# 399
return hipErrorArrayIsMapped;
# 400
case CUDA_ERROR_ALREADY_MAPPED:
# 401
return hipErrorAlreadyMapped;
# 402
case CUDA_ERROR_NO_BINARY_FOR_GPU:
# 403
return hipErrorNoBinaryForGpu;
# 404
case CUDA_ERROR_ALREADY_ACQUIRED:
# 405
return hipErrorAlreadyAcquired;
# 406
case CUDA_ERROR_NOT_MAPPED:
# 407
return hipErrorNotMapped;
# 408
case CUDA_ERROR_NOT_MAPPED_AS_ARRAY:
# 409
return hipErrorNotMappedAsArray;
# 410
case CUDA_ERROR_NOT_MAPPED_AS_POINTER:
# 411
return hipErrorNotMappedAsPointer;
# 412
case CUDA_ERROR_ECC_UNCORRECTABLE:
# 413
return hipErrorECCNotCorrectable;
# 414
case CUDA_ERROR_UNSUPPORTED_LIMIT:
# 415
return hipErrorUnsupportedLimit;
# 416
case CUDA_ERROR_CONTEXT_ALREADY_IN_USE:
# 417
return hipErrorContextAlreadyInUse;
# 418
case CUDA_ERROR_PEER_ACCESS_UNSUPPORTED:
# 419
return hipErrorPeerAccessUnsupported;
# 420
case CUDA_ERROR_INVALID_PTX:
# 421
return hipErrorInvalidKernelFile;
# 422
case CUDA_ERROR_INVALID_GRAPHICS_CONTEXT:
# 423
return hipErrorInvalidGraphicsContext;
# 424
case CUDA_ERROR_INVALID_SOURCE:
# 425
return hipErrorInvalidSource;
# 426
case CUDA_ERROR_FILE_NOT_FOUND:
# 427
return hipErrorFileNotFound;
# 428
case CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND:
# 429
return hipErrorSharedObjectSymbolNotFound;
# 430
case CUDA_ERROR_SHARED_OBJECT_INIT_FAILED:
# 431
return hipErrorSharedObjectInitFailed;
# 432
case CUDA_ERROR_OPERATING_SYSTEM:
# 433
return hipErrorOperatingSystem;
# 434
case CUDA_ERROR_NOT_FOUND:
# 435
return hipErrorNotFound;
# 436
case CUDA_ERROR_NOT_READY:
# 437
return hipErrorNotReady;
# 438
case CUDA_ERROR_ILLEGAL_ADDRESS:
# 439
return hipErrorIllegalAddress;
# 440
case CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES:
# 441
return hipErrorLaunchOutOfResources;
# 442
case CUDA_ERROR_LAUNCH_TIMEOUT:
# 443
return hipErrorLaunchTimeOut;
# 444
case CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED:
# 445
return hipErrorPeerAccessAlreadyEnabled;
# 446
case CUDA_ERROR_PEER_ACCESS_NOT_ENABLED:
# 447
return hipErrorPeerAccessNotEnabled;
# 448
case CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE:
# 449
return hipErrorSetOnActiveProcess;
# 450
case CUDA_ERROR_ASSERT:
# 451
return hipErrorAssert;
# 452
case CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED:
# 453
return hipErrorHostMemoryAlreadyRegistered;
# 454
case CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED:
# 455
return hipErrorHostMemoryNotRegistered;
# 456
case CUDA_ERROR_LAUNCH_FAILED:
# 457
return hipErrorLaunchFailure;
# 458
case CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE:
# 459
return hipErrorCooperativeLaunchTooLarge;
# 460
case CUDA_ERROR_NOT_SUPPORTED:
# 461
return hipErrorNotSupported;
# 462
case CUDA_ERROR_UNKNOWN:
# 463
default:
# 464
return hipErrorUnknown;
# 465
}
# 466
}
# 468
static inline cudaError_t hipErrorToCudaError(hipError_t hError) {
# 469
switch (hError) {
# 470
case hipSuccess:
# 471
return cudaSuccess;
# 472
case hipErrorOutOfMemory:
# 473
return cudaErrorMemoryAllocation;
# 474
case hipErrorProfilerDisabled:
# 475
return cudaErrorProfilerDisabled;
# 476
case hipErrorProfilerNotInitialized:
# 477
return cudaErrorProfilerNotInitialized;
# 478
case hipErrorProfilerAlreadyStarted:
# 479
return cudaErrorProfilerAlreadyStarted;
# 480
case hipErrorProfilerAlreadyStopped:
# 481
return cudaErrorProfilerAlreadyStopped;
# 482
case hipErrorInvalidConfiguration:
# 483
return cudaErrorInvalidConfiguration;
# 484
case hipErrorLaunchOutOfResources:
# 485
return cudaErrorLaunchOutOfResources;
# 486
case hipErrorInvalidValue:
# 487
return cudaErrorInvalidValue;
# 488
case hipErrorInvalidHandle:
# 489
return cudaErrorInvalidResourceHandle;
# 490
case hipErrorInvalidDevice:
# 491
return cudaErrorInvalidDevice;
# 492
case hipErrorInvalidMemcpyDirection:
# 493
return cudaErrorInvalidMemcpyDirection;
# 494
case hipErrorInvalidDevicePointer:
# 495
return cudaErrorInvalidDevicePointer;
# 496
case hipErrorNotInitialized:
# 497
return cudaErrorInitializationError;
# 498
case hipErrorNoDevice:
# 499
return cudaErrorNoDevice;
# 500
case hipErrorNotReady:
# 501
return cudaErrorNotReady;
# 502
case hipErrorPeerAccessNotEnabled:
# 503
return cudaErrorPeerAccessNotEnabled;
# 504
case hipErrorPeerAccessAlreadyEnabled:
# 505
return cudaErrorPeerAccessAlreadyEnabled;
# 506
case hipErrorHostMemoryAlreadyRegistered:
# 507
return cudaErrorHostMemoryAlreadyRegistered;
# 508
case hipErrorHostMemoryNotRegistered:
# 509
return cudaErrorHostMemoryNotRegistered;
# 510
case hipErrorDeinitialized:
# 511
return cudaErrorCudartUnloading;
# 512
case hipErrorInvalidSymbol:
# 513
return cudaErrorInvalidSymbol;
# 514
case hipErrorInsufficientDriver:
# 515
return cudaErrorInsufficientDriver;
# 516
case hipErrorMissingConfiguration:
# 517
return cudaErrorMissingConfiguration;
# 518
case hipErrorPriorLaunchFailure:
# 519
return cudaErrorPriorLaunchFailure;
# 520
case hipErrorInvalidDeviceFunction:
# 521
return cudaErrorInvalidDeviceFunction;
# 522
case hipErrorInvalidImage:
# 523
return cudaErrorInvalidKernelImage;
# 524
case hipErrorInvalidContext:
# 528
return cudaErrorUnknown;
# 530
case hipErrorMapFailed:
# 531
return cudaErrorMapBufferObjectFailed;
# 532
case hipErrorUnmapFailed:
# 533
return cudaErrorUnmapBufferObjectFailed;
# 534
case hipErrorArrayIsMapped:
# 536
return cudaErrorArrayIsMapped;
# 540
case hipErrorAlreadyMapped:
# 542
return cudaErrorAlreadyMapped;
# 546
case hipErrorNoBinaryForGpu:
# 547
return cudaErrorNoKernelImageForDevice;
# 548
case hipErrorAlreadyAcquired:
# 550
return cudaErrorAlreadyAcquired;
# 554
case hipErrorNotMapped:
# 556
return cudaErrorNotMapped;
# 560
case hipErrorNotMappedAsArray:
# 562
return cudaErrorNotMappedAsArray;
# 566
case hipErrorNotMappedAsPointer:
# 568
return cudaErrorNotMappedAsPointer;
# 572
case hipErrorECCNotCorrectable:
# 573
return cudaErrorECCUncorrectable;
# 574
case hipErrorUnsupportedLimit:
# 575
return cudaErrorUnsupportedLimit;
# 576
case hipErrorContextAlreadyInUse:
# 577
return cudaErrorDeviceAlreadyInUse;
# 578
case hipErrorPeerAccessUnsupported:
# 579
return cudaErrorPeerAccessUnsupported;
# 580
case hipErrorInvalidKernelFile:
# 581
return cudaErrorInvalidPtx;
# 582
case hipErrorInvalidGraphicsContext:
# 583
return cudaErrorInvalidGraphicsContext;
# 584
case hipErrorInvalidSource:
# 586
return cudaErrorInvalidSource;
# 590
case hipErrorFileNotFound:
# 592
return cudaErrorFileNotFound;
# 596
case hipErrorSharedObjectSymbolNotFound:
# 597
return cudaErrorSharedObjectSymbolNotFound;
# 598
case hipErrorSharedObjectInitFailed:
# 599
return cudaErrorSharedObjectInitFailed;
# 600
case hipErrorOperatingSystem:
# 601
return cudaErrorOperatingSystem;
# 602
case hipErrorNotFound:
# 604
return cudaErrorSymbolNotFound;
# 608
case hipErrorIllegalAddress:
# 609
return cudaErrorIllegalAddress;
# 610
case hipErrorLaunchTimeOut:
# 611
return cudaErrorLaunchTimeout;
# 612
case hipErrorSetOnActiveProcess:
# 613
return cudaErrorSetOnActiveProcess;
# 614
case hipErrorLaunchFailure:
# 615
return cudaErrorLaunchFailure;
# 616
case hipErrorCooperativeLaunchTooLarge:
# 617
return cudaErrorCooperativeLaunchTooLarge;
# 618
case hipErrorNotSupported:
# 619
return cudaErrorNotSupported;
# 621
case hipErrorRuntimeMemory:
# 623
case hipErrorRuntimeOther:
# 624
case hipErrorUnknown:
# 625
case hipErrorTbd:
# 626
default:
# 627
return cudaErrorUnknown;
# 628
}
# 629
}
# 631
static inline cudaMemcpyKind hipMemcpyKindToCudaMemcpyKind(hipMemcpyKind kind) {
# 632
switch (kind) {
# 633
case hipMemcpyHostToHost:
# 634
return cudaMemcpyHostToHost;
# 635
case hipMemcpyHostToDevice:
# 636
return cudaMemcpyHostToDevice;
# 637
case hipMemcpyDeviceToHost:
# 638
return cudaMemcpyDeviceToHost;
# 639
case hipMemcpyDeviceToDevice:
# 640
return cudaMemcpyDeviceToDevice;
# 641
default:
# 642
return cudaMemcpyDefault;
# 643
}
# 644
}
# 646
static inline cudaTextureAddressMode hipTextureAddressModeToCudaTextureAddressMode(hipTextureAddressMode
# 647
kind) {
# 648
switch (kind) {
# 649
case cudaAddressModeWrap:
# 650
return cudaAddressModeWrap;
# 651
case cudaAddressModeClamp:
# 652
return cudaAddressModeClamp;
# 653
case cudaAddressModeMirror:
# 654
return cudaAddressModeMirror;
# 655
case cudaAddressModeBorder:
# 656
return cudaAddressModeBorder;
# 657
default:
# 658
return cudaAddressModeWrap;
# 659
}
# 660
}
# 662
static inline cudaTextureFilterMode hipTextureFilterModeToCudaTextureFilterMode(hipTextureFilterMode
# 663
kind) {
# 664
switch (kind) {
# 665
case cudaFilterModePoint:
# 666
return cudaFilterModePoint;
# 667
case cudaFilterModeLinear:
# 668
return cudaFilterModeLinear;
# 669
default:
# 670
return cudaFilterModePoint;
# 671
}
# 672
}
# 674
static inline cudaTextureReadMode hipTextureReadModeToCudaTextureReadMode(hipTextureReadMode kind) {
# 675
switch (kind) {
# 676
case cudaReadModeElementType:
# 677
return cudaReadModeElementType;
# 678
case cudaReadModeNormalizedFloat:
# 679
return cudaReadModeNormalizedFloat;
# 680
default:
# 681
return cudaReadModeElementType;
# 682
}
# 683
}
# 685
static inline cudaChannelFormatKind hipChannelFormatKindToCudaChannelFormatKind(hipChannelFormatKind
# 686
kind) {
# 687
switch (kind) {
# 688
case cudaChannelFormatKindSigned:
# 689
return cudaChannelFormatKindSigned;
# 690
case cudaChannelFormatKindUnsigned:
# 691
return cudaChannelFormatKindUnsigned;
# 692
case cudaChannelFormatKindFloat:
# 693
return cudaChannelFormatKindFloat;
# 694
case cudaChannelFormatKindNone:
# 695
return cudaChannelFormatKindNone;
# 696
default:
# 697
return cudaChannelFormatKindNone;
# 698
}
# 699
}
# 705
typedef void (*hipStreamCallback_t)(hipStream_t stream, hipError_t status, void * userData);
# 706
static inline hipError_t hipInit(unsigned flags) {
# 707
return hipCUResultTohipError(cuInit(flags));
# 708
}
# 710
static inline hipError_t hipDeviceReset() { return hipCUDAErrorTohipError(cudaDeviceReset()); }
# 712
static inline hipError_t hipGetLastError() { return hipCUDAErrorTohipError(cudaGetLastError()); }
# 714
static inline hipError_t hipPeekAtLastError() {
# 715
return hipCUDAErrorTohipError(cudaPeekAtLastError());
# 716
}
# 718
static inline hipError_t hipMalloc(void **ptr, size_t size) {
# 719
return hipCUDAErrorTohipError(cudaMalloc(ptr, size));
# 720
}
# 722
static inline hipError_t hipMallocPitch(void **ptr, size_t *pitch, size_t width, size_t height) {
# 723
return hipCUDAErrorTohipError(cudaMallocPitch(ptr, pitch, width, height));
# 724
}
# 726
static inline hipError_t hipMemAllocPitch(hipDeviceptr_t *dptr, size_t *pitch, size_t widthInBytes, size_t height, unsigned elementSizeBytes) {
# 727
return hipCUResultTohipError(cuMemAllocPitch_v2(dptr, pitch, widthInBytes, height, elementSizeBytes));
# 728
}
# 730
static inline hipError_t hipMalloc3D(hipPitchedPtr *pitchedDevPtr, hipExtent extent) {
# 731
return hipCUDAErrorTohipError(cudaMalloc3D(pitchedDevPtr, extent));
# 732
}
# 734
static inline hipError_t hipFree(void *ptr) { return hipCUDAErrorTohipError(cudaFree(ptr)); }
# 736
static inline hipError_t hipMallocHost(void ** ptr, size_t size)
# 737
__attribute((deprecated("use hipHostMalloc instead")));
# 738
static inline hipError_t hipMallocHost(void **ptr, size_t size) {
# 739
return hipCUDAErrorTohipError(cudaMallocHost(ptr, size));
# 740
}
# 742
static inline hipError_t hipMemAllocHost(void ** ptr, size_t size)
# 743
__attribute((deprecated("use hipHostMalloc instead")));
# 744
static inline hipError_t hipMemAllocHost(void **ptr, size_t size) {
# 745
return hipCUResultTohipError(cuMemAllocHost_v2(ptr, size));
# 746
}
# 748
static inline hipError_t hipHostAlloc(void ** ptr, size_t size, unsigned flags)
# 749
__attribute((deprecated("use hipHostMalloc instead")));
# 750
static inline hipError_t hipHostAlloc(void **ptr, size_t size, unsigned flags) {
# 751
return hipCUDAErrorTohipError(cudaHostAlloc(ptr, size, flags));
# 752
}
# 754
static inline hipError_t hipHostMalloc(void **ptr, size_t size, unsigned flags) {
# 755
return hipCUDAErrorTohipError(cudaHostAlloc(ptr, size, flags));
# 756
}
# 758
static inline hipError_t hipMallocManaged(void **ptr, size_t size, unsigned flags) {
# 759
return hipCUDAErrorTohipError(cudaMallocManaged(ptr, size, flags));
# 760
}
# 762
static inline hipError_t hipMallocArray(hipArray **array, const hipChannelFormatDesc *desc, size_t
# 763
width, size_t height, unsigned
# 764
flags = 0) {
# 765
return hipCUDAErrorTohipError(cudaMallocArray(array, desc, width, height, flags));
# 766
}
# 768
static inline hipError_t hipMalloc3DArray(hipArray **array, const hipChannelFormatDesc *desc, hipExtent
# 769
extent, unsigned flags) {
# 770
return hipCUDAErrorTohipError(cudaMalloc3DArray(array, desc, extent, flags));
# 771
}
# 773
static inline hipError_t hipFreeArray(hipArray *array) {
# 774
return hipCUDAErrorTohipError(cudaFreeArray(array));
# 775
}
# 777
static inline hipError_t hipHostGetDevicePointer(void **devPtr, void *hostPtr, unsigned flags) {
# 778
return hipCUDAErrorTohipError(cudaHostGetDevicePointer(devPtr, hostPtr, flags));
# 779
}
# 781
static inline hipError_t hipHostGetFlags(unsigned *flagsPtr, void *hostPtr) {
# 782
return hipCUDAErrorTohipError(cudaHostGetFlags(flagsPtr, hostPtr));
# 783
}
# 785
static inline hipError_t hipHostRegister(void *ptr, size_t size, unsigned flags) {
# 786
return hipCUDAErrorTohipError(cudaHostRegister(ptr, size, flags));
# 787
}
# 789
static inline hipError_t hipHostUnregister(void *ptr) {
# 790
return hipCUDAErrorTohipError(cudaHostUnregister(ptr));
# 791
}
# 793
static inline hipError_t hipFreeHost(void * ptr)
# 794
__attribute((deprecated("use hipHostFree instead")));
# 795
static inline hipError_t hipFreeHost(void *ptr) {
# 796
return hipCUDAErrorTohipError(cudaFreeHost(ptr));
# 797
}
# 799
static inline hipError_t hipHostFree(void *ptr) {
# 800
return hipCUDAErrorTohipError(cudaFreeHost(ptr));
# 801
}
# 803
static inline hipError_t hipSetDevice(int device) {
# 804
return hipCUDAErrorTohipError(cudaSetDevice(device));
# 805
}
# 807
static inline hipError_t hipChooseDevice(int *device, const hipDeviceProp_t *prop) {
# 808
cudaDeviceProp cdprop;
# 809
memset(&cdprop, 0, sizeof(cudaDeviceProp));
# 810
(cdprop.major) = (prop->major);
# 811
(cdprop.minor) = (prop->minor);
# 812
(cdprop.totalGlobalMem) = (prop->totalGlobalMem);
# 813
(cdprop.sharedMemPerBlock) = (prop->sharedMemPerBlock);
# 814
(cdprop.regsPerBlock) = (prop->regsPerBlock);
# 815
(cdprop.warpSize) = (prop->warpSize);
# 816
(cdprop.maxThreadsPerBlock) = (prop->maxThreadsPerBlock);
# 817
(cdprop.clockRate) = (prop->clockRate);
# 818
(cdprop.totalConstMem) = (prop->totalConstMem);
# 819
(cdprop.multiProcessorCount) = (prop->multiProcessorCount);
# 820
(cdprop.l2CacheSize) = (prop->l2CacheSize);
# 821
(cdprop.maxThreadsPerMultiProcessor) = (prop->maxThreadsPerMultiProcessor);
# 822
(cdprop.computeMode) = (prop->computeMode);
# 823
(cdprop.canMapHostMemory) = (prop->canMapHostMemory);
# 824
(cdprop.memoryClockRate) = (prop->memoryClockRate);
# 825
(cdprop.memoryBusWidth) = (prop->memoryBusWidth);
# 826
return hipCUDAErrorTohipError(cudaChooseDevice(device, &cdprop));
# 827
}
# 829
static inline hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void *src, size_t size) {
# 830
return hipCUResultTohipError(cuMemcpyHtoD_v2(dst, src, size));
# 831
}
# 833
static inline hipError_t hipMemcpyDtoH(void *dst, hipDeviceptr_t src, size_t size) {
# 834
return hipCUResultTohipError(cuMemcpyDtoH_v2(dst, src, size));
# 835
}
# 837
static inline hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t size) {
# 838
return hipCUResultTohipError(cuMemcpyDtoD_v2(dst, src, size));
# 839
}
# 841
static inline hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void *src, size_t size, hipStream_t
# 842
stream) {
# 843
return hipCUResultTohipError(cuMemcpyHtoDAsync_v2(dst, src, size, stream));
# 844
}
# 846
static inline hipError_t hipMemcpyDtoHAsync(void *dst, hipDeviceptr_t src, size_t size, hipStream_t
# 847
stream) {
# 848
return hipCUResultTohipError(cuMemcpyDtoHAsync_v2(dst, src, size, stream));
# 849
}
# 851
static inline hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t size, hipStream_t
# 852
stream) {
# 853
return hipCUResultTohipError(cuMemcpyDtoDAsync_v2(dst, src, size, stream));
# 854
}
# 856
static inline hipError_t hipMemcpy(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind
# 857
copyKind) {
# 858
return hipCUDAErrorTohipError(cudaMemcpy(dst, src, sizeBytes, hipMemcpyKindToCudaMemcpyKind(copyKind)));
# 860
}
# 863
inline hipError_t hipMemcpyWithStream(void *dst, const void *src, size_t
# 864
sizeBytes, hipMemcpyKind copyKind, hipStream_t
# 865
stream) {
# 866
cudaError_t error = cudaMemcpyAsync(dst, src, sizeBytes, hipMemcpyKindToCudaMemcpyKind(copyKind), stream);
# 870
if (error != (cudaSuccess)) { return hipCUDAErrorTohipError(error); }
# 872
return hipCUDAErrorTohipError(cudaStreamSynchronize(stream));
# 873
}
# 875
static inline hipError_t hipMemcpyAsync(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind
# 876
copyKind, hipStream_t stream = 0) {
# 877
return hipCUDAErrorTohipError(cudaMemcpyAsync(dst, src, sizeBytes, hipMemcpyKindToCudaMemcpyKind(copyKind), stream));
# 879
}
# 881
static inline hipError_t hipMemcpyToSymbol(const void *symbol, const void *src, size_t sizeBytes, size_t
# 882
offset = 0, hipMemcpyKind
# 883
copyType = hipMemcpyHostToDevice) {
# 884
return hipCUDAErrorTohipError(cudaMemcpyToSymbol(symbol, src, sizeBytes, offset, hipMemcpyKindToCudaMemcpyKind(copyType)));
# 886
}
# 888
static inline hipError_t hipMemcpyToSymbolAsync(const void *symbol, const void *src, size_t
# 889
sizeBytes, size_t offset, hipMemcpyKind
# 890
copyType, hipStream_t
# 891
stream = 0) {
# 892
return hipCUDAErrorTohipError(cudaMemcpyToSymbolAsync(symbol, src, sizeBytes, offset, hipMemcpyKindToCudaMemcpyKind(copyType), stream));
# 894
}
# 896
static inline hipError_t hipMemcpyFromSymbol(void *dst, const void *symbolName, size_t sizeBytes, size_t
# 897
offset = 0, hipMemcpyKind
# 898
kind = hipMemcpyDeviceToHost) {
# 899
return hipCUDAErrorTohipError(cudaMemcpyFromSymbol(dst, symbolName, sizeBytes, offset, hipMemcpyKindToCudaMemcpyKind(kind)));
# 901
}
# 903
static inline hipError_t hipMemcpyFromSymbolAsync(void *dst, const void *symbolName, size_t
# 904
sizeBytes, size_t offset, hipMemcpyKind
# 905
kind, hipStream_t
# 906
stream = 0) {
# 907
return hipCUDAErrorTohipError(cudaMemcpyFromSymbolAsync(dst, symbolName, sizeBytes, offset, hipMemcpyKindToCudaMemcpyKind(kind), stream));
# 909
}
# 911
static inline hipError_t hipGetSymbolAddress(void **devPtr, const void *symbolName) {
# 912
return hipCUDAErrorTohipError(cudaGetSymbolAddress(devPtr, symbolName));
# 913
}
# 915
static inline hipError_t hipGetSymbolSize(size_t *size, const void *symbolName) {
# 916
return hipCUDAErrorTohipError(cudaGetSymbolSize(size, symbolName));
# 917
}
# 919
static inline hipError_t hipMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t
# 920
width, size_t height, hipMemcpyKind kind) {
# 921
return hipCUDAErrorTohipError(cudaMemcpy2D(dst, dpitch, src, spitch, width, height, hipMemcpyKindToCudaMemcpyKind(kind)));
# 923
}
# 925
static inline hipError_t hipMemcpyParam2D(const CUDA_MEMCPY2D *pCopy) {
# 926
return hipCUResultTohipError(cuMemcpy2D_v2(pCopy));
# 927
}
# 929
static inline hipError_t hipMemcpyParam2DAsync(const CUDA_MEMCPY2D *pCopy, hipStream_t stream = 0) {
# 930
return hipCUResultTohipError(cuMemcpy2DAsync_v2(pCopy, stream));
# 931
}
# 933
static inline hipError_t hipMemcpy3D(const cudaMemcpy3DParms *p)
# 934
{
# 935
return hipCUDAErrorTohipError(cudaMemcpy3D(p));
# 936
}
# 938
static inline hipError_t hipMemcpy3DAsync(const cudaMemcpy3DParms *p, hipStream_t stream)
# 939
{
# 940
return hipCUDAErrorTohipError(cudaMemcpy3DAsync(p, stream));
# 941
}
# 943
static inline hipError_t hipMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t
# 944
width, size_t height, hipMemcpyKind kind, hipStream_t
# 945
stream) {
# 946
return hipCUDAErrorTohipError(cudaMemcpy2DAsync(dst, dpitch, src, spitch, width, height, hipMemcpyKindToCudaMemcpyKind(kind), stream));
# 948
}
# 950
static inline hipError_t hipMemcpy2DToArray(hipArray *dst, size_t wOffset, size_t hOffset, const void *
# 951
src, size_t spitch, size_t width, size_t
# 952
height, hipMemcpyKind kind) {
# 953
return hipCUDAErrorTohipError(cudaMemcpy2DToArray(dst, wOffset, hOffset, src, spitch, width, height, hipMemcpyKindToCudaMemcpyKind(kind)));
# 955
}
# 957
static inline hipError_t hipMemcpyToArray(hipArray *dst, size_t wOffset, size_t hOffset, const void *
# 958
src, size_t count, hipMemcpyKind kind) {
# 959
return hipCUDAErrorTohipError(cudaMemcpyToArray(dst, wOffset, hOffset, src, count, hipMemcpyKindToCudaMemcpyKind(kind)));
# 961
}
# 963
static inline hipError_t hipMemcpyFromArray(void *dst, hipArray_const_t srcArray, size_t wOffset, size_t
# 964
hOffset, size_t count, hipMemcpyKind kind) {
# 965
return hipCUDAErrorTohipError(cudaMemcpyFromArray(dst, srcArray, wOffset, hOffset, count, hipMemcpyKindToCudaMemcpyKind(kind)));
# 967
}
# 969
static inline hipError_t hipMemcpyAtoH(void *dst, hipArray *srcArray, size_t srcOffset, size_t
# 970
count) {
# 971
return hipCUResultTohipError(cuMemcpyAtoH_v2(dst, (CUarray)srcArray, srcOffset, count));
# 972
}
# 974
static inline hipError_t hipMemcpyHtoA(hipArray *dstArray, size_t dstOffset, const void *srcHost, size_t
# 975
count) {
# 976
return hipCUResultTohipError(cuMemcpyHtoA_v2((CUarray)dstArray, dstOffset, srcHost, count));
# 977
}
# 979
static inline hipError_t hipDeviceSynchronize() {
# 980
return hipCUDAErrorTohipError(cudaDeviceSynchronize());
# 981
}
# 983
static inline hipError_t hipDeviceGetCacheConfig(hipFuncCache_t *pCacheConfig) {
# 984
return hipCUDAErrorTohipError(cudaDeviceGetCacheConfig(pCacheConfig));
# 985
}
# 987
static inline hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig) {
# 988
return hipCUDAErrorTohipError(cudaDeviceSetCacheConfig(cacheConfig));
# 989
}
# 991
static inline const char *hipGetErrorString(hipError_t error) {
# 992
return cudaGetErrorString(hipErrorToCudaError(error));
# 993
}
# 995
static inline const char *hipGetErrorName(hipError_t error) {
# 996
return cudaGetErrorName(hipErrorToCudaError(error));
# 997
}
# 999
static inline hipError_t hipGetDeviceCount(int *count) {
# 1000
return hipCUDAErrorTohipError(cudaGetDeviceCount(count));
# 1001
}
# 1003
static inline hipError_t hipGetDevice(int *device) {
# 1004
return hipCUDAErrorTohipError(cudaGetDevice(device));
# 1005
}
# 1007
static inline hipError_t hipIpcCloseMemHandle(void *devPtr) {
# 1008
return hipCUDAErrorTohipError(cudaIpcCloseMemHandle(devPtr));
# 1009
}
# 1011
static inline hipError_t hipIpcGetEventHandle(hipIpcEventHandle_t *handle, hipEvent_t event) {
# 1012
return hipCUDAErrorTohipError(cudaIpcGetEventHandle(handle, event));
# 1013
}
# 1015
static inline hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t *handle, void *devPtr) {
# 1016
return hipCUDAErrorTohipError(cudaIpcGetMemHandle(handle, devPtr));
# 1017
}
# 1019
static inline hipError_t hipIpcOpenEventHandle(hipEvent_t *event, hipIpcEventHandle_t handle) {
# 1020
return hipCUDAErrorTohipError(cudaIpcOpenEventHandle(event, handle));
# 1021
}
# 1023
static inline hipError_t hipIpcOpenMemHandle(void **devPtr, hipIpcMemHandle_t handle, unsigned
# 1024
flags) {
# 1025
return hipCUDAErrorTohipError(cudaIpcOpenMemHandle(devPtr, handle, flags));
# 1026
}
# 1028
static inline hipError_t hipMemset(void *devPtr, int value, size_t count) {
# 1029
return hipCUDAErrorTohipError(cudaMemset(devPtr, value, count));
# 1030
}
# 1032
static inline hipError_t hipMemsetD32(hipDeviceptr_t devPtr, int value, size_t count) {
# 1033
return hipCUResultTohipError(cuMemsetD32_v2(devPtr, value, count));
# 1034
}
# 1036
static inline hipError_t hipMemsetAsync(void *devPtr, int value, size_t count, hipStream_t
# 1037
stream = 0) {
# 1038
return hipCUDAErrorTohipError(cudaMemsetAsync(devPtr, value, count, stream));
# 1039
}
# 1041
static inline hipError_t hipMemsetD32Async(hipDeviceptr_t devPtr, int value, size_t count, hipStream_t
# 1042
stream = 0) {
# 1043
return hipCUResultTohipError(cuMemsetD32Async(devPtr, value, count, stream));
# 1044
}
# 1046
static inline hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t sizeBytes) {
# 1047
return hipCUResultTohipError(cuMemsetD8_v2(dest, value, sizeBytes));
# 1048
}
# 1050
static inline hipError_t hipMemsetD8Async(hipDeviceptr_t dest, unsigned char value, size_t sizeBytes, hipStream_t
# 1051
stream = 0) {
# 1052
return hipCUResultTohipError(cuMemsetD8Async(dest, value, sizeBytes, stream));
# 1053
}
# 1055
static inline hipError_t hipMemsetD16(hipDeviceptr_t dest, unsigned short value, size_t sizeBytes) {
# 1056
return hipCUResultTohipError(cuMemsetD16_v2(dest, value, sizeBytes));
# 1057
}
# 1059
static inline hipError_t hipMemsetD16Async(hipDeviceptr_t dest, unsigned short value, size_t sizeBytes, hipStream_t
# 1060
stream = 0) {
# 1061
return hipCUResultTohipError(cuMemsetD16Async(dest, value, sizeBytes, stream));
# 1062
}
# 1064
static inline hipError_t hipMemset2D(void *dst, size_t pitch, int value, size_t width, size_t height) {
# 1065
return hipCUDAErrorTohipError(cudaMemset2D(dst, pitch, value, width, height));
# 1066
}
# 1068
static inline hipError_t hipMemset2DAsync(void *dst, size_t pitch, int value, size_t width, size_t height, hipStream_t stream = 0) {
# 1069
return hipCUDAErrorTohipError(cudaMemset2DAsync(dst, pitch, value, width, height, stream));
# 1070
}
# 1072
static inline hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent) {
# 1073
return hipCUDAErrorTohipError(cudaMemset3D(pitchedDevPtr, value, extent));
# 1074
}
# 1076
static inline hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent, hipStream_t stream = 0) {
# 1077
return hipCUDAErrorTohipError(cudaMemset3DAsync(pitchedDevPtr, value, extent, stream));
# 1078
}
# 1080
static inline hipError_t hipGetDeviceProperties(hipDeviceProp_t *p_prop, int device) {
# 1081
cudaDeviceProp cdprop;
# 1082
cudaError_t cerror;
# 1083
cerror = cudaGetDeviceProperties(&cdprop, device);
# 1085
strncpy(p_prop->name, cdprop.name, 256);
# 1086
(p_prop->totalGlobalMem) = (cdprop.totalGlobalMem);
# 1087
(p_prop->sharedMemPerBlock) = (cdprop.sharedMemPerBlock);
# 1088
(p_prop->regsPerBlock) = (cdprop.regsPerBlock);
# 1089
(p_prop->warpSize) = (cdprop.warpSize);
# 1090
(p_prop->maxThreadsPerBlock) = (cdprop.maxThreadsPerBlock);
# 1091
for (int i = 0; i < 3; i++) {
# 1092
((p_prop->maxThreadsDim)[i]) = ((cdprop.maxThreadsDim)[i]);
# 1093
((p_prop->maxGridSize)[i]) = ((cdprop.maxGridSize)[i]);
# 1094
}
# 1095
(p_prop->clockRate) = (cdprop.clockRate);
# 1096
(p_prop->memoryClockRate) = (cdprop.memoryClockRate);
# 1097
(p_prop->memoryBusWidth) = (cdprop.memoryBusWidth);
# 1098
(p_prop->totalConstMem) = (cdprop.totalConstMem);
# 1099
(p_prop->major) = (cdprop.major);
# 1100
(p_prop->minor) = (cdprop.minor);
# 1101
(p_prop->multiProcessorCount) = (cdprop.multiProcessorCount);
# 1102
(p_prop->l2CacheSize) = (cdprop.l2CacheSize);
# 1103
(p_prop->maxThreadsPerMultiProcessor) = (cdprop.maxThreadsPerMultiProcessor);
# 1104
(p_prop->computeMode) = (cdprop.computeMode);
# 1105
(p_prop->clockInstructionRate) = (cdprop.clockRate);
# 1107
int ccVers = ((p_prop->major) * 100) + ((p_prop->minor) * 10);
# 1108
((p_prop->arch).hasGlobalInt32Atomics) = (ccVers >= 110);
# 1109
((p_prop->arch).hasGlobalFloatAtomicExch) = (ccVers >= 110);
# 1110
((p_prop->arch).hasSharedInt32Atomics) = (ccVers >= 120);
# 1111
((p_prop->arch).hasSharedFloatAtomicExch) = (ccVers >= 120);
# 1112
((p_prop->arch).hasFloatAtomicAdd) = (ccVers >= 200);
# 1113
((p_prop->arch).hasGlobalInt64Atomics) = (ccVers >= 120);
# 1114
((p_prop->arch).hasSharedInt64Atomics) = (ccVers >= 110);
# 1115
((p_prop->arch).hasDoubles) = (ccVers >= 130);
# 1116
((p_prop->arch).hasWarpVote) = (ccVers >= 120);
# 1117
((p_prop->arch).hasWarpBallot) = (ccVers >= 200);
# 1118
((p_prop->arch).hasWarpShuffle) = (ccVers >= 300);
# 1119
((p_prop->arch).hasFunnelShift) = (ccVers >= 350);
# 1120
((p_prop->arch).hasThreadFenceSystem) = (ccVers >= 200);
# 1121
((p_prop->arch).hasSyncThreadsExt) = (ccVers >= 200);
# 1122
((p_prop->arch).hasSurfaceFuncs) = (ccVers >= 200);
# 1123
((p_prop->arch).has3dGrid) = (ccVers >= 200);
# 1124
((p_prop->arch).hasDynamicParallelism) = (ccVers >= 350);
# 1126
(p_prop->concurrentKernels) = (cdprop.concurrentKernels);
# 1127
(p_prop->pciDomainID) = (cdprop.pciDomainID);
# 1128
(p_prop->pciBusID) = (cdprop.pciBusID);
# 1129
(p_prop->pciDeviceID) = (cdprop.pciDeviceID);
# 1130
(p_prop->maxSharedMemoryPerMultiProcessor) = (cdprop.sharedMemPerMultiprocessor);
# 1131
(p_prop->isMultiGpuBoard) = (cdprop.isMultiGpuBoard);
# 1132
(p_prop->canMapHostMemory) = (cdprop.canMapHostMemory);
# 1133
(p_prop->gcnArch) = 0;
# 1134
(p_prop->integrated) = (cdprop.integrated);
# 1135
(p_prop->cooperativeLaunch) = (cdprop.cooperativeLaunch);
# 1136
(p_prop->cooperativeMultiDeviceLaunch) = (cdprop.cooperativeMultiDeviceLaunch);
# 1138
(p_prop->maxTexture1D) = (cdprop.maxTexture1D);
# 1139
((p_prop->maxTexture2D)[0]) = ((cdprop.maxTexture2D)[0]);
# 1140
((p_prop->maxTexture2D)[1]) = ((cdprop.maxTexture2D)[1]);
# 1141
((p_prop->maxTexture3D)[0]) = ((cdprop.maxTexture3D)[0]);
# 1142
((p_prop->maxTexture3D)[1]) = ((cdprop.maxTexture3D)[1]);
# 1143
((p_prop->maxTexture3D)[2]) = ((cdprop.maxTexture3D)[2]);
# 1145
(p_prop->memPitch) = (cdprop.memPitch);
# 1146
(p_prop->textureAlignment) = (cdprop.textureAlignment);
# 1147
(p_prop->texturePitchAlignment) = (cdprop.texturePitchAlignment);
# 1148
(p_prop->kernelExecTimeoutEnabled) = (cdprop.kernelExecTimeoutEnabled);
# 1149
(p_prop->ECCEnabled) = (cdprop.ECCEnabled);
# 1150
(p_prop->tccDriver) = (cdprop.tccDriver);
# 1152
return hipCUDAErrorTohipError(cerror);
# 1153
}
# 1155
static inline hipError_t hipDeviceGetAttribute(int *pi, hipDeviceAttribute_t attr, int device) {
# 1156
cudaDeviceAttr cdattr;
# 1157
cudaError_t cerror;
# 1159
switch (attr) {
# 1160
case hipDeviceAttributeMaxThreadsPerBlock:
# 1161
cdattr = cudaDevAttrMaxThreadsPerBlock;
# 1162
break;
# 1163
case hipDeviceAttributeMaxBlockDimX:
# 1164
cdattr = cudaDevAttrMaxBlockDimX;
# 1165
break;
# 1166
case hipDeviceAttributeMaxBlockDimY:
# 1167
cdattr = cudaDevAttrMaxBlockDimY;
# 1168
break;
# 1169
case hipDeviceAttributeMaxBlockDimZ:
# 1170
cdattr = cudaDevAttrMaxBlockDimZ;
# 1171
break;
# 1172
case hipDeviceAttributeMaxGridDimX:
# 1173
cdattr = cudaDevAttrMaxGridDimX;
# 1174
break;
# 1175
case hipDeviceAttributeMaxGridDimY:
# 1176
cdattr = cudaDevAttrMaxGridDimY;
# 1177
break;
# 1178
case hipDeviceAttributeMaxGridDimZ:
# 1179
cdattr = cudaDevAttrMaxGridDimZ;
# 1180
break;
# 1181
case hipDeviceAttributeMaxSharedMemoryPerBlock:
# 1182
cdattr = cudaDevAttrMaxSharedMemoryPerBlock;
# 1183
break;
# 1184
case hipDeviceAttributeTotalConstantMemory:
# 1185
cdattr = cudaDevAttrTotalConstantMemory;
# 1186
break;
# 1187
case hipDeviceAttributeWarpSize:
# 1188
cdattr = cudaDevAttrWarpSize;
# 1189
break;
# 1190
case hipDeviceAttributeMaxRegistersPerBlock:
# 1191
cdattr = cudaDevAttrMaxRegistersPerBlock;
# 1192
break;
# 1193
case hipDeviceAttributeClockRate:
# 1194
cdattr = cudaDevAttrClockRate;
# 1195
break;
# 1196
case hipDeviceAttributeMemoryClockRate:
# 1197
cdattr = cudaDevAttrMemoryClockRate;
# 1198
break;
# 1199
case hipDeviceAttributeMemoryBusWidth:
# 1200
cdattr = cudaDevAttrGlobalMemoryBusWidth;
# 1201
break;
# 1202
case hipDeviceAttributeMultiprocessorCount:
# 1203
cdattr = cudaDevAttrMultiProcessorCount;
# 1204
break;
# 1205
case hipDeviceAttributeComputeMode:
# 1206
cdattr = cudaDevAttrComputeMode;
# 1207
break;
# 1208
case hipDeviceAttributeL2CacheSize:
# 1209
cdattr = cudaDevAttrL2CacheSize;
# 1210
break;
# 1211
case hipDeviceAttributeMaxThreadsPerMultiProcessor:
# 1212
cdattr = cudaDevAttrMaxThreadsPerMultiProcessor;
# 1213
break;
# 1214
case hipDeviceAttributeComputeCapabilityMajor:
# 1215
cdattr = cudaDevAttrComputeCapabilityMajor;
# 1216
break;
# 1217
case hipDeviceAttributeComputeCapabilityMinor:
# 1218
cdattr = cudaDevAttrComputeCapabilityMinor;
# 1219
break;
# 1220
case hipDeviceAttributeConcurrentKernels:
# 1221
cdattr = cudaDevAttrConcurrentKernels;
# 1222
break;
# 1223
case hipDeviceAttributePciBusId:
# 1224
cdattr = cudaDevAttrPciBusId;
# 1225
break;
# 1226
case hipDeviceAttributePciDeviceId:
# 1227
cdattr = cudaDevAttrPciDeviceId;
# 1228
break;
# 1229
case hipDeviceAttributeMaxSharedMemoryPerMultiprocessor:
# 1230
cdattr = cudaDevAttrMaxSharedMemoryPerMultiprocessor;
# 1231
break;
# 1232
case hipDeviceAttributeIsMultiGpuBoard:
# 1233
cdattr = cudaDevAttrIsMultiGpuBoard;
# 1234
break;
# 1235
case hipDeviceAttributeIntegrated:
# 1236
cdattr = cudaDevAttrIntegrated;
# 1237
break;
# 1238
case hipDeviceAttributeMaxTexture1DWidth:
# 1239
cdattr = cudaDevAttrMaxTexture1DWidth;
# 1240
break;
# 1241
case hipDeviceAttributeMaxTexture2DWidth:
# 1242
cdattr = cudaDevAttrMaxTexture2DWidth;
# 1243
break;
# 1244
case hipDeviceAttributeMaxTexture2DHeight:
# 1245
cdattr = cudaDevAttrMaxTexture2DHeight;
# 1246
break;
# 1247
case hipDeviceAttributeMaxTexture3DWidth:
# 1248
cdattr = cudaDevAttrMaxTexture3DWidth;
# 1249
break;
# 1250
case hipDeviceAttributeMaxTexture3DHeight:
# 1251
cdattr = cudaDevAttrMaxTexture3DHeight;
# 1252
break;
# 1253
case hipDeviceAttributeMaxTexture3DDepth:
# 1254
cdattr = cudaDevAttrMaxTexture3DDepth;
# 1255
break;
# 1256
case hipDeviceAttributeMaxPitch:
# 1257
cdattr = cudaDevAttrMaxPitch;
# 1258
break;
# 1259
case hipDeviceAttributeTextureAlignment:
# 1260
cdattr = cudaDevAttrTextureAlignment;
# 1261
break;
# 1262
case hipDeviceAttributeTexturePitchAlignment:
# 1263
cdattr = cudaDevAttrTexturePitchAlignment;
# 1264
break;
# 1265
case hipDeviceAttributeKernelExecTimeout:
# 1266
cdattr = cudaDevAttrKernelExecTimeout;
# 1267
break;
# 1268
case hipDeviceAttributeCanMapHostMemory:
# 1269
cdattr = cudaDevAttrCanMapHostMemory;
# 1270
break;
# 1271
case hipDeviceAttributeEccEnabled:
# 1272
cdattr = cudaDevAttrEccEnabled;
# 1273
break;
# 1274
default:
# 1275
return hipCUDAErrorTohipError(cudaErrorInvalidValue);
# 1276
}
# 1278
cerror = cudaDeviceGetAttribute(pi, cdattr, device);
# 1280
return hipCUDAErrorTohipError(cerror);
# 1281
}
# 1283
static inline hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *
# 1284
func, int
# 1285
blockSize, size_t
# 1286
dynamicSMemSize) {
# 1287
cudaError_t cerror;
# 1288
cerror = cudaOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize);
# 1290
return hipCUDAErrorTohipError(cerror);
# 1291
}
# 1293
static inline hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, const void *ptr) {
# 1294
cudaPointerAttributes cPA;
# 1295
hipError_t err = hipCUDAErrorTohipError(cudaPointerGetAttributes(&cPA, ptr));
# 1296
if (err == (hipSuccess)) {
# 1297
switch (cPA.memoryType) {
# 1298
case cudaMemoryTypeDevice:
# 1299
(attributes->memoryType) = hipMemoryTypeDevice;
# 1300
break;
# 1301
case cudaMemoryTypeHost:
# 1302
(attributes->memoryType) = hipMemoryTypeHost;
# 1303
break;
# 1304
default:
# 1305
return hipErrorUnknown;
# 1306
}
# 1307
(attributes->device) = (cPA.device);
# 1308
(attributes->devicePointer) = (cPA.devicePointer);
# 1309
(attributes->hostPointer) = (cPA.hostPointer);
# 1310
(attributes->isManaged) = 0;
# 1311
(attributes->allocationFlags) = (0);
# 1312
}
# 1313
return err;
# 1314
}
# 1316
static inline hipError_t hipMemGetInfo(size_t *free, size_t *total) {
# 1317
return hipCUDAErrorTohipError(cudaMemGetInfo(free, total));
# 1318
}
# 1320
static inline hipError_t hipEventCreate(hipEvent_t *event) {
# 1321
return hipCUDAErrorTohipError(cudaEventCreate(event));
# 1322
}
# 1324
static inline hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream = 0) {
# 1325
return hipCUDAErrorTohipError(cudaEventRecord(event, stream));
# 1326
}
# 1328
static inline hipError_t hipEventSynchronize(hipEvent_t event) {
# 1329
return hipCUDAErrorTohipError(cudaEventSynchronize(event));
# 1330
}
# 1332
static inline hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop) {
# 1333
return hipCUDAErrorTohipError(cudaEventElapsedTime(ms, start, stop));
# 1334
}
# 1336
static inline hipError_t hipEventDestroy(hipEvent_t event) {
# 1337
return hipCUDAErrorTohipError(cudaEventDestroy(event));
# 1338
}
# 1340
static inline hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned flags) {
# 1341
return hipCUDAErrorTohipError(cudaStreamCreateWithFlags(stream, flags));
# 1342
}
# 1344
static inline hipError_t hipStreamCreateWithPriority(hipStream_t *stream, unsigned flags, int priority) {
# 1345
return hipCUDAErrorTohipError(cudaStreamCreateWithPriority(stream, flags, priority));
# 1346
}
# 1348
static inline hipError_t hipDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority) {
# 1349
return hipCUDAErrorTohipError(cudaDeviceGetStreamPriorityRange(leastPriority, greatestPriority));
# 1350
}
# 1352
static inline hipError_t hipStreamCreate(hipStream_t *stream) {
# 1353
return hipCUDAErrorTohipError(cudaStreamCreate(stream));
# 1354
}
# 1356
static inline hipError_t hipStreamSynchronize(hipStream_t stream) {
# 1357
return hipCUDAErrorTohipError(cudaStreamSynchronize(stream));
# 1358
}
# 1360
static inline hipError_t hipStreamDestroy(hipStream_t stream) {
# 1361
return hipCUDAErrorTohipError(cudaStreamDestroy(stream));
# 1362
}
# 1364
static inline hipError_t hipStreamGetFlags(hipStream_t stream, unsigned *flags) {
# 1365
return hipCUDAErrorTohipError(cudaStreamGetFlags(stream, flags));
# 1366
}
# 1368
static inline hipError_t hipStreamGetPriority(hipStream_t stream, int *priority) {
# 1369
return hipCUDAErrorTohipError(cudaStreamGetPriority(stream, priority));
# 1370
}
# 1372
static inline hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned
# 1373
flags) {
# 1374
return hipCUDAErrorTohipError(cudaStreamWaitEvent(stream, event, flags));
# 1375
}
# 1377
static inline hipError_t hipStreamQuery(hipStream_t stream) {
# 1378
return hipCUDAErrorTohipError(cudaStreamQuery(stream));
# 1379
}
# 1381
static inline hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void *
# 1382
userData, unsigned flags) {
# 1383
return hipCUDAErrorTohipError(cudaStreamAddCallback(stream, (cudaStreamCallback_t)callback, userData, flags));
# 1385
}
# 1387
static inline hipError_t hipDriverGetVersion(int *driverVersion) {
# 1388
cudaError_t err = cudaDriverGetVersion(driverVersion);
# 1391
(*driverVersion) = 4;
# 1393
return hipCUDAErrorTohipError(err);
# 1394
}
# 1396
static inline hipError_t hipRuntimeGetVersion(int *runtimeVersion) {
# 1397
return hipCUDAErrorTohipError(cudaRuntimeGetVersion(runtimeVersion));
# 1398
}
# 1400
static inline hipError_t hipDeviceCanAccessPeer(int *canAccessPeer, int device, int peerDevice) {
# 1401
return hipCUDAErrorTohipError(cudaDeviceCanAccessPeer(canAccessPeer, device, peerDevice));
# 1402
}
# 1404
static inline hipError_t hipDeviceDisablePeerAccess(int peerDevice) {
# 1405
return hipCUDAErrorTohipError(cudaDeviceDisablePeerAccess(peerDevice));
# 1406
}
# 1408
static inline hipError_t hipDeviceEnablePeerAccess(int peerDevice, unsigned flags) {
# 1409
return hipCUDAErrorTohipError(cudaDeviceEnablePeerAccess(peerDevice, flags));
# 1410
}
# 1412
static inline hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx) {
# 1413
return hipCUResultTohipError(cuCtxDisablePeerAccess(peerCtx));
# 1414
}
# 1416
static inline hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned flags) {
# 1417
return hipCUResultTohipError(cuCtxEnablePeerAccess(peerCtx, flags));
# 1418
}
# 1420
static inline hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned *flags, int *
# 1421
active) {
# 1422
return hipCUResultTohipError(cuDevicePrimaryCtxGetState(dev, flags, active));
# 1423
}
# 1425
static inline hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev) {
# 1426
return hipCUResultTohipError(cuDevicePrimaryCtxRelease(dev));
# 1427
}
# 1429
static inline hipError_t hipDevicePrimaryCtxRetain(hipCtx_t *pctx, hipDevice_t dev) {
# 1430
return hipCUResultTohipError(cuDevicePrimaryCtxRetain(pctx, dev));
# 1431
}
# 1433
static inline hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev) {
# 1434
return hipCUResultTohipError(cuDevicePrimaryCtxReset(dev));
# 1435
}
# 1437
static inline hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned flags) {
# 1438
return hipCUResultTohipError(cuDevicePrimaryCtxSetFlags(dev, flags));
# 1439
}
# 1441
static inline hipError_t hipMemGetAddressRange(hipDeviceptr_t *pbase, size_t *psize, hipDeviceptr_t
# 1442
dptr) {
# 1443
return hipCUResultTohipError(cuMemGetAddressRange_v2(pbase, psize, dptr));
# 1444
}
# 1446
static inline hipError_t hipMemcpyPeer(void *dst, int dstDevice, const void *src, int srcDevice, size_t
# 1447
count) {
# 1448
return hipCUDAErrorTohipError(cudaMemcpyPeer(dst, dstDevice, src, srcDevice, count));
# 1449
}
# 1451
static inline hipError_t hipMemcpyPeerAsync(void *dst, int dstDevice, const void *src, int
# 1452
srcDevice, size_t count, hipStream_t
# 1453
stream = 0) {
# 1454
return hipCUDAErrorTohipError(cudaMemcpyPeerAsync(dst, dstDevice, src, srcDevice, count, stream));
# 1456
}
# 1459
static inline hipError_t hipProfilerStart() { return hipCUDAErrorTohipError(cudaProfilerStart()); }
# 1461
static inline hipError_t hipProfilerStop() { return hipCUDAErrorTohipError(cudaProfilerStop()); }
# 1463
static inline hipError_t hipSetDeviceFlags(unsigned flags) {
# 1464
return hipCUDAErrorTohipError(cudaSetDeviceFlags(flags));
# 1465
}
# 1467
static inline hipError_t hipEventCreateWithFlags(hipEvent_t *event, unsigned flags) {
# 1468
return hipCUDAErrorTohipError(cudaEventCreateWithFlags(event, flags));
# 1469
}
# 1471
static inline hipError_t hipEventQuery(hipEvent_t event) {
# 1472
return hipCUDAErrorTohipError(cudaEventQuery(event));
# 1473
}
# 1475
static inline hipError_t hipCtxCreate(hipCtx_t *ctx, unsigned flags, hipDevice_t device) {
# 1476
return hipCUResultTohipError(cuCtxCreate_v2(ctx, flags, device));
# 1477
}
# 1479
static inline hipError_t hipCtxDestroy(hipCtx_t ctx) {
# 1480
return hipCUResultTohipError(cuCtxDestroy_v2(ctx));
# 1481
}
# 1483
static inline hipError_t hipCtxPopCurrent(hipCtx_t *ctx) {
# 1484
return hipCUResultTohipError(cuCtxPopCurrent_v2(ctx));
# 1485
}
# 1487
static inline hipError_t hipCtxPushCurrent(hipCtx_t ctx) {
# 1488
return hipCUResultTohipError(cuCtxPushCurrent_v2(ctx));
# 1489
}
# 1491
static inline hipError_t hipCtxSetCurrent(hipCtx_t ctx) {
# 1492
return hipCUResultTohipError(cuCtxSetCurrent(ctx));
# 1493
}
# 1495
static inline hipError_t hipCtxGetCurrent(hipCtx_t *ctx) {
# 1496
return hipCUResultTohipError(cuCtxGetCurrent(ctx));
# 1497
}
# 1499
static inline hipError_t hipCtxGetDevice(hipDevice_t *device) {
# 1500
return hipCUResultTohipError(cuCtxGetDevice(device));
# 1501
}
# 1503
static inline hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int *apiVersion) {
# 1504
return hipCUResultTohipError(cuCtxGetApiVersion(ctx, (unsigned *)apiVersion));
# 1505
}
# 1507
static inline hipError_t hipCtxGetCacheConfig(hipFuncCache *cacheConfig) {
# 1508
return hipCUResultTohipError(cuCtxGetCacheConfig(cacheConfig));
# 1509
}
# 1511
static inline hipError_t hipCtxSetCacheConfig(hipFuncCache cacheConfig) {
# 1512
return hipCUResultTohipError(cuCtxSetCacheConfig(cacheConfig));
# 1513
}
# 1515
static inline hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config) {
# 1516
return hipCUResultTohipError(cuCtxSetSharedMemConfig((CUsharedconfig)config));
# 1517
}
# 1519
static inline hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig *pConfig) {
# 1520
return hipCUResultTohipError(cuCtxGetSharedMemConfig((CUsharedconfig *)pConfig));
# 1521
}
# 1523
static inline hipError_t hipCtxSynchronize() {
# 1524
return hipCUResultTohipError(cuCtxSynchronize());
# 1525
}
# 1527
static inline hipError_t hipCtxGetFlags(unsigned *flags) {
# 1528
return hipCUResultTohipError(cuCtxGetFlags(flags));
# 1529
}
# 1531
static inline hipError_t hipCtxDetach(hipCtx_t ctx) {
# 1532
return hipCUResultTohipError(cuCtxDetach(ctx));
# 1533
}
# 1535
static inline hipError_t hipDeviceGet(hipDevice_t *device, int ordinal) {
# 1536
return hipCUResultTohipError(cuDeviceGet(device, ordinal));
# 1537
}
# 1539
static inline hipError_t hipDeviceComputeCapability(int *major, int *minor, hipDevice_t device) {
# 1540
return hipCUResultTohipError(cuDeviceComputeCapability(major, minor, device));
# 1541
}
# 1543
static inline hipError_t hipDeviceGetName(char *name, int len, hipDevice_t device) {
# 1544
return hipCUResultTohipError(cuDeviceGetName(name, len, device));
# 1545
}
# 1547
static inline hipError_t hipDeviceGetPCIBusId(char *pciBusId, int len, hipDevice_t device) {
# 1548
return hipCUDAErrorTohipError(cudaDeviceGetPCIBusId(pciBusId, len, device));
# 1549
}
# 1551
static inline hipError_t hipDeviceGetByPCIBusId(int *device, const char *pciBusId) {
# 1552
return hipCUDAErrorTohipError(cudaDeviceGetByPCIBusId(device, pciBusId));
# 1553
}
# 1555
static inline hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig *config) {
# 1556
return hipCUDAErrorTohipError(cudaDeviceGetSharedMemConfig(config));
# 1557
}
# 1559
static inline hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config) {
# 1560
return hipCUDAErrorTohipError(cudaDeviceSetSharedMemConfig(config));
# 1561
}
# 1563
static inline hipError_t hipDeviceGetLimit(size_t *pValue, hipLimit_t limit) {
# 1564
return hipCUDAErrorTohipError(cudaDeviceGetLimit(pValue, limit));
# 1565
}
# 1567
static inline hipError_t hipDeviceTotalMem(size_t *bytes, hipDevice_t device) {
# 1568
return hipCUResultTohipError(cuDeviceTotalMem_v2(bytes, device));
# 1569
}
# 1571
static inline hipError_t hipModuleLoad(hipModule_t *module, const char *fname) {
# 1572
return hipCUResultTohipError(cuModuleLoad(module, fname));
# 1573
}
# 1575
static inline hipError_t hipModuleUnload(hipModule_t hmod) {
# 1576
return hipCUResultTohipError(cuModuleUnload(hmod));
# 1577
}
# 1579
static inline hipError_t hipModuleGetFunction(hipFunction_t *function, hipModule_t module, const char *
# 1580
kname) {
# 1581
return hipCUResultTohipError(cuModuleGetFunction(function, module, kname));
# 1582
}
# 1584
static inline hipError_t hipFuncGetAttributes(hipFuncAttributes *attr, const void *func) {
# 1585
return hipCUDAErrorTohipError(cudaFuncGetAttributes(attr, func));
# 1586
}
# 1588
static inline hipError_t hipFuncGetAttribute(int *value, CUfunction_attribute attrib, hipFunction_t hfunc) {
# 1589
return hipCUResultTohipError(cuFuncGetAttribute(value, attrib, hfunc));
# 1590
}
# 1592
static inline hipError_t hipModuleGetGlobal(hipDeviceptr_t *dptr, size_t *bytes, hipModule_t hmod, const char *
# 1593
name) {
# 1594
return hipCUResultTohipError(cuModuleGetGlobal_v2(dptr, bytes, hmod, name));
# 1595
}
# 1597
static inline hipError_t hipModuleLoadData(hipModule_t *module, const void *image) {
# 1598
return hipCUResultTohipError(cuModuleLoadData(module, image));
# 1599
}
# 1601
static inline hipError_t hipModuleLoadDataEx(hipModule_t *module, const void *image, unsigned
# 1602
numOptions, hipJitOption *options, void **
# 1603
optionValues) {
# 1604
return hipCUResultTohipError(cuModuleLoadDataEx(module, image, numOptions, options, optionValues));
# 1606
}
# 1608
static inline hipError_t hipLaunchKernel(const void *function_address, dim3 numBlocks, dim3
# 1609
dimBlocks, void **args, size_t sharedMemBytes, hipStream_t
# 1610
stream)
# 1611
{
# 1612
return hipCUDAErrorTohipError(cudaLaunchKernel(function_address, numBlocks, dimBlocks, args, sharedMemBytes, stream));
# 1613
}
# 1615
static inline hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned gridDimX, unsigned
# 1616
gridDimY, unsigned gridDimZ, unsigned
# 1617
blockDimX, unsigned blockDimY, unsigned
# 1618
blockDimZ, unsigned sharedMemBytes, hipStream_t
# 1619
stream, void **kernelParams, void **
# 1620
extra) {
# 1621
return hipCUResultTohipError(cuLaunchKernel(f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, stream, kernelParams, extra));
# 1624
}
# 1626
static inline hipError_t hipFuncSetCacheConfig(const void *func, hipFuncCache_t cacheConfig) {
# 1627
return hipCUDAErrorTohipError(cudaFuncSetCacheConfig(func, cacheConfig));
# 1628
}
# 1630
static inline hipError_t hipBindTexture(size_t *offset, textureReference *tex, const void *devPtr, const hipChannelFormatDesc *
# 1631
desc, size_t size = ((2147483647) * 2U) + 1U) {
# 1632
return hipCUDAErrorTohipError(cudaBindTexture(offset, tex, devPtr, desc, size));
# 1633
}
# 1635
static inline hipError_t hipBindTexture2D(size_t *offset, textureReference *tex, const void *devPtr, const hipChannelFormatDesc *
# 1636
desc, size_t width, size_t height, size_t
# 1637
pitch) {
# 1638
return hipCUDAErrorTohipError(cudaBindTexture2D(offset, tex, devPtr, desc, width, height, pitch));
# 1639
}
# 1641
static inline hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, hipChannelFormatKind
# 1642
f) {
# 1643
return cudaCreateChannelDesc(x, y, z, w, hipChannelFormatKindToCudaChannelFormatKind(f));
# 1644
}
# 1646
static inline hipError_t hipCreateTextureObject(hipTextureObject_t *pTexObject, const hipResourceDesc *
# 1647
pResDesc, const hipTextureDesc *
# 1648
pTexDesc, const hipResourceViewDesc *
# 1649
pResViewDesc) {
# 1650
return hipCUDAErrorTohipError(cudaCreateTextureObject(pTexObject, pResDesc, pTexDesc, pResViewDesc));
# 1652
}
# 1654
static inline hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject) {
# 1655
return hipCUDAErrorTohipError(cudaDestroyTextureObject(textureObject));
# 1656
}
# 1658
static inline hipError_t hipCreateSurfaceObject(hipSurfaceObject_t *pSurfObject, const hipResourceDesc *
# 1659
pResDesc) {
# 1660
return hipCUDAErrorTohipError(cudaCreateSurfaceObject(pSurfObject, pResDesc));
# 1661
}
# 1663
static inline hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject) {
# 1664
return hipCUDAErrorTohipError(cudaDestroySurfaceObject(surfaceObject));
# 1665
}
# 1667
static inline hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc *pResDesc, hipTextureObject_t
# 1668
textureObject) {
# 1669
return hipCUDAErrorTohipError(cudaGetTextureObjectResourceDesc(pResDesc, textureObject));
# 1670
}
# 1672
static inline hipError_t hipGetTextureAlignmentOffset(size_t *offset, const textureReference *texref)
# 1673
{
# 1674
return hipCUDAErrorTohipError(cudaGetTextureAlignmentOffset(offset, texref));
# 1675
}
# 1677
static inline hipError_t hipGetChannelDesc(hipChannelFormatDesc *desc, hipArray_const_t array)
# 1678
{
# 1679
return hipCUDAErrorTohipError(cudaGetChannelDesc(desc, array));
# 1680
}
# 1684
}
# 1689
template< class T> static inline hipError_t
# 1690
hipOccupancyMaxPotentialBlockSize(int *minGridSize, int *blockSize, T func, size_t
# 1691
dynamicSMemSize = 0, int
# 1692
blockSizeLimit = 0) {
# 1693
cudaError_t cerror;
# 1694
cerror = cudaOccupancyMaxPotentialBlockSize(minGridSize, blockSize, func, dynamicSMemSize, blockSizeLimit);
# 1695
return hipCUDAErrorTohipError(cerror);
# 1696
}
# 1698
template< class T, int dim, cudaTextureReadMode readMode> static inline hipError_t
# 1699
hipBindTexture(size_t *offset, const texture< T, dim, readMode> &tex, const void *
# 1700
devPtr, size_t size = ((2147483647) * 2U) + 1U) {
# 1701
return hipCUDAErrorTohipError(cudaBindTexture(offset, tex, devPtr, size));
# 1702
}
# 1704
template< class T, int dim, cudaTextureReadMode readMode> static inline hipError_t
# 1705
hipBindTexture(size_t *offset, texture< T, dim, readMode> &tex, const void *
# 1706
devPtr, const hipChannelFormatDesc &desc, size_t
# 1707
size = ((2147483647) * 2U) + 1U) {
# 1708
return hipCUDAErrorTohipError(cudaBindTexture(offset, tex, devPtr, desc, size));
# 1709
}
# 1711
template< class T, int dim, cudaTextureReadMode readMode> static inline hipError_t
# 1712
hipUnbindTexture(texture< T, dim, readMode> *tex) {
# 1713
return hipCUDAErrorTohipError(cudaUnbindTexture(tex));
# 1714
}
# 1716
template< class T, int dim, cudaTextureReadMode readMode> static inline hipError_t
# 1717
hipUnbindTexture(texture< T, dim, readMode> &tex) {
# 1718
return hipCUDAErrorTohipError(cudaUnbindTexture(tex));
# 1719
}
# 1721
template< class T, int dim, cudaTextureReadMode readMode> static inline hipError_t
# 1722
hipBindTextureToArray(texture< T, dim, readMode> &tex, hipArray_const_t
# 1723
array, const hipChannelFormatDesc &
# 1724
desc) {
# 1725
return hipCUDAErrorTohipError(cudaBindTextureToArray(tex, array, desc));
# 1726
}
# 1728
template< class T, int dim, cudaTextureReadMode readMode> static inline hipError_t
# 1729
hipBindTextureToArray(texture< T, dim, readMode> *tex, hipArray_const_t
# 1730
array, const hipChannelFormatDesc *
# 1731
desc) {
# 1732
return hipCUDAErrorTohipError(cudaBindTextureToArray(tex, array, desc));
# 1733
}
# 1735
template< class T, int dim, cudaTextureReadMode readMode> static inline hipError_t
# 1736
hipBindTextureToArray(texture< T, dim, readMode> &tex, hipArray_const_t
# 1737
array) {
# 1738
return hipCUDAErrorTohipError(cudaBindTextureToArray(tex, array));
# 1739
}
# 1741
template< class T> static inline hipChannelFormatDesc
# 1742
hipCreateChannelDesc() {
# 1743
return cudaCreateChannelDesc< T> ();
# 1744
}
# 368 "/opt/rocm-3.3.0/hip/include/hip/hip_runtime_api.h" 3
template< class T> static inline hipError_t
# 369
hipMalloc(T **devPtr, size_t size) {
# 370
return hipMalloc((void **)devPtr, size);
# 371
}
# 375
template< class T> static inline hipError_t
# 376
hipHostMalloc(T **ptr, size_t size, unsigned
# 377
flags = 0) {
# 378
return hipHostMalloc((void **)ptr, size, flags);
# 379
}
# 381
template< class T> static inline hipError_t
# 382
hipMallocManaged(T **devPtr, size_t size, unsigned
# 383
flags = 1) {
# 384
return hipMallocManaged((void **)devPtr, size, flags);
# 385
}
# 32 "/opt/rocm-3.3.0/hip/include/hip/nvcc_detail/hip_runtime.h" 3
typedef int hipLaunchParm;
# 19 ".././target/target_hip.h"
typedef hipFuncCache_t tdpFuncCache;
# 26
typedef hipMemcpyKind tdpMemcpyKind;
# 27
typedef hipDeviceAttribute_t tdpDeviceAttr;
# 44 ".././target/target_hip.h"
typedef hipStream_t tdpStream_t;
# 45
typedef hipError_t tdpError_t;
# 39 ".././target/target.h"
tdpError_t tdpDeviceSetCacheConfig(tdpFuncCache cacheConfig);
# 40
tdpError_t tdpGetDeviceProperties(hipDeviceProp_t * prop, int);
# 41
tdpError_t tdpSetDevice(int device);
# 43
tdpError_t tdpDeviceGetAttribute(int * value, tdpDeviceAttr attr, int device);
# 46
tdpError_t tdpDeviceGetCacheConfig(tdpFuncCache * cache);
# 47
tdpError_t tdpDeviceSynchronize();
# 48
tdpError_t tdpGetDevice(int * device);
# 49
tdpError_t tdpGetDeviceCount(int * count);
# 53
const char *tdpGetErrorName(tdpError_t error);
# 54
const char *tdpGetErrorString(tdpError_t error);
# 55
tdpError_t tdpGetLastError();
# 56
tdpError_t tdpPeekAtLastError();
# 60
tdpError_t tdpStreamCreate(tdpStream_t * stream);
# 61
tdpError_t tdpStreamDestroy(tdpStream_t stream);
# 62
tdpError_t tdpStreamSynchronize(tdpStream_t stream);
# 70
tdpError_t tdpFreeHost(void * phost);
# 71
tdpError_t tdpHostAlloc(void ** phost, size_t size, unsigned flags);
# 73
tdpError_t tdpMallocManaged(void ** devptr, size_t size, unsigned flag);
# 75
tdpError_t tdpMemcpy(void * dst, const void * src, size_t count, tdpMemcpyKind kind);
# 77
tdpError_t tdpMemcpyAsync(void * dst, const void * src, size_t count, tdpMemcpyKind kind, tdpStream_t stream);
# 79
tdpError_t tdpMemset(void * devPtr, int value, size_t count);
# 82
tdpError_t tdpFree(void * devPtr);
# 83
tdpError_t tdpMalloc(void ** devRtr, size_t size);
# 102 ".././target/target.h"
tdpError_t tdpThreadModelInfo(FILE * fp);
# 106
__attribute__((unused)) int tdpAtomicAddInt(int * sum, int val);
# 107
__attribute__((unused)) int tdpAtomicMaxInt(int * maxval, int val);
# 108
__attribute__((unused)) int tdpAtomicMinInt(int * minval, int val);
# 109
__attribute__((unused)) double tdpAtomicAddDouble(double * sum, double val);
# 110
__attribute__((unused)) double tdpAtomicMaxDouble(double * maxval, double val);
# 111
__attribute__((unused)) double tdpAtomicMinDouble(double * minval, double val);
# 115
__attribute__((unused)) int tdpAtomicBlockAddInt(int * partsum);
# 116
__attribute__((unused)) double tdpAtomicBlockAddDouble(double * partsum);
# 120
void tdpErrorHandler(tdpError_t ifail, const char * file, int line, int fatal);
# 22 "pe.h"
typedef struct pe_s pe_t;
# 24
typedef enum { PE_QUIET, PE_VERBOSE, PE_OPTION_MAX} pe_enum_t;
# 26
int pe_create(MPI_Comm parent, pe_enum_t flag, pe_t ** ppe);
# 27
int pe_free(pe_t * pe);
# 28
int pe_retain(pe_t * pe);
# 29
int pe_set(pe_t * pe, pe_enum_t option);
# 30
int pe_message(pe_t * pe);
# 31
int pe_mpi_comm(pe_t * pe, MPI_Comm * comm);
# 32
int pe_mpi_rank(pe_t * pe);
# 33
int pe_mpi_size(pe_t * pe);
# 34
int pe_subdirectory(pe_t * pe, char * name);
# 35
int pe_subdirectory_set(pe_t * pe, const char * name);
# 36
int pe_info(pe_t * pe, const char * fmt, ...);
# 37
int pe_fatal(pe_t * pe, const char * fmt, ...);
# 38
int pe_verbose(pe_t * pe, const char * fmt, ...);
# 22 "coords.h"
typedef struct coords_s cs_t;
# 26
enum cartesian_directions { X, Y, Z};
# 27
enum cartesian_neighbours { FORWARD, BACKWARD};
# 28
enum cs_mpi_cart_neighbours { CS_FORW, CS_BACK};
# 29
enum upper_triangle { XX, XY, XZ, YY, YZ, ZZ};
# 33
int cs_create(pe_t * pe, cs_t ** pcs);
# 34
int cs_free(cs_t * cs);
# 35
int cs_retain(cs_t * cs);
# 36
int cs_init(cs_t * cs);
# 37
int cs_commit(cs_t * cs);
# 38
int cs_target(cs_t * cs, cs_t ** target);
# 40
int cs_decomposition_set(cs_t * cs, const int irequest[3]);
# 41
int cs_periodicity_set(cs_t * cs, const int iper[3]);
# 42
int cs_ntotal_set(cs_t * cs, const int ntotal[3]);
# 43
int cs_nhalo_set(cs_t * cs, int nhalo);
# 44
int cs_reorder_set(cs_t * cs, int reorder);
# 45
int cs_info(cs_t * cs);
# 46
int cs_cart_comm(cs_t * cs, MPI_Comm * comm);
# 47
int cs_periodic_comm(cs_t * cs, MPI_Comm * comm);
# 48
int cs_cart_neighb(cs_t * cs, int forwback, int dim);
# 49
int cs_cart_rank(cs_t * cs);
# 50
int cs_pe_rank(cs_t * cs);
# 54
int cs_cartsz(cs_t * cs, int cartsz[3]);
# 55
int cs_cart_coords(cs_t * cs, int coords[3]);
# 56
int cs_lmin(cs_t * cs, double lmin[3]);
# 57
int cs_ltot(cs_t * cs, double ltot[3]);
# 58
int cs_periodic(cs_t * cs, int period[3]);
# 59
int cs_nlocal(cs_t * cs, int n[3]);
# 60
int cs_nlocal_offset(cs_t * cs, int n[3]);
# 61
int cs_nhalo(cs_t * cs, int * nhalo);
# 62
int cs_index(cs_t * cs, int ic, int jc, int kc);
# 63
int cs_ntotal(cs_t * cs, int ntotal[3]);
# 64
int cs_nsites(cs_t * cs, int * nsites);
# 65
int cs_minimum_distance(cs_t * cs, const double r1[3], const double r2[3], double r12[3]);
# 67
int cs_index_to_ijk(cs_t * cs, int index, int coords[3]);
# 68
int cs_strides(cs_t * cs, int * xs, int * ys, int * zs);
# 69
int cs_nall(cs_t * cs, int nall[3]);
# 73
int cs_cart_shift(MPI_Comm comm, int dim, int direction, int * rank);
# 7 "coords_s.h"
typedef struct coords_param_s cs_param_t;
# 9
struct coords_param_s {
# 10
int nhalo;
# 11
int nsites;
# 12
int ntotal[3];
# 13
int nlocal[3];
# 14
int noffset[3];
# 15
int str[3];
# 16
int periodic[3];
# 18
int mpi_cartsz[3];
# 19
int mpi_cartcoords[3];
# 21
double lmin[3];
# 22
};
# 24
struct coords_s {
# 25
pe_t *pe;
# 26
int nref;
# 28
cs_param_t *param;
# 31
int mpi_cartrank;
# 32
int reorder;
# 33
int mpi_cart_neighbours[2][3];
# 34
int *listnlocal[3];
# 35
int *listnoffset[3];
# 37
MPI_Comm commcart;
# 38
MPI_Comm commperiodic;
# 40
cs_t *target;
# 41
};
# 65 "/usr/include/assert.h" 3
extern "C" {
# 68
extern void __assert_fail(const char * __assertion, const char * __file, unsigned __line, const char * __function) throw()
# 70
__attribute((__noreturn__));
# 73
extern void __assert_perror_fail(int __errnum, const char * __file, unsigned __line, const char * __function) throw()
# 75
__attribute((__noreturn__));
# 80
extern void __assert(const char * __assertion, const char * __file, int __line) throw()
# 81
__attribute((__noreturn__));
# 84
}
# 60 "memory.h"
int mem_addr_rank0(int nsites, int index);
# 62
int mem_addr_rank1(int nsites, int na, int index, int ia);
# 64
int mem_addr_rank2(int nsites, int na, int nb, int index, int ia, int ib);
# 118 "memory.h"
typedef
# 115
enum data_model_enum_type { DATA_MODEL_AOS,
# 116
DATA_MODEL_SOA,
# 117
DATA_MODEL_AOSOA
# 118
} data_model_enum_t;
# 141 "memory.h"
int forward_addr_rank0_assert(int line, const char * file, int nsites, int index);
# 144
int forward_addr_rank1_assert(int line, const char * file, int nsites, int na, int index, int ia);
# 147
int forward_addr_rank2_assert(int line, const char * file, int nsites, int na, int nb, int index, int ia, int ib);
# 151
int forward_addr_rank3_assert(int line, const char * file, int nsites, int na, int nb, int nc, int index, int ia, int ib, int ic);
# 155
int forward_addr_rank4_assert(int line, const char * file, int nsites, int na, int nb, int nc, int nd, int index, int ia, int ib, int ic, int id);
# 200 "memory.h"
int reverse_addr_rank0_assert(int line, const char * file, int nsites, int index);
# 203
int reverse_addr_rank1_assert(int line, const char * file, int nsites, int na, int index, int ia);
# 206
int reverse_addr_rank2_assert(int line, const char * file, int nsites, int na, int nb, int index, int ia, int ib);
# 210
int reverse_addr_rank3_assert(int line, const char * file, int nsites, int na, int nb, int nc, int index, int ia, int ib, int ic);
# 214
int reverse_addr_rank4_assert(int line, const char * file, int nsites, int na, int nb, int nc, int nd, int index, int ia, int ib, int ic, int id);
# 296 "memory.h"
void *mem_aligned_malloc(size_t alignment, size_t size);
# 297
void *mem_aligned_calloc(size_t alignment, size_t count, size_t size);
# 298
void *mem_aligned_realloc(void * ptr, size_t alignment, size_t oldsize, size_t newsize);
# 21 "kernel.h"
typedef struct kernel_ctxt_s kernel_ctxt_t;
# 22
typedef struct kernel_info_s kernel_info_t;
# 23
typedef struct kernel_param_s kernel_param_t;
# 28
struct kernel_ctxt_s {
# 29
kernel_param_t *param;
# 30
kernel_ctxt_t *target;
# 31
};
# 37
struct kernel_info_s {
# 38
int imin;
# 39
int imax;
# 40
int jmin;
# 41
int jmax;
# 42
int kmin;
# 43
int kmax;
# 44
};
# 47
int kernel_ctxt_create(cs_t * cs, int nsimdvl, kernel_info_t info, kernel_ctxt_t ** p);
# 49
int kernel_ctxt_launch_param(kernel_ctxt_t * obj, dim3 * nblk, dim3 * ntpb);
# 50
int kernel_ctxt_info(kernel_ctxt_t * obj, kernel_info_t * lim);
# 51
int kernel_ctxt_free(kernel_ctxt_t * obj);
# 53
int kernel_iterations(kernel_ctxt_t * ctxt);
# 54
int kernel_vector_iterations(kernel_ctxt_t * ctxt);
# 55
int kernel_baseindex(kernel_ctxt_t * obj, int kindex);
# 56
int kernel_coords_ic(kernel_ctxt_t * ctxt, int kindex);
# 57
int kernel_coords_jc(kernel_ctxt_t * ctxt, int kindex);
# 58
int kernel_coords_kc(kernel_ctxt_t * ctxt, int kindex);
# 59
int kernel_coords_v(kernel_ctxt_t * ctxt, int kindex, int ic[1], int jc[1], int kc[1]);
# 64
int kernel_mask(kernel_ctxt_t * ctxt, int ic, int jc, int kc);
# 66
int kernel_mask_v(kernel_ctxt_t * ctxt, int ic[1], int jc[1], int kc[1], int mask[1]);
# 70
int kernel_coords_index(kernel_ctxt_t * ctxt, int ic, int jc, int kc);
# 72
int kernel_coords_index_v(kernel_ctxt_t * ctxt, int ic[1], int jc[1], int kc[1], int index[1]);
# 79
int kernel_launch_param(int iterations, dim3 * nblk, dim3 * ntpb);
# 28 "kernel.c"
struct kernel_param_s {
# 30
int nhalo;
# 31
int nsites;
# 32
int nlocal[3];
# 33
int kindex0;
# 35
int nklocal[3];
# 36
int kernel_iterations;
# 38
int nsimdvl;
# 39
int kernel_vector_iterations;
# 40
int nkv_local[3];
# 41
kernel_info_t lim;
# 42
};
# 47
static kernel_ctxt_t static_ctxt;
# 48
static kernel_param_t static_param;
# 50
static int kernel_ctxt_commit(kernel_ctxt_t * ctxt, cs_t * cs, int nsimdvl, kernel_info_t lim);
# 60
int kernel_ctxt_create(cs_t *cs, int nsimdvl, kernel_info_t info, kernel_ctxt_t **
# 61
p) {
# 63
int ndevice;
# 64
kernel_ctxt_t *obj = (__null);
# 66
(p) ? static_cast< void>(0) : __assert_fail("p", "kernel.c", 66, __PRETTY_FUNCTION__);
# 67
(cs) ? static_cast< void>(0) : __assert_fail("cs", "kernel.c", 67, __PRETTY_FUNCTION__);
# 69
obj = ((kernel_ctxt_t *)calloc(1, sizeof(kernel_ctxt_t)));
# 70
(obj) ? static_cast< void>(0) : __assert_fail("obj", "kernel.c", 70, __PRETTY_FUNCTION__);
# 71
if (obj == (__null)) { pe_fatal(cs->pe, "calloc(kernel_ctxt_t) failed\n"); }
# 73
((nsimdvl == 1) || (nsimdvl == 1)) ? static_cast< void>(0) : __assert_fail("nsimdvl == 1 || nsimdvl == 1", "kernel.c", 73, __PRETTY_FUNCTION__);
# 75
(obj->param) = ((kernel_param_t *)calloc(1, sizeof(kernel_param_t)));
# 76
(obj->param) ? static_cast< void>(0) : __assert_fail("obj->param", "kernel.c", 76, __PRETTY_FUNCTION__);
# 77
if ((obj->param) == (__null)) { pe_fatal(cs->pe, "calloc(kernel_param_t) failed\n"); }
# 79
tdpGetDeviceCount(&ndevice);
# 81
if (ndevice == 0) {
# 82
(obj->target) = obj;
# 83
} else
# 84
{
# 85
kernel_param_t *tmp;
# 87
{ tdpErrorHandler(hipGetSymbolAddress((void **)(&(obj->target)), &static_ctxt), "kernel.c", 87, 1); } ;
# 88
{ tdpErrorHandler(hipGetSymbolAddress((void **)(&tmp), &static_param), "kernel.c", 88, 1); } ;
# 89
{ tdpErrorHandler(tdpMemcpy(&((obj->target)->param), &tmp, sizeof(kernel_param_t *), hipMemcpyHostToDevice), "kernel.c", 90, 1);
# 89 "kernel.c"
}
# 90
;
# 91
}
# 93
kernel_ctxt_commit(obj, cs, nsimdvl, info);
# 95
(*p) = obj;
# 97
return 0;
# 98
}
# 106
int kernel_ctxt_free(kernel_ctxt_t *obj) {
# 108
(obj) ? static_cast< void>(0) : __assert_fail("obj", "kernel.c", 108, __PRETTY_FUNCTION__);
# 110
free(obj->param);
# 111
free(obj);
# 113
return 0;
# 114
}
# 123
int kernel_ctxt_launch_param(kernel_ctxt_t *obj, dim3 *nblk, dim3 *ntpb) {
# 125
int iterations;
# 127
(obj) ? static_cast< void>(0) : __assert_fail("obj", "kernel.c", 127, __PRETTY_FUNCTION__);
# 129
iterations = ((obj->param)->kernel_iterations);
# 130
if (((obj->param)->nsimdvl) == 1) {
# 131
iterations = ((obj->param)->kernel_vector_iterations);
# 132
}
# 134
kernel_launch_param(iterations, nblk, ntpb);
# 136
return 0;
# 137
}
# 147 "kernel.c"
int kernel_launch_param(int iterations, dim3 *nblk, dim3 *ntpb) {
# 149
(iterations > 0) ? static_cast< void>(0) : __assert_fail("iterations > 0", "kernel.c", 149, __PRETTY_FUNCTION__);
# 151
(ntpb->x) = (128);
# 152
(ntpb->y) = (1);
# 153
(ntpb->z) = (1);
# 155
(nblk->x) = (((iterations + (ntpb->x)) - (1)) / (ntpb->x));
# 156
(nblk->y) = (1);
# 157
(nblk->z) = (1);
# 159
return 0;
# 160
}
# 168
static int kernel_ctxt_commit(kernel_ctxt_t *obj, cs_t *cs, int
# 169
nsimdvl, kernel_info_t lim) {
# 171
int ndevice;
# 172
int kiter;
# 173
int kv_imin;
# 174
int kv_jmin;
# 175
int kv_kmin;
# 177
(cs) ? static_cast< void>(0) : __assert_fail("cs", "kernel.c", 177, __PRETTY_FUNCTION__);
# 179
cs_nhalo(cs, &((obj->param)->nhalo));
# 180
cs_nsites(cs, &((obj->param)->nsites));
# 181
cs_nlocal(cs, (obj->param)->nlocal);
# 183
((obj->param)->nsimdvl) = nsimdvl;
# 184
((obj->param)->lim) = lim;
# 186
(((obj->param)->nklocal)[X]) = (((lim.imax) - (lim.imin)) + 1);
# 187
(((obj->param)->nklocal)[Y]) = (((lim.jmax) - (lim.jmin)) + 1);
# 188
(((obj->param)->nklocal)[Z]) = (((lim.kmax) - (lim.kmin)) + 1);
# 190
((obj->param)->kernel_iterations) = (((((obj->param)->nklocal)[X]) * (((obj->param)->nklocal)[Y])) * (((obj->param)->nklocal)[Z]));
# 195
kv_imin = (lim.imin);
# 196
kv_jmin = (1 - ((obj->param)->nhalo));
# 197
kv_kmin = (1 - ((obj->param)->nhalo));
# 199
(((obj->param)->nkv_local)[X]) = (((obj->param)->nklocal)[X]);
# 200
(((obj->param)->nkv_local)[Y]) = ((((obj->param)->nlocal)[Y]) + (2 * ((obj->param)->nhalo)));
# 201
(((obj->param)->nkv_local)[Z]) = ((((obj->param)->nlocal)[Z]) + (2 * ((obj->param)->nhalo)));
# 205
kiter = cs_index(cs, kv_imin, kv_jmin, kv_kmin);
# 206
((obj->param)->kindex0) = ((kiter / 1) * 1);
# 209
kiter = (((((obj->param)->nkv_local)[X]) * (((obj->param)->nkv_local)[Y])) * (((obj->param)->nkv_local)[Z]));
# 210
((obj->param)->kernel_vector_iterations) = kiter;
# 214
tdpGetDeviceCount(&ndevice);
# 216
if (ndevice > 0) {
# 217
{ tdpErrorHandler(hipMemcpyToSymbol(&static_param, obj->param, sizeof(kernel_param_t), 0, hipMemcpyHostToDevice), "kernel.c", 218, 1);
# 217 "kernel.c"
}
# 218
;
# 219
}
# 221
return 0;
# 222
}
# 232 "kernel.c"
int kernel_baseindex(kernel_ctxt_t *obj, int kindex) {
# 234
(obj) ? static_cast< void>(0) : __assert_fail("obj", "kernel.c", 234, __PRETTY_FUNCTION__);
# 236
return ((obj->param)->kindex0) + kindex;
# 237
}
# 245
int kernel_coords_ic(kernel_ctxt_t *obj, int kindex) {
# 247
int ic;
# 249
(obj) ? static_cast< void>(0) : __assert_fail("obj", "kernel.c", 249, __PRETTY_FUNCTION__);
# 251
ic = ((((obj->param)->lim).imin) + (kindex / ((((obj->param)->nklocal)[Y]) * (((obj->param)->nklocal)[Z]))));
# 254
((1 - ((obj->param)->nhalo)) <= ic) ? static_cast< void>(0) : __assert_fail("1 - obj->param->nhalo <= ic", "kernel.c", 254, __PRETTY_FUNCTION__);
# 255
(ic <= ((((obj->param)->nlocal)[X]) + ((obj->param)->nhalo))) ? static_cast< void>(0) : __assert_fail("ic <= obj->param->nlocal[X] + obj->param->nhalo", "kernel.c", 255, __PRETTY_FUNCTION__);
# 257
return ic;
# 258
}
# 266
int kernel_coords_jc(kernel_ctxt_t *obj, int kindex) {
# 268
int ic;
# 269
int jc;
# 270
int xs;
# 272
(obj) ? static_cast< void>(0) : __assert_fail("obj", "kernel.c", 272, __PRETTY_FUNCTION__);
# 274
xs = ((((obj->param)->nklocal)[Y]) * (((obj->param)->nklocal)[Z]));
# 276
ic = (kindex / xs);
# 277
jc = ((((obj->param)->lim).jmin) + ((kindex - (ic * xs)) / (((obj->param)->nklocal)[Z])));
# 279
((1 - ((obj->param)->nhalo)) <= jc) ? static_cast< void>(0) : __assert_fail("1 - obj->param->nhalo <= jc", "kernel.c", 279, __PRETTY_FUNCTION__);
# 280
(jc <= ((((obj->param)->nlocal)[Y]) + ((obj->param)->nhalo))) ? static_cast< void>(0) : __assert_fail("jc <= obj->param->nlocal[Y] + obj->param->nhalo", "kernel.c", 280, __PRETTY_FUNCTION__);
# 282
return jc;
# 283
}
# 291
int kernel_coords_kc(kernel_ctxt_t *obj, int kindex) {
# 293
int ic;
# 294
int jc;
# 295
int kc;
# 296
int xs;
# 298
xs = ((((obj->param)->nklocal)[Y]) * (((obj->param)->nklocal)[Z]));
# 300
ic = (kindex / xs);
# 301
jc = ((kindex - (ic * xs)) / (((obj->param)->nklocal)[Z]));
# 302
kc = ((((((obj->param)->lim).kmin) + kindex) - (ic * xs)) - (jc * (((obj->param)->nklocal)[Z])));
# 304
((1 - ((obj->param)->nhalo)) <= kc) ? static_cast< void>(0) : __assert_fail("1 - obj->param->nhalo <= kc", "kernel.c", 304, __PRETTY_FUNCTION__);
# 305
(kc <= ((((obj->param)->nlocal)[Z]) + ((obj->param)->nhalo))) ? static_cast< void>(0) : __assert_fail("kc <= obj->param->nlocal[Z] + obj->param->nhalo", "kernel.c", 305, __PRETTY_FUNCTION__);
# 307
return kc;
# 308
}
# 316
int kernel_coords_v(kernel_ctxt_t *obj, int
# 317
kindex0, int
# 318
ic[1], int
# 319
jc[1], int kc[1]) {
# 320
int iv;
# 321
int index;
# 322
int xs;
# 323
int *__restrict__ icv = ic;
# 324
int *__restrict__ jcv = jc;
# 325
int *__restrict__ kcv = kc;
# 327
(obj) ? static_cast< void>(0) : __assert_fail("obj", "kernel.c", 327, __PRETTY_FUNCTION__);
# 328
xs = ((((obj->param)->nkv_local)[Y]) * (((obj->param)->nkv_local)[Z]));
# 330
for (iv = 0; iv < 1; iv++) {
# 331
index = ((((obj->param)->kindex0) + kindex0) + iv);
# 333
(icv[iv]) = (index / xs);
# 334
(jcv[iv]) = ((index - ((icv[iv]) * xs)) / (((obj->param)->nkv_local)[Z]));
# 335
(kcv[iv]) = ((index - ((icv[iv]) * xs)) - ((jcv[iv]) * (((obj->param)->nkv_local)[Z])));
# 336
}
# 338
for (iv = 0; iv < 1; iv++) {
# 339
(icv[iv]) = ((icv[iv]) - (((obj->param)->nhalo) - 1));
# 340
(jcv[iv]) = ((jcv[iv]) - (((obj->param)->nhalo) - 1));
# 341
(kcv[iv]) = ((kcv[iv]) - (((obj->param)->nhalo) - 1));
# 343
((1 - ((obj->param)->nhalo)) <= (icv[iv])) ? static_cast< void>(0) : __assert_fail("1 - obj->param->nhalo <= icv[iv]", "kernel.c", 343, __PRETTY_FUNCTION__);
# 344
((1 - ((obj->param)->nhalo)) <= (jcv[iv])) ? static_cast< void>(0) : __assert_fail("1 - obj->param->nhalo <= jcv[iv]", "kernel.c", 344, __PRETTY_FUNCTION__);
# 345
((icv[iv]) <= ((((obj->param)->nlocal)[X]) + ((obj->param)->nhalo))) ? static_cast< void>(0) : __assert_fail("icv[iv] <= obj->param->nlocal[X] + obj->param->nhalo", "kernel.c", 345, __PRETTY_FUNCTION__);
# 346
((jcv[iv]) <= ((((obj->param)->nlocal)[Y]) + ((obj->param)->nhalo))) ? static_cast< void>(0) : __assert_fail("jcv[iv] <= obj->param->nlocal[Y] + obj->param->nhalo", "kernel.c", 346, __PRETTY_FUNCTION__);
# 347
((kcv[iv]) <= ((((obj->param)->nlocal)[Z]) + ((obj->param)->nhalo))) ? static_cast< void>(0) : __assert_fail("kcv[iv] <= obj->param->nlocal[Z] + obj->param->nhalo", "kernel.c", 347, __PRETTY_FUNCTION__);
# 348
}
# 350
return 0;
# 351
}
# 360
int kernel_mask(kernel_ctxt_t *obj, int ic, int jc, int kc) {
# 362
if ((((((ic < (((obj->param)->lim).imin)) || (ic > (((obj->param)->lim).imax))) || (jc < (((obj->param)->lim).jmin))) || (jc > (((obj->param)->lim).jmax))) || (kc < (((obj->param)->lim).kmin))) || (kc > (((obj->param)->lim).kmax))) {
# 364
return 0; }
# 366
return 1;
# 367
}
# 375
int kernel_mask_v(kernel_ctxt_t *obj, int
# 376
ic[1], int
# 377
jc[1], int
# 378
kc[1], int
# 379
mask[1]) {
# 380
int iv;
# 381
int *__restrict__ icv = ic;
# 382
int *__restrict__ jcv = jc;
# 383
int *__restrict__ kcv = kc;
# 384
int *__restrict__ maskv = mask;
# 386
(obj) ? static_cast< void>(0) : __assert_fail("obj", "kernel.c", 386, __PRETTY_FUNCTION__);
# 388
for (iv = 0; iv < 1; iv++) {
# 389
(maskv[iv]) = 1;
# 390
}
# 392
for (iv = 0; iv < 1; iv++) {
# 393
if (((((((icv[iv]) < (((obj->param)->lim).imin)) || ((icv[iv]) > (((obj->param)->lim).imax))) || ((jcv[iv]) < (((obj->param)->lim).jmin))) || ((jcv[iv]) > (((obj->param)->lim).jmax))) || ((kcv[iv]) < (((obj->param)->lim).kmin))) || ((kcv[iv]) > (((obj->param)->lim).kmax)))
# 395
{
# 396
(maskv[iv]) = 0;
# 397
}
# 398
}
# 400
return 0;
# 401
}
# 410
int kernel_coords_index(kernel_ctxt_t *obj, int ic, int jc, int kc) {
# 412
int index;
# 413
int nhalo;
# 414
int xfac, yfac;
# 416
(obj) ? static_cast< void>(0) : __assert_fail("obj", "kernel.c", 416, __PRETTY_FUNCTION__);
# 418
nhalo = ((obj->param)->nhalo);
# 419
yfac = ((((obj->param)->nlocal)[Z]) + (2 * nhalo));
# 420
xfac = (yfac * ((((obj->param)->nlocal)[Y]) + (2 * nhalo)));
# 422
index = (((((xfac * ((nhalo + ic) - 1)) + (yfac * ((nhalo + jc) - 1))) + nhalo) + kc) - 1);
# 424
return index;
# 425
}
# 433
int kernel_coords_index_v(kernel_ctxt_t *obj, int
# 434
ic[1], int
# 435
jc[1], int
# 436
kc[1], int
# 437
index[1]) {
# 438
int iv;
# 439
int nhalo;
# 440
int xfac, yfac;
# 441
int *__restrict__ icv = ic;
# 442
int *__restrict__ jcv = jc;
# 443
int *__restrict__ kcv = kc;
# 445
(obj) ? static_cast< void>(0) : __assert_fail("obj", "kernel.c", 445, __PRETTY_FUNCTION__);
# 447
nhalo = ((obj->param)->nhalo);
# 448
yfac = ((((obj->param)->nlocal)[Z]) + (2 * nhalo));
# 449
xfac = (yfac * ((((obj->param)->nlocal)[Y]) + (2 * nhalo)));
# 451
for (iv = 0; iv < 1; iv++) {
# 452
(index[iv]) = (((((xfac * ((nhalo + (icv[iv])) - 1)) + (yfac * ((nhalo + (jcv[iv])) - 1))) + nhalo) + (kcv[iv])) - 1);
# 454
}
# 456
return 0;
# 457
}
# 465
int kernel_iterations(kernel_ctxt_t *obj) {
# 467
(obj) ? static_cast< void>(0) : __assert_fail("obj", "kernel.c", 467, __PRETTY_FUNCTION__);
# 469
return (obj->param)->kernel_iterations;
# 470
}
# 478
int kernel_vector_iterations(kernel_ctxt_t *obj) {
# 480
(obj) ? static_cast< void>(0) : __assert_fail("obj", "kernel.c", 480, __PRETTY_FUNCTION__);
# 482
return (obj->param)->kernel_vector_iterations;
# 483
}
# 491
int kernel_ctxt_info(kernel_ctxt_t *obj, kernel_info_t *lim) {
# 493
(obj) ? static_cast< void>(0) : __assert_fail("obj", "kernel.c", 493, __PRETTY_FUNCTION__);
# 494
(lim) ? static_cast< void>(0) : __assert_fail("lim", "kernel.c", 494, __PRETTY_FUNCTION__);
# 496
(*lim) = ((obj->param)->lim);
# 498
return 0;
# 499
}
# 1 "kernel.cudafe1.stub.c"
#define _NV_ANON_NAMESPACE _GLOBAL__N__14_kernel_cpp1_ii_6c28956c
# 1 "kernel.cudafe1.stub.c"
#include "kernel.cudafe1.stub.c"
# 1 "kernel.cudafe1.stub.c"
#undef _NV_ANON_NAMESPACE
| [
"s2002958@ed.ac.uk"
] | s2002958@ed.ac.uk |
4d368cb7465dcee465914e70a0c0b61dd33abdea | b7b7924b0aea91c2fb4d59aac56927f9a578fac8 | /src/triangle_app.hpp | 67a0eafe4878784fa3d98a1aa6e8b63494e38924 | [] | no_license | sfod/vulkan-test | ea4e6179be9f75921489a809e6f079deb71dfdd7 | 4c6612338a69208ca37a7e61d01fb148114f6edb | refs/heads/master | 2020-08-04T15:45:55.408608 | 2019-10-01T20:08:38 | 2019-10-01T20:08:38 | 212,190,093 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 476 | hpp | #pragma once
/// GLFW will initialize vulkan.
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
namespace vkt {
class TriangleApp {
public:
void run();
private:
void init_window();
void print_extensions();
void create_vulkan_instance();
void init_vulkan();
void main_loop();
void cleanup();
private:
static constexpr int width_ = 800;
static constexpr int height_ = 600;
GLFWwindow *window_;
VkInstance instance_;
};
}
| [
"octosyllabic@gmail.com"
] | octosyllabic@gmail.com |
a239c0989fb44348f56893b53869a182aabac133 | 6c99fc5e18259393584843570f3da9edc1209e89 | /ArduinoMorseDecoder.ino | 5b8c9a3b5d837259b60e2e7e92346d485356568c | [] | no_license | PaulKnauer/ArduinoMorseDecoder | 180e54f8651c4831ed2a18db5e9c0bdc10c8b656 | 6bee4e895fdf073903bf9f50cddcabba649c02e2 | refs/heads/master | 2021-01-12T13:22:13.206962 | 2016-10-30T11:47:55 | 2016-10-30T11:47:55 | 72,213,549 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 325 | ino | #include "MorseDecoder.h"
#include "Arduino.h"
#define BAUD_RATE 115200
MorseDecoder decoder;
void setup() {
Serial.begin(BAUD_RATE);
delay(3000);
}
void loop() {
String *morse = new String("-.- \n- .... .. ... \n.. ... \n.- \n- . ... - \n-- . ... ... .- --. . \n");
decoder.decodeMorse(morse);
delay(3000);
}
| [
"paul.knauer@gmail.com"
] | paul.knauer@gmail.com |
422d32b6dc51cde6c78748a906300ef332a42580 | 64388f92c7a7cf523f0f40ffd2c0baab68b67ee2 | /WEEk1/5_CARVANS.cpp | e25d806dd5493138346359976500b396db58bfc3 | [] | no_license | shivampapat/CODECHEF_DSA | 41bb24ab93e131e79a0d210bf7996f497e0a5309 | 299d68e8750b9eeba51ac599acdf573ee75b942b | refs/heads/master | 2022-11-05T11:07:26.965065 | 2020-06-19T12:49:23 | 2020-06-19T12:49:23 | 272,254,909 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 661 | cpp | #include<iostream>
#include<stdio.h>
using namespace std;
typedef long long ll;
int main(){
int test;
cin>>test;
while(test--){
int n;
cin>>n;
ll* arr = new ll[n];
for(ll i=0;i<n;i++){
cin>>arr[i];
}
ll counter=1;
for(ll i=1;i<n;i++){
if(arr[i] < arr[i-1]){
counter++;
}
else{
arr[i] = arr[i-1];
}
}
printf("%u\n",counter);
}
return 0;
} | [
"noreply@github.com"
] | noreply@github.com |
370184c5691f8b716a02d98d95b8138d5a3ae00e | bc7e02aad355e7791adce1d85ca86a1b0a968b59 | /libraries/sensors_actors/HLW8012_auf_eis_gelegt/src/HLW8012.cpp | c53d2d9cc51199c6d860c1a5eb54ab28aec130ea | [] | no_license | gkoe/myiot21 | b703f444550efe7e13bd765f06e6dde6e96ed82e | 9cd9abf6a1cdb5d5dff4ca30d327bf44cdbd2323 | refs/heads/master | 2023-02-06T03:42:48.071835 | 2020-12-29T19:05:40 | 2020-12-29T19:05:40 | 325,366,661 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,656 | cpp | #include "HLW8012.h"
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <sys/time.h>
#include <Logger.h>
#include "driver/gpio.h"
#include "driver/adc.h"
#include "esp_adc_cal.h"
#define DEFAULT_VREF 1100 //Use adc2_vref_to_gpio() to obtain a better estimate
#define NO_OF_SAMPLES 64 //Multisampling
static esp_adc_cal_characteristics_t *adc_chars;
static const adc_channel_t channel = ADC_CHANNEL_6; //GPIO34 if ADC1, GPIO14 if ADC2
static const adc_atten_t atten = ADC_ATTEN_DB_0;
static const adc_unit_t unit = ADC_UNIT_1;
static inline uint32_t get_time_us()
{
struct timeval tv;
gettimeofday(&tv, NULL);
return tv.tv_usec;
}
#define timeout_expired(start, len) ((uint32_t)(get_time_us() - (start)) >= (len))
/*
#define RETURN_CRTCAL(MUX, RES) \
do \
{ \
portEXIT_CRITICAL(&MUX); \
return RES; \
} while (0)
*/
#define TIMEOUT_1S 10000000
int HLW8012::measureCf1PulseDuration()
{
// Wait for CF1 goes low
uint32_t start = get_time_us();
// Wait for HIGH
while (!gpio_get_level(_pwmPin))
{
if (timeout_expired(start, TIMEOUT_1S))
return -1;
}
// Wait for LOW
start = get_time_us();
while (gpio_get_level(_pwmPin))
{
if (timeout_expired(start, TIMEOUT_1S))
return -2;
}
start = get_time_us();
// Wait for HIGH
while (!gpio_get_level(_pwmPin))
{
if (timeout_expired(start, TIMEOUT_1S))
return -3;
}
return get_time_us() - start;
}
void HLW8012::measurePowerInBackground()
{
int duration = measureCf1PulseDuration();
if (duration < 0)
{
printf("!!! Error measuring duration, ErrorCode: %i\n", duration);
_actPower = -1.0;
return;
}
_lastMeasurements[_actIndex] = duration;
_actPower = getAveragePower();
}
void measurePowerInLoopTask(void *pvParameter)
{
HLW8012 *hlw8012 = (HLW8012 *)pvParameter;
printf("MeasureTask started\n");
while (1)
{
hlw8012->measurePowerInBackground();
vTaskDelay(500 / portTICK_RATE_MS);
}
}
HLW8012::HLW8012(gpio_num_t pwmPin, const char *thingName, const char *name, const char *unit, float threshold)
: IotSensor(thingName, name, unit, threshold)
{
adc1_config_width(ADC_WIDTH_BIT_12);
adc1_config_channel_atten(channel, atten);
gpio_set_direction(pwmPin, GPIO_MODE_INPUT);
_pwmPin = pwmPin;
for (int i = 0; i < 10; i++)
{
_lastMeasurements[i] = -1;
}
xTaskCreate(measurePowerInLoopTask, /* Task function. */
"measurePowerInLoopTask", /* String with name of task. */
4096, /* Stack size in words. */
this, /* Parameter passed as input of the task */
1, /* Priority of the task. */
NULL /* Task handle. */
);
}
float HLW8012::getAveragePower()
{
int minValue = 1000;
int maxValue = 0;
int validValues = 0;
int sumOfValues = 0;
for (int i = 0; i < 10; i++)
{
if (_lastMeasurements[i] != -1)
{
uint32_t value = _lastMeasurements[i];
if (value > maxValue)
{
maxValue = value;
}
else if (value < minValue)
{
minValue = value;
}
sumOfValues += value;
validValues++;
}
}
if (validValues < 3)
return -1;
printf("sumOfValues: %d, minValue: %d, maxValue: %d, validValues: %d\n", sumOfValues, minValue, maxValue, validValues);
return (sumOfValues - minValue - maxValue) / ((float)validValues - 2);
}
/**
measure() gets the measurment and set it.
*/
void HLW8012::measure()
{
setMeasurement(_actPower);
}
| [
"gkoe@gmx.at"
] | gkoe@gmx.at |
83a321b5f6e37815df23679fa11992c4458518a5 | 3ab307b0fdf9601ff59a071691cecf9949184741 | /CodingQ/Tree/TreeTraversals.cpp | 86c2eb1141268f43c5e60cce51f150663af4dafa | [] | no_license | srinivas-github/DataStructures | 37a60fa1fe75c5ca6d41fd5e60c9a3222666cbec | ec67b347995546375c98569379e251df0b3d5914 | refs/heads/master | 2021-01-17T13:53:13.673994 | 2018-08-17T04:35:46 | 2018-08-17T04:35:46 | 42,156,025 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,805 | cpp | #include <cstdio>
#include <cstdlib>
#include <queue>
using namespace std;
struct Node
{
int data;
struct Node* left;
struct Node* right;
};
struct Node* getNewNode(int data)
{
struct Node* temp = (struct Node*)malloc(sizeof(struct Node));
temp->data = data;
temp->left = temp->right = NULL;
return temp;
}
struct Node* insert(struct Node* root, int data)
{
if (root == NULL)
{
root = getNewNode(data);
}
else if (data < root->data)
{
root->left = insert(root->left, data);
}
else
{
root->right = insert(root->right, data);
}
return root;
}
void preOrder(struct Node* root)
{
if (root == NULL)
return ;
printf("%d ", root->data);
preOrder(root->left);
preOrder(root->right);
}
void inOrder(struct Node* root)
{
if (root == NULL)
return ;
inOrder(root->left);
printf("%d ", root->data);
inOrder(root->right);
}
void postOrder(struct Node* root)
{
if (root == NULL)
return ;
postOrder(root->left);
postOrder(root->right);
printf("%d ", root->data);
}
void levelOrder(struct Node* root)
{
if (root == NULL)
return ;
std::queue<Node*> Q;
Q.push(root);
while (!Q.empty())
{
Node* curr = Q.front();
Q.pop();
printf("%d ", curr->data);
if (curr->left != NULL)
Q.push(curr->left);
if (curr->right != NULL)
Q.push(curr->right);
}
}
int height(struct Node* root)
{
if (root == NULL)
return 0;
else
{
int lH = height(root->left);
int rH = height(root->right);
return ( (lH > rH) ? lH+1 :rH+1);
}
}
void printGivenOrder(struct Node* root, int level)
{
if (root == NULL)
return ;
if (level == 1)
printf("%d ", root->data);
else if (level > 1)
{
printGivenOrder(root->left, level-1);
printGivenOrder(root->right, level-1);
}
}
void printLevelOrder(struct Node* root)
{
int h = height(root);
for (int i = 0; i <= h; i++)
printGivenOrder(root, i);
}
int main()
{
struct Node* root = NULL;
root = insert(root, 19);
root = insert(root, 15);
root = insert(root, 23);
root = insert(root, 18);
root = insert(root, 17);
root = insert(root, 14);
root = insert(root, 20);
root = insert(root, 22);
root = insert(root, 25);
printf("preOrder:\n");
preOrder(root);
printf("\n");
printf("inOrder:\n");
inOrder(root);
printf("\n");
printf("postOrder:\n");
postOrder(root);
printf("\n");
printf("Level Order: \n");
levelOrder(root);
printf("\n");
printf("print GivenOrder:\n");
printLevelOrder(root);
printf("\n");
return 0;
}
| [
"srinvasreddy.j@gmail.com"
] | srinvasreddy.j@gmail.com |
81e24bacaf2c280dcb53e0d5d489bd25c5fcbc29 | 9bbd219ea1adc510b482360dcc858046b986b4c9 | /Nearby Points/Nearby Points/vec.h | fd031f7a99d722dbc79ae0d10aa5dad0a257de82 | [] | no_license | nikhilsh/Tribilizer | 6b160988000cc15e161613e7bd8b92100ca63664 | ddfadf79af5466e0b700596a2e53bde7faa4c759 | refs/heads/master | 2021-01-17T19:52:28.349969 | 2016-07-31T18:25:28 | 2016-07-31T18:25:28 | 63,764,885 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 70,842 | h | #ifndef DF_VEC
#define DF_VEC
#if defined(__SSE2__) || defined(_M_IX86_FP)
#include <emmintrin.h>
#endif
#include <cmath>
#include <iostream>
#pragma push_macro("DI")
#pragma push_macro("DEF_SQ_MAT_BLOCK_COMMON")
#pragma push_macro("DEF_MAT_SINGLE_OP")
#pragma push_macro("DEF_SIMPLE_MAT_MAT_OP")
#pragma push_macro("DEF_MAT_SINGLE_IDENTITY")
#pragma push_macro("LG")
#pragma push_macro("DEF_MAT_BLOCK_COMMON")
#pragma push_macro("DEF_MAT_SINGLE")
#pragma push_macro("DEF_MI")
#pragma push_macro("DEF_VEC")
#pragma push_macro("DEF_VEC_SINGLE")
#pragma push_macro("F")
#pragma push_macro("VI")
#pragma push_macro("DEF_MAT_BLOCK_E_WISE_OP_EQ_TILDA")
#pragma push_macro("DEF_VEC_COMMON")
#pragma push_macro("DEF_VEC_BLOCK")
#pragma push_macro("DEF_NAMESPACE")
#pragma push_macro("U")
#pragma push_macro("IL")
#pragma push_macro("DEF_SSE_INV")
#pragma push_macro("SX")
#pragma push_macro("DEF_MAT_BLOCK_E_WISE_OP_EQ")
#pragma push_macro("SS")
#pragma push_macro("DEF_MAT_TILDA_OP")
#pragma push_macro("MI")
#pragma push_macro("ST")
#pragma push_macro("DEF_MAT_SCALAR_OP")
#pragma push_macro("DEF_IS_ARI")
#pragma push_macro("SI")
#pragma push_macro("SM")
#pragma push_macro("DEF_SQ_MAT_COMMON")
#pragma push_macro("DEF_MAT_BLOCK_E_WISE_OP_EQ_SCALAR")
#pragma push_macro("DEF_MAT_SINGLE_OP_SCALAR")
#undef DI
#undef DEF_SQ_MAT_BLOCK_COMMON
#undef DEF_MAT_SINGLE_OP
#undef DEF_SIMPLE_MAT_MAT_OP
#undef DEF_MAT_SINGLE_IDENTITY
#undef LG
#undef DEF_MAT_BLOCK_COMMON
#undef DEF_MAT_SINGLE
#undef DEF_MI
#undef DEF_VEC
#undef DEF_VEC_SINGLE
#undef F
#undef VI
#undef DEF_MAT_BLOCK_E_WISE_OP_EQ_TILDA
#undef DEF_VEC_COMMON
#undef DEF_VEC_BLOCK
#undef DEF_NAMESPACE
#undef U
#undef IL
#undef DEF_SSE_INV
#undef SX
#undef DEF_MAT_BLOCK_E_WISE_OP_EQ
#undef SS
#undef DEF_MAT_TILDA_OP
#undef MI
#undef ST
#undef DEF_MAT_SCALAR_OP
#undef DEF_IS_ARI
#undef SI
#undef SM
#undef DEF_SQ_MAT_COMMON
#undef DEF_MAT_BLOCK_E_WISE_OP_EQ_SCALAR
#undef DEF_MAT_SINGLE_OP_SCALAR
#define DEF_NAMESPACE namespace DF {
DEF_NAMESPACE
#undef DEF_NAMESPACE
#define F(I, TILL) for(unsigned I = 0; I < TILL; ++I)
#define IL inline
#define U unsigned
#define VI(INDEX) this->operator[](INDEX)
#define MI(ROW, COL) this->operator()(ROW, COL)
#define DEF_MI \
IL S & operator()(U row, U col) \
{ return static_cast<Derived*>(this)->operator()(row, col); } \
IL S operator()(U row, U col) const \
{ return static_cast<const Derived*>(this)->operator()(row, col); }
#define LG(R, C) (R==1 ? C : C==1 ? R : 0)
// Shorthands
// R: NumRows, C: NumColumns, MP: MaxArgPos, P: Pos, N: Next
// MR: MaxRow, C: MaxColumn
template <class S, U Dims> struct Vec;
template <class S, U NumRows, U NumCols> struct Mat;
template <class S, class Derived, U MR, U MC, U R, U C> struct tMatBlock;
template <class S, U R, U C, bool IsIdentity> struct tMatSingle;
template <class S, class Derived, U R, U C> struct tVec2Base;
template <class S, class Derived, U R, U C> struct tVec3Base;
template <class S, class Derived, U R, U C> struct tVec4Base;
template <class S, class Derived, U R> struct tInvertibleSqMatBlock;
template <class S, class Derived, U R> struct tInvertibleSqMat;
template <class S, class Derived, U R> struct tSqMatBase;
template <class S, U R, U C, class Derived, bool IsRow, bool IsVec>
struct tMatBase;
namespace tMatUtil
{
template <class T> struct IsAri { enum { value = false }; };
#define DEF_IS_ARI(T) template <> struct IsAri<T> { enum { value = true }; };
DEF_IS_ARI(bool);
DEF_IS_ARI(char);
DEF_IS_ARI(unsigned char);
DEF_IS_ARI(short);
DEF_IS_ARI(unsigned short);
DEF_IS_ARI(int);
DEF_IS_ARI(unsigned int);
DEF_IS_ARI(long);
DEF_IS_ARI(unsigned long);
DEF_IS_ARI(long long);
DEF_IS_ARI(unsigned long long);
DEF_IS_ARI(float);
DEF_IS_ARI(double);
DEF_IS_ARI(long double);
#undef DEF_IS_ARI
template <typename T> class IsMatBase
{
struct Fallback { int DFMatBase; };
struct Derived : T, Fallback {};
template <typename Y, Y> struct Check;
typedef char One[1];
typedef char Two[2];
template <typename Y>
static One & func(Check<int Fallback::*, &Y::DFMatBase> *);
template <typename Y> static Two & func(...);
public:
enum { value = sizeof(func<Derived>(0)) == 2 };
};
template <bool C, typename T = void> struct EnableIf { typedef T type; };
template <typename T> struct EnableIf <false, T> { };
template <U Dims> struct InitVec
{
template <class V, class T, bool IA> struct O
{ static IL void init(V &v, const T &t) { F(i, Dims) v[i] = t[i]; } };
template <class V, class T> struct O <V, T, true>
{ static IL void init(V &v, const T &t) { F(i, Dims) v[i] = t; } };
template <class V, class T> IL InitVec(V &v, const T &t)
{ O<V, T, IsAri<T>::value>::init(v, t); }
};
template <U R, U C> struct InitMat
{
// One SFINAE after another ... hehehe
enum { D = R==1 ? C : C==1 ? R : 0 };
template <class S, class T, class M> static IL
void init3(S *_, const tMatBase<T, R, C, M, false, false> &m)
{
F(j, C) F(i, R) _[j*R+i] = m(i,j);
}
template <class S, class T> static IL
typename tMatUtil::EnableIf<!tMatUtil::IsMatBase<T>::value>::type
init2(S *_, const T &t)
{
F(j, C) F(i, R) _[j*R+i] = t(i,j);
}
template <class S, class T> static IL
typename tMatUtil::EnableIf<tMatUtil::IsMatBase<T>::value>::type
init2(S *_, const T &t)
{
init3(_, t);
}
template <class S, class T> static IL
typename tMatUtil::EnableIf<!tMatUtil::IsAri<T>::value>::type
init(S *_, const T &t)
{
init2(_, t);
}
template <class S, class T> static IL
typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value>::type
init(S *_, const T &t)
{
F(j, C) F(i, R) _[j*R+i] = (j == i ? t : 0);
}
template <class S, class T> IL InitMat(S *_, const T &t) { init(_, t); }
};
struct InitSingle
{
template <class S, class T, bool IA> struct O
{ static IL void init(S &s, const T &t) { s = t[0]; } };
template <class S, class T> struct O <S, T, true>
{ static IL void init(S &s, const T &t) { s = t; } };
template <class S, class T> IL InitSingle(S &s, const T &t)
{ O<S, T, IsAri<T>::value>::init(s, t); }
};
};
// Hack to create new operators:
// *~ (element wise multiplication)
// /~ (element wise division)
template <class S, class Derived, U R, U C> struct tMatTilda
{
const Derived &d;
IL tMatTilda(const Derived &d): d(d) {}
IL S operator()(U row, U col) const { return d(row, col); }
friend std::ostream& operator << (std::ostream &os, const tMatTilda &m)
{
F(j, R) {
os << (j == 0 ? '<' : ' ');
F(i, C) os << ' ' << m(j,i);
os << ' ' << (j == R - 1 ? '>' : '\n');
}
return os << std::flush;
}
};
template <class S, U R, U C, class Derived, bool IsRow, bool IsVec>
struct tMatBase;
template <class M, U R, U C, U MP, U P>
struct tMatScalarAssigner
{
M &m;
IL tMatScalarAssigner(M &m): m(m) {}
IL operator M &() { return m; }
typedef tMatScalarAssigner<M, R, C, MP, P + 1> N;
template <class T> IL N operator , (const T &t)
{ m(P/C, P%C) = t; return N(m); }
};
template <class M, U R, U C, U MP>
struct tMatScalarAssigner <M, R, C, MP, MP>
{
M &m;
IL tMatScalarAssigner(M &m): m(m) {}
IL operator M &() { return m; }
template <class T> IL M & operator , (const T &t)
{ m(R-1, C-1) = t; return m; }
};
template <class S, U R, U C, class Derived, bool IsRow, bool IsVec>
struct tMatBase
{
private:
template <class M>
IL M _convert() const { M m; F(j,C) F(i,R) m(i,j) = MI(i,j); return m; }
public:
template <class V>
IL operator V() const volatile
{ return const_cast<const tMatBase*>(this)->_convert<V>(); }
DEF_MI;
typedef int DFMatBase;
typedef tMatScalarAssigner<tMatBase, R, C, R * C - (R * C > 0), 1>
ScalarAssigner;
template <class T>
IL typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value,
ScalarAssigner>::type operator << (const T &t)
{ this->operator()(0,0) = t; return ScalarAssigner(*this); }
typedef tMatTilda<S, tMatBase, R, C> Tilda;
IL Tilda operator ~() const { return Tilda(*this); }
friend std::ostream& operator << (std::ostream &os, const tMatBase &m)
{
F(j,R) {
os << (j == 0 ? '[' : ' ');
F(i,C) os << ' ' << m(j,i);
os << ' ' << (j == R - 1 ? ']' : '\n');
}
return os << std::flush;
}
typedef tMatBlock<S, tMatBase, R, C, 1, C> Row;
IL Row row(U i) { return Row(*this, i, 0); }
IL const Row row(U i) const
{ return Row(const_cast<tMatBase &>(*this), i, 0); }
typedef tMatBlock<S, tMatBase, R, C, R, 1> Col;
IL Col col(U i) { return Col(*this, 0, i); }
IL const Col col(U i) const
{ return Col(const_cast<tMatBase &>(*this), 0, i); }
template <U NumRows, U NumCols>
IL tMatBlock<S, tMatBase, R, C, NumRows, NumCols>
block(U offsetRow, U offsetColumn)
{
return tMatBlock<S, tMatBase, R, C, NumRows, NumCols>
(*this, offsetRow, offsetColumn);
}
template <U NumRows, U NumCols>
IL const tMatBlock<S, tMatBase, R, C, NumRows, NumCols>
block(U offsetRow, U offsetColumn) const
{
return tMatBlock<S, tMatBase, R, C, NumRows, NumCols>
(const_cast<tMatBase &>(*this), offsetRow, offsetColumn);
}
template <U NumRows>
IL tMatBlock<S, tMatBase, R, C, NumRows, NumRows>
block(U offsetRow, U offsetColumn)
{
return tMatBlock<S, tMatBase, R, C, NumRows, NumRows>
(*this, offsetRow, offsetColumn);
}
template <U NumRows>
const IL tMatBlock<S, tMatBase, R, C, NumRows, NumRows>
block(U offsetRow, U offsetColumn) const
{
return tMatBlock<S, tMatBase, R, C, NumRows, NumRows>
(const_cast<tMatBase &>(*this), offsetRow, offsetColumn);
}
IL Mat<S, R, C> operator - () const
{ Mat<S, R, C> n; F(j,C) F(i,R) n(i,j) = -MI(i,j); return n; }
/// Returns the transpose
IL Mat<S, C, R> transposed() const
{ Mat<S, C, R> n; F(j,C) F(i,R) n(j,i) = MI(i,j); return n; }
typedef tMatSingle<S, R, C, true> IdentityExpression;
// Returns an identity matrix expression.
static IL const IdentityExpression Identity()
{ return IdentityExpression::Construct(); }
typedef tMatSingle<S, R, C, false> OnesExpression;
// Returns a matrix expression with all values set to one.
static IL const OnesExpression Ones()
{ return OnesExpression::Construct(1,1); }
typedef tMatSingle<S, R, C, false> ZeroExpression;
// Returns a matrix expression with all values set to zero.
static IL const ZeroExpression Zero()
{ return ZeroExpression::Construct(0,0); }
};
template <class S, U R, U C, class Derived, bool IsRow>
struct tMatBase<S, R, C, Derived, IsRow, true>
{
private:
template <class V>
IL V _convert() const { V v; F(j, LG(R,C)) v[j] = VI(j); return v; }
public:
DEF_MI;
typedef int DFMatBase;
IL Mat<S, R, C> operator - () const
{ Mat<S, R, C> n; F(j,C) F(i,R) n(i,j) = -MI(i,j); return n; }
/// Returns the transpose
IL Mat<S, C, R> transposed() const
{ Mat<S, C, R> n; F(j,C) F(i,R) n(j,i) = MI(i,j); return n; }
IL S & operator [] (int i)
{ return MI(IsRow ? 0 : i, IsRow ? i : 0); }
IL S operator [] (int i) const
{ return MI(IsRow ? 0 : i, IsRow ? i : 0); }
template <class V>
IL operator V() const volatile
{ return const_cast<const tMatBase*>(this)->_convert<V>(); }
template <U NumRows, U NumCols>
IL tMatBlock<S, tMatBase, R, C, NumRows, NumCols>
block(U offsetRow, U offsetColumn)
{
return tMatBlock<S, tMatBase, R, C, NumRows, NumCols>
(*this, offsetRow, offsetColumn);
}
template <U NumRows, U NumCols>
IL const tMatBlock<S, tMatBase, R, C, NumRows, NumCols>
block(U offsetRow, U offsetColumn) const
{
return tMatBlock<S, tMatBase, R, C, NumRows, NumCols>
(const_cast<tMatBase &>(*this), offsetRow, offsetColumn);
}
template <U Dims>
IL tMatBlock<S, tMatBase, R, C, (IsRow ? 1 : Dims), (IsRow ? Dims : 1)>
block(U offset)
{
return tMatBlock<S, tMatBase, R, C, (IsRow ? 1 : Dims), (IsRow ? Dims : 1)>
(*this, (IsRow ? 0 : offset), (IsRow ? offset : 0));
}
template <U Dims>
const IL tMatBlock<S, tMatBase, R, C, (IsRow ? 1 : Dims), (IsRow ? Dims : 1)>
block(U offset) const
{
return tMatBlock<S, tMatBase, R, C, (IsRow ? 1 : Dims), (IsRow ? Dims : 1)>
(const_cast<tMatBase &>(*this), (IsRow ? 0 : offset), (IsRow ? offset : 0));
}
typedef tMatTilda<S, tMatBase, R, C> Tilda;
IL Tilda operator ~() const { return Tilda(*this); }
typedef tMatScalarAssigner<tMatBase, R, C, LG(R, C) - (LG(R, C) > 0), 1>
ScalarAssigner;
template <class T>
IL typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value,
ScalarAssigner>::type operator << (const T &t)
{ MI(0,0) = t; return ScalarAssigner(*this); }
friend std::ostream& operator << (std::ostream &os, const tMatBase &m)
{
os << '[';
F(j, LG(R, C)) os << ' ' << m[j];
return os << (IsRow ? " ]" : " ] T") << std::flush;
}
/// Returns the dot product with v.
template <class T, class V>
IL S dot(const tMatBase<T, R, C, V, IsRow, true> &v) const
{ S d = 0; F(i, LG(R,C)) d += VI(i) * v[i]; return d; }
/// Returns the dot product with v.
template <class T, class V>
IL S dot(const tMatBase<T, C, R, V, !IsRow, true> &v) const
{ S d = 0; F(i, LG(R,C)) d += VI(i) * v[i]; return d; }
/// Returns the squared of the norm.
IL S normSq() const { return dot(*this); }
/// Returns the length of v.
IL S norm() const { return sqrt(dot(*this)); }
/// Homogenize the vector in place.
IL tMatBase & homogenize()
{ F(i, LG(R,C)-1) VI(i) /= VI(LG(R,C)-1); VI(LG(R,C)-1) = 1; return *this; }
/// Returns a homogenized copy of vector.
IL Mat<S, R, C> homogenized() const
{ Mat<S, R, C> u(*this); return u.homogenize(); }
/// Normalizes the vector in place.
IL tMatBase & normalize()
{ S invNorm = 1 / norm(); F(i, LG(R,C)) VI(i) *= invNorm; return *this; }
/// Returns a normalized copy of vector.
IL Mat<S, R, C> normalized() const
{ Mat<S, R, C> u(*this); return u.normalize(); }
typedef tMatSingle<S, R, C, true> IdentityExpression;
// Returns an identity matrix expression.
static IL const IdentityExpression Identity()
{ return IdentityExpression::Construct(); }
typedef tMatSingle<S, R, C, false> OnesExpression;
// Returns a matrix expression with all values set to one.
static IL const OnesExpression Ones()
{ return OnesExpression::Construct(1,1); }
typedef tMatSingle<S, R, C, false> ZeroExpression;
// Returns a matrix expression with all values set to zero.
static IL const ZeroExpression Zero()
{ return ZeroExpression::Construct(0,0); }
};
// Identity Expressions --------------------------------------------------------
//~~~~~~~~~~~~~~~~~~~~~~~~~~
#define DEF_MAT_SINGLE(R, C) \
\
private: S _,g; IL tMatSingle(S _, S g): _(_), g(g) {}; public: \
static IL const tMatSingle Construct(S _, S g=0) { return tMatSingle(_, g); } \
IL S operator () (U row, U col) const \
{ return R==1 || C==1 ? _ : row == col ? _ : g; } \
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define DEF_MAT_SINGLE_IDENTITY(R, C) \
\
private: IL tMatSingle() {}; public: \
static IL const tMatSingle Construct() { return tMatSingle(); } \
IL S operator () (U row, U col) const \
{ return R==1 || C==1 ? 1 : row == col ? 1 : 0; } \
template <class S, U R, U C> struct tMatSingle<S, R, C, false>:
public tMatBase<S, R, C, tMatSingle<S, R, C, false>, R==1, R==1 || C==1>
{ DEF_MAT_SINGLE(R, C); };
template <class S, U R, U C> struct tMatSingle<S, R, C, true>:
public tMatBase<S, R, C, tMatSingle<S, R, C, true>, R==1, R==1 || C==1>
{ DEF_MAT_SINGLE_IDENTITY(R, C); };
template <class S, U R> struct tMatSingle<S, R, R, false>:
public tMatBase<S, R, R, tMatSingle<S, R, R, false>, R==1, R==1>
{
DEF_MAT_SINGLE(R, R);
/// Returns the determinant
IL S determinant() const
{ if (_ == g) return 0; S d = _; F(i, R-1) d *= _; return d; }
/// Returns the inverse
IL tMatSingle inverse() const
{ return _ == g ? tMatSingle((S)(R==1)/0, (S)0/0) : tMatSingle(1/_, 0); }
};
template <class S, U R> struct tMatSingle<S, R, R, true>:
public tMatBase<S, R, R, tMatSingle<S, R, R, true>, R==1, R==1>
{
DEF_MAT_SINGLE_IDENTITY(R, R);
/// Returns the determinant
IL S determinant() const { return 1; }
/// Returns the inverse
IL tMatSingle inverse() const { return tMatSingle(); }
};
#define DEF_VEC_SINGLE(DIMS, R, C) \
\
template <class S> struct tMatSingle<S, R, C, false>: \
public tVec##DIMS##Base<S, tMatSingle<S, R, C, false>, R, C> \
{ DEF_MAT_SINGLE(R, C); }; \
\
template <class S> struct tMatSingle<S, R, C, true>: \
public tVec##DIMS##Base<S, tMatSingle<S, R, C, true>, R, C> \
{ DEF_MAT_SINGLE_IDENTITY(R, C); };
DEF_VEC_SINGLE(2,2,1); DEF_VEC_SINGLE(2,1,2);
DEF_VEC_SINGLE(3,3,1); DEF_VEC_SINGLE(3,1,3);
DEF_VEC_SINGLE(4,4,1); DEF_VEC_SINGLE(4,1,4);
#undef DEF_VEC_SINGLE
#undef DEF_MAT_SINGLE
#undef DEF_MAT_SINGLE_IDENTITY
#define DEF_MAT_SINGLE_OP_SCALAR(OP) \
\
template <class S, U R, U C, bool II, class T> \
IL typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value, \
const tMatSingle<S, R, C, 0> >::type operator OP \
(const tMatSingle<S, R, C, II> &a, const T &t) \
{ return tMatSingle<S, R, C, 0>::Construct(a(0,0) OP t, a(1,0) OP t); } \
\
template <class S, U R, U C, bool II, class T> \
IL typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value, \
const tMatSingle<S, R, C, 0> >::type operator OP \
(const T &t, const tMatSingle<S, R, C, II> &a) \
{ return tMatSingle<S, R, C, 0>::Construct(t OP a(0,0), t OP a(1,0)); }
#define DEF_MAT_SINGLE_OP(OP) \
\
DEF_MAT_SINGLE_OP_SCALAR(OP) \
\
template <class S, U R, U C, bool II0, bool II1> \
IL const tMatSingle<S, R, C, 0> operator OP \
(const tMatSingle<S, R, C, II0> &a, const tMatSingle<S, R, C, II1> &b) \
{ return tMatSingle<S, R, C, 0>::Construct(a(0,0) OP b(0,0), a(1,0) OP b(1,0));}
DEF_MAT_SINGLE_OP(+);
DEF_MAT_SINGLE_OP(-);
DEF_MAT_SINGLE_OP_SCALAR(*);
DEF_MAT_SINGLE_OP_SCALAR(/);
#undef DEF_MAT_SINGLE_OP_SCALAR
#undef DEF_MAT_SINGLE_OP
// For better ellision with identities
template <class S, U R, class M, bool IR, bool IV>
IL const tMatBase<S, R, R, M, IR, IV> & operator *
(const tMatSingle<S, R, R, true> &a, const tMatBase<S, R, R, M, IR, IV> &b)
{ return b; }
template <class S, U R, class M, bool IR, bool IV>
IL const tMatBase<S, R, R, M, IR, IV> & operator *
(const tMatBase<S, R, R, M, IR, IV> &a, const tMatSingle<S, R, R, true> &b)
{ return a; }
template <class S, U R, class M, bool IR, bool IV>
IL tMatBase<S, R, R, M, IR, IV> & operator *=
(tMatBase<S, R, R, M, IR, IV> &a, const tMatSingle<S, R, R, true> &b)
{ return a; }
template <class S, U R, U C, bool II0, bool II1>
IL const tMatSingle<S, R, R, II0 && II1> operator *
(const tMatSingle<S, R, C, II0> &a, const tMatSingle<S, C, R, II1> &b)
{ return tMatSingle<S, R, R, II0 && II1>::Construct(a.value() * b.value()); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define DEF_MAT_BLOCK_E_WISE_OP_EQ_SCALAR(OP, R, C) \
\
template <class T> \
IL typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value, \
tMatBlock & >::type operator OP##= (const T &t) \
{ F(i,R) F(j,C) this->operator()(i,j) OP##= t; return *this; }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define DEF_MAT_BLOCK_E_WISE_OP_EQ(OP, R, C) \
\
template <class T, class M> \
IL tMatBlock & operator OP##= \
(const tMatBase<T, R, C, M, R==1, R==1 || C==1> &m) \
{ F(i,R) F(j,C) this->operator()(i,j) OP##= m(i,j); return *this; } \
\
template <class T, class M> \
IL tMatBlock & operator OP##= \
(const tMatBase<T, C, R, M, R!=1, true> &m) \
{ F(i,R) F(j,C) this->operator()(i,j) OP##= m(j,i); return *this; } \
\
DEF_MAT_BLOCK_E_WISE_OP_EQ_SCALAR(OP, R, C)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define DEF_MAT_BLOCK_E_WISE_OP_EQ_TILDA(OP, R, C) \
\
template <class T, class M> \
IL tMatBlock & operator OP##= (const tMatTilda<T, M, R, C> &m) \
{ F(j,C) F(i,R) MI(i,j) OP##= m(i,j); return *this; }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define DEF_MAT_BLOCK_COMMON(R, C) \
\
private: Derived &_d; U _r, _c; public: \
\
template <class T, class M> \
IL tMatBlock & operator = (const tMatBase<T, LG(R,C), 1, M, false, true> &m) \
{ F(j,LG(R,C)) VI(j) = m[j]; return *this; } \
\
template <class T, class M> \
IL tMatBlock & operator = (const tMatBase<T, 1, LG(R,C), M, true, true> &m) \
{ F(j,LG(R,C)) VI(j) = m[j]; return *this; } \
\
template <class T, class M, bool IR> \
IL tMatBlock & operator = (const tMatBase<T, R, C, M, IR, false> &m) \
{ F(j,C) F(i,R) MI(i,j) = m(i,j); return *this; } \
\
template <class T> \
IL typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value, \
tMatBlock & >::type operator = (const T &t) \
{ F(j,C) F(i,R) MI(i,j) = t; return *this; } \
\
template <class T, class M> \
IL tMatBlock & operator = (const tMatBlock &m) \
{ F(j,C) F(i,R) MI(i,j) = m(i,j); return *this; } \
\
IL S & operator()(U row, U col) \
{ static S g = 0; \
return _r+row >= MR || _c+col >= MC ? g : _d(_r+row,_c+col); } \
\
IL S operator()(U row, U col) const \
{ return _r+row >= MR || _c+col >= MC ? 0 : _d(_r+row,_c+col); } \
\
DEF_MAT_BLOCK_E_WISE_OP_EQ(+, R, C) \
DEF_MAT_BLOCK_E_WISE_OP_EQ(-, R, C) \
DEF_MAT_BLOCK_E_WISE_OP_EQ_SCALAR(/, R, C) \
DEF_MAT_BLOCK_E_WISE_OP_EQ_SCALAR(*, R, C) \
DEF_MAT_BLOCK_E_WISE_OP_EQ_TILDA(/, R, C) \
DEF_MAT_BLOCK_E_WISE_OP_EQ_TILDA(*, R, C)
// Mat -------------------------------------------------------------------------
template <class S, class Derived, U MR, U MC, U R, U C> struct tMatBlock:
public tMatBase<S, R, C, tMatBlock<S, Derived, MR, MC, R, C>,
R==1, R==1 || C==1>
{
IL tMatBlock(Derived &d, U r, U c): _d(d), _r(r), _c(c) {}
DEF_MAT_BLOCK_COMMON(R, C);
};
template <class S, U NumRows, U NumCols = NumRows> struct Mat:
public tMatBase<S, NumRows, NumCols, Mat<S, NumRows, NumCols>,
NumRows == 1, NumRows == 1 || NumCols == 1>
{
S _[NumRows * NumCols];
/// Constructs a matrix with the diagonal = s
IL Mat(S s = 0) { tMatUtil::InitMat<NumRows, NumCols>(_, s); }
template <class T>
IL Mat(const T &t) { tMatUtil::InitMat<NumRows, NumCols>(_, t); }
IL Mat(const Mat &m) { F(j, NumRows * NumCols) _[j] = m._[j]; }
IL operator S * () { return _; }
IL operator const S * () const { return _; }
IL S & operator()(U row, U col) { return _[col * NumRows + row]; }
IL S operator()(U row, U col) const
{ return _[col * NumRows + row]; }
};
#define DI(IS_ROW, POS) _d(IS_ROW ? 0 : _r + POS, IS_ROW ? _c + POS : 0)
#define DEF_VEC_COMMON(CLASS, DIMS, SEL) \
IL S & operator()(U row, U col) { return _[SEL]; } \
IL S operator()(U row, U col) const { return _[SEL]; } \
IL CLASS(S s = 0) { F(j, DIMS) _[j] = s; } \
IL CLASS(const CLASS &m) { F(j, DIMS) _[j] = m._[j]; } \
template <class V> CLASS(const V &v) { tMatUtil::InitVec<DIMS>(_, v); } \
IL operator S * () { return _; } \
IL operator const S * () const { return _; }
// Vec -------------------------------------------------------------------------
template <class S, U Dims> struct Vec:
public tMatBase<S, Dims, 1, Vec<S, Dims>, false, true>
{
S _[Dims];
DEF_VEC_COMMON(Vec, Dims, row);
};
// Vec2 ------------------------------------------------------------------------
template <class S, class Derived, U R, U C> struct tVec2Base:
public tMatBase<S, R, C, tVec2Base<S, Derived, R, C>, R==1, true>
{
DEF_MI;
/// Returns the cross product with v.
template <class T, class V>
IL Vec<S, 3> cross(const tMatBase<T, 2, 1, V, false, true> &v) const
{
return Vec<S, 3>(0, 0, VI(0) * v[1] - VI(1) * v[0]);
}
/// Returns the cross product with v.
template <class T, class V>
IL Vec<S, 3> cross(const tMatBase<T, 1, 2, V, true, true> &v) const
{
return Vec<S, 3>(0, 0, VI(0) * v[1] - VI(1) * v[0]);
}
/// Returns the Up vector where y = 1 (OpenGL coordinates)
IL static Vec<S, 2> Up() { return Vec<S, 2>(0, 1); }
/// Returns the Right vector where x = 1 (OpenGL coordinates)
IL static Vec<S, 2> Right() { return Vec<S, 2>(1, 0); }
};
#define DEF_VEC_BLOCK(R, C) DEF_MAT_BLOCK_COMMON(R, C); \
S &x,&y, &r,&g, &s,&t; \
IL tMatBlock(Derived &_d, U _r, U _c): _d(_d), _r(_r), _c(_c), \
x(DI(R<C,0)), y(DI(R<C,1)), \
r(DI(R<C,0)), g(DI(R<C,1)), \
s(DI(R<C,0)), t(DI(R<C,1)) {}
template <class S, class Derived, U MR, U MC>
struct tMatBlock<S, Derived, MR, MC, 2, 1>:
public tVec2Base<S, tMatBlock<S, Derived, MR, MC, 2, 1>, 2, 1>
{ DEF_VEC_BLOCK(2, 1); };
template <class S, class Derived, U MR, U MC>
struct tMatBlock<S, Derived, MR, MC, 1, 2>:
public tVec2Base<S, tMatBlock<S, Derived, MR, MC, 1, 2>, 1, 2>
{ DEF_VEC_BLOCK(1, 2); };
#undef DEF_VEC_BLOCK
#define DEF_VEC(CLASS, SEL) DEF_VEC_COMMON(CLASS, 2, SEL) \
union { S _[2]; struct { S x,y; }; struct { S r,g; }; struct { S s,t; }; }; \
IL CLASS(S x, S y): x(x), y(y) {}
template <class S> struct Mat <S, 2, 1>:
public tVec2Base<S, Mat<S, 2, 1>, 2, 1> { DEF_VEC(Mat, row); };
template <class S> struct Mat <S, 1, 2>:
public tVec2Base<S, Mat<S, 1, 2>, 1, 2> { DEF_VEC(Mat, col); };
template <class S> struct Vec <S, 2>:
public tVec2Base<S, Vec<S, 2>, 2, 1> { DEF_VEC(Vec, row); };
#undef DEF_VEC
// Vec3 ------------------------------------------------------------------------
template <class S, class Derived, U R, U C> struct tVec3Base:
public tMatBase<S, R, C, tVec3Base<S, Derived, R, C>, R==1, true>
{
DEF_MI;
/// Returns the cross product with v.
template <class T, class V>
IL Vec<S, 3> cross(const tMatBase<T, 3, 1, V, false, true> &v) const
{
return Vec<S, 3>(VI(1) * v[2] - VI(2) * v[1],
VI(2) * v[0] - VI(0) * v[2],
VI(0) * v[1] - VI(1) * v[0]);
}
/// Returns the cross product with v.
template <class T, class V>
IL Vec<S, 3> cross(const tMatBase<T, 1, 3, V, true, true> &v) const
{
return Vec<S, 3>(VI(1) * v[2] - VI(2) * v[1],
VI(2) * v[0] - VI(0) * v[2],
VI(0) * v[1] - VI(1) * v[0]);
}
/// Returns the Up vector where y = 1 (OpenGL coordinates)
IL static Vec<S, 3> Up() { return Vec<S, 3>(0, 1, 0); }
/// Returns the Right vector where x = 1 (OpenGL coordinates)
IL static Vec<S, 3> Right() { return Vec<S, 3>(1, 0, 0); }
/// Returns the Back vector where z = -1 (OpenGL coordinates)
IL static Vec<S, 3> Forward() { return Vec<S, 3>(0, 0, -1); }
};
#define DEF_VEC_BLOCK(R, C) DEF_MAT_BLOCK_COMMON(R, C) \
S &x,&y,&z, &r,&g,&b, &s,&t,&p; \
IL tMatBlock(Derived &_d, U _r, U _c): _d(_d), _r(_r), _c(_c), \
x(DI(R<C,0)), y(DI(R<C,1)), z(DI(R<C,2)), \
r(DI(R<C,0)), g(DI(R<C,1)), b(DI(R<C,2)), \
s(DI(R<C,0)), t(DI(R<C,1)), p(DI(R<C,2)) {}
template <class S, class Derived, U MR, U MC>
struct tMatBlock<S, Derived, MR, MC, 3, 1>:
public tVec3Base<S, tMatBlock<S, Derived, MR, MC, 3, 1>, 3, 1>
{ DEF_VEC_BLOCK(3, 1); };
template <class S, class Derived, U MR, U MC>
struct tMatBlock<S, Derived, MR, MC, 1, 3>:
public tVec3Base<S, tMatBlock<S, Derived, MR, MC, 1, 3>, 1, 3>
{ DEF_VEC_BLOCK(1, 3); };
#undef DEF_VEC_BLOCK
#define DEF_VEC(CLASS, SEL) DEF_VEC_COMMON(CLASS, 3, SEL) union { S _[3]; \
struct { S x,y,z; }; struct { S r,g,b; }; struct { S s,t,p; }; }; \
IL CLASS(S x, S y, S z): x(x), y(y), z(z) {} \
\
template <class S0, class S1, class D, U R, U C> \
IL CLASS(const tVec2Base<S0, D, R, C> &xy, S1 z): \
x(xy[0]), y(xy[1]), z(z) {}\
\
template <class S0, class S1, class D, U R, U C> \
IL CLASS(S0 x, const tVec2Base<S1, D, R, C> &yz): \
x(x), y(yz[0]), z(yz[1]) {} \
template <class S> struct Mat <S, 3, 1>:
public tVec3Base<S, Mat<S, 3, 1>, 3, 1> { DEF_VEC(Mat, row); };
template <class S> struct Mat <S, 1, 3>:
public tVec3Base<S, Mat<S, 1, 3>, 1, 3> { DEF_VEC(Mat, col); };
template <class S> struct Vec <S, 3>:
public tVec3Base<S, Vec<S, 3>, 3, 1> { DEF_VEC(Vec, row); };
#undef DEF_VEC
// Vec4 ------------------------------------------------------------------------
template <class S, class Derived, U R, U C> struct tVec4Base:
public tMatBase<S, R, C, tVec4Base<S, Derived, R, C>, R==1, true>
{
DEF_MI;
/// Returns the cross product with v.
template <class T, class V>
IL Vec<S, 4> cross(const tMatBase<T, 4, 1, V, false, true> &v) const
{
return Vec<S, 4>(VI(1) * v[2] - VI(2) * v[1],
VI(2) * v[0] - VI(0) * v[2],
VI(0) * v[1] - VI(1) * v[0], 0);
}
/// Returns the cross product with v.
template <class T, class V>
IL Vec<S, 4> cross(const tMatBase<T, 1, 4, V, true, true> &v) const
{
return Vec<S, 4>(VI(1) * v[2] - VI(2) * v[1],
VI(2) * v[0] - VI(0) * v[2],
VI(0) * v[1] - VI(1) * v[0], 0);
}
/// Returns the Up vector where y = 1 (OpenGL coordinates)
IL static Vec<S, 4> Up() { return Vec<S, 4>(0, 1, 0, 0); }
/// Returns the Right vector where x = 1 (OpenGL coordinates)
IL static Vec<S, 4> Right() { return Vec<S, 4>(1, 0, 0, 0); }
/// Returns the Back vector where z = -1 (OpenGL coordinates)
IL static Vec<S, 4> Forward() { return Vec<S, 4>(0, 0, -1, 0); }
};
#define DEF_VEC_BLOCK(R, C) DEF_MAT_BLOCK_COMMON(R, C) \
S &x,&y,&z,&w, &r,&g,&b,&a, &s,&t,&p,&q; \
IL tMatBlock(Derived &_d, U _r, U _c): _d(_d), _r(_r), _c(_c), \
x(DI(R<C,0)), y(DI(R<C,1)), z(DI(R<C,2)), w(DI(R<C,3)), \
r(DI(R<C,0)), g(DI(R<C,1)), b(DI(R<C,2)), a(DI(R<C,3)), \
s(DI(R<C,0)), t(DI(R<C,1)), p(DI(R<C,2)), q(DI(R<C,3)) {}
template <class S, class Derived, U MR, U MC>
struct tMatBlock<S, Derived, MR, MC, 4, 1>:
public tVec4Base<S, tMatBlock<S, Derived, MR, MC, 4, 1>, 4, 1>
{ DEF_VEC_BLOCK(4, 1); };
template <class S, class Derived, U MR, U MC>
struct tMatBlock<S, Derived, MR, MC, 1, 4>:
public tVec4Base<S, tMatBlock<S, Derived, MR, MC, 1, 4>, 1, 4>
{ DEF_VEC_BLOCK(1, 4); };
#undef DEF_VEC_BLOCK
#define DEF_VEC(CLASS, SEL) DEF_VEC_COMMON(CLASS, 4, SEL) union { S _[4]; \
struct { S x,y,z,w; }; struct { S r,g,b,a; }; struct { S s,t,p,q; }; }; \
IL CLASS(S x, S y, S z, S w): x(x), y(y), z(z), w(w) {} \
\
template <class S0, class S1, class S2, class D, U R, U C> \
IL CLASS(const tVec2Base<S0, D, R, C> &xy, S1 z, S2 w): \
x(xy[0]), y(xy[1]), z(z), w(w) {}\
\
template <class S0, class S1, class S2, class D, U R, U C> \
IL CLASS(S0 x, const tVec2Base<S1, D, R, C> &yz, S2 w): \
x(x), y(yz[0]), z(yz[1]), w(w) {} \
\
template <class S0, class S1, class S2, class D, U R, U C> \
IL CLASS(S0 x, S1 y, const tVec2Base<S2, D, R, C> &zw): \
x(x), y(y), z(zw[0]), w(zw[1]) {} \
\
template <class S0, class S1, class D0, \
class D1, U R0, U R1, U C0, U C1> \
IL CLASS(const tVec2Base<S0, D0, R0, C0> &xy, \
const tVec2Base<S1, D1, R1, C1> &zw): \
x(xy[0]), y(xy[1]), z(zw[0]), w(zw[1]) {} \
\
template <class S0, class S1, class D, U R, U C> \
IL CLASS(const tVec3Base<S0, D, R, C> &xyz, S1 w): \
x(xyz[0]), y(xyz[1]), z(xyz[2]), w(w) {} \
\
template <class S0, class S1, class D, U R, U C> \
IL CLASS(S0 x, const tVec3Base<S1, D, R, C> &yzw): \
x(x), y(yzw[0]), z(yzw[1]), w(yzw[2]) {}
template <class S> struct Mat <S, 4, 1>:
public tVec4Base<S, Mat<S, 4, 1>, 4, 1> { DEF_VEC(Mat, row); };
template <class S> struct Mat <S, 1, 4>:
public tVec4Base<S, Mat<S, 1, 4>, 1, 4> { DEF_VEC(Mat, col); };
template <class S> struct Vec <S, 4>:
public tVec4Base<S, Vec<S, 4>, 4, 1> { DEF_VEC(Vec, row); };
#undef DEF_VEC
#undef DI
// Vec Ops ---------------------------------------------------------------------
#define DEF_MAT_TILDA_OP(OP) \
template <class S, U R, U C, bool IR, bool IV, class V0, class V1> \
IL Mat<S, R, C> operator OP \
(const tMatBase<S, R, C, V0, IR, IV> &u, \
const tMatTilda<S, V1, R, C> &v) \
{ Mat<S, R, C> r; F(j,C) F(i,R) r(i,j) = u(i,j) OP v(i,j); return r; } \
\
template <class S, class T, U R, U C, bool IR, bool IV, class V0, class V1> \
IL tMatBase<S, R, C, V0, IR, IV> & operator OP##= \
(tMatBase<S, R, C, V0, IR, IV> &u, const tMatTilda<T, V1, R, C> &v) \
{ F(j,C) F(i,R) u(i,j) OP##= v(i,j); return u; }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define DEF_MAT_SCALAR_OP(OP) \
\
template <class S, U R, U C, class M, bool IR, bool IV, class T> \
IL typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value, Mat<S, R, C> >::type \
operator OP (const tMatBase<S, R, C, M, IR, IV> &n, const T &t) \
{ Mat<S, R, C> r; F(j,C) F(i,R) r(i,j) = n(i,j) OP t; return r; } \
\
template <class S, U R, U C, class M, bool IR, bool IV, class T> \
IL typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value, \
tMatBase<S, R, C, M, IR, IV> >::type \
operator OP##= (tMatBase<S, R, C, M, IR, IV> &n, const T &t) \
{ F(j,C) F(i,R) n(i,j) OP##= t; return n; } \
\
template <class S, U R, U C, class M, bool IR, bool IV, class T> \
IL typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value, \
Mat<S, R, C> >::type \
operator OP (const T &t, const tMatBase<S, R, C, M, IR, IV> &n) \
{ Mat<S, R, C> r; F(j,C) F(i,R) r(i,j) = t OP n(i,j); return r; }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define DEF_SIMPLE_MAT_MAT_OP(OP) \
\
template <class S, U R, U C, \
class M0, class M1, bool IR0, bool IR1, bool IV0, bool IV1> \
IL tMatBase<S, R, C, M0, IR0, IV0> operator OP##= \
( tMatBase<S, R, C, M0, IR0, IV0> &n, \
const tMatBase<S, R, C, M1, IR1, IV1> &m) \
{ F(j,C) F(i,R) n(i,j) OP##= m(i,j); return n; } \
\
template <class S, U R, U C, \
class M0, class M1, bool IR0, bool IR1, bool IV0, bool IV1> \
IL Mat<S, R, C> operator OP \
(const tMatBase<S, R, C, M0, IR0, IV0> &n, \
const tMatBase<S, R, C, M1, IR1, IV1> &m) \
{ Mat<S, R, C> r; F(j,C) F(i,R) r(i,j) = n(i,j) OP m(i,j); return r; }
DEF_SIMPLE_MAT_MAT_OP(-);
DEF_SIMPLE_MAT_MAT_OP(+);
DEF_MAT_SCALAR_OP(-);
DEF_MAT_SCALAR_OP(+);
DEF_MAT_SCALAR_OP(*);
DEF_MAT_SCALAR_OP(/);
DEF_MAT_TILDA_OP(*);
DEF_MAT_TILDA_OP(/);
#undef DEF_MAT_TILDA_OP
#undef DEF_MAT_SCALAR_OP
#undef DEF_SIMPLE_MAT_MAT_OP
template <class S, U R, U C, U C1, class M0, class M1,
bool IR0, bool IR1, bool IV0, bool IV1>
IL Mat<S, R, C1> operator *
(const tMatBase<S, R, C, M0, IR0, IV0> &n,
const tMatBase<S, C, C1, M1, IR1, IV1> &m)
{
Mat<S, R, C1> r=0;
F(j,C1) F(i,R) F(x,C) r(i,j) += n(i,x) * m(x,j);
return r;
}
template <class S, U R, class M0, class M1,
bool IR0, bool IR1, bool IV0, bool IV1>
IL tMatBase<S, R, R, M0, IR0, IV0> & operator *=
(tMatBase<S, R, R, M0, IR0, IV0> &n,
const tMatBase<S, R, R, M1, IR1, IV1> &m)
{
Mat<S, R> c(n);
F(j, R) F(i, R) F(x, R) n(i,j) += c(i,x) * m(x,j);
return n;
}
// Quat ------------------------------------------------------------------------
template <class S> struct Quat:
public tMatBase<S, 4, 1, Quat<S>, false, true>
{
union { S _[4]; struct { S w, x, y, z; }; };
IL Quat(): w(0), x(0), y(0), z(0) {}
IL Quat(S w, S x, S y, S z): w(w), x(x), y(y), z(z) {}
/// Returns the identity Quaternion. [1, 0, 0, 0]
IL static Quat Identity() { return Quat(1, 0, 0, 0); }
private:
template <class V0, class V1, class V2>
IL void _initFromBasis(const V0 &bx, const V1 &by, const V2 &bz)
{
S onePlusTrace = 1 + bx[0] + by[1] + bz[2];
if (onePlusTrace > 1e-5) {
S s = sqrt(onePlusTrace) * 2;
w = 0.25 * s;
x = (by[2] - bz[1]) / s;
y = (bz[0] - bx[2]) / s;
z = (bx[1] - by[0]) / s;
} else {
if ((bx[0] > by[1]) & (bx[0] > bz[2])) {
S s = sqrt(1.0 + bx[0] - by[1] - bz[2]) * 2;
w = (bz[1] - by[2]) / s;
x = 0.25 * s;
y = (by[0] + bx[1]) / s;
z = (bz[0] + bx[2]) / s;
} else if (by[1] > bz[2]) {
S s = sqrt(1 + by[1] - bx[0] - bz[2]) * 2;
w = (bz[0] - bx[2]) / s;
x = (by[0] + bx[1]) / s;
y = 0.25 * s;
z = (bz[1] + by[2]) / s;
} else {
S s = sqrt(1 + bz[2] - bx[0] - by[1]) * 2;
w = (by[0] - bx[1]) / s;
x = (bz[0] + bx[2]) / s;
y = (bz[1] + by[2]) / s;
z = 0.25 * s;
}
}
this->normalize();
}
public:
IL S & operator()(U row, U col) { return _[row]; }
IL S operator()(U row, U col) const { return _[row]; }
/// Constructs a quarternion from a rotation matrix.
template <class T, class M, bool IR, bool IV>
IL Quat(const tMatBase<T, 3, 3, M, IR, IV> &m)
{ _initFromBasis(m.col(0), m.col(1), m.col(2)); }
/// Constructs a quarternion from a rotation matrix.
template <class T, class M, bool IR, bool IV>
IL Quat(const tMatBase<T, 4, 4, M, IR, IV> &m)
{ _initFromBasis(m.col(0), m.col(1), m.col(2)); }
/// Constructs a quarternion from a rotation matrix
template <class T0, class V0, U R0, U C0,
class T1, class V1, U R1, U C1,
class T2, class V2, U R2, U C2>
IL Quat(const tVec3Base<T0, V0, R0, C0> &basisX,
const tVec3Base<T1, V1, R1, C1> &basisY,
const tVec3Base<T2, V2, R2, C2> &basisZ)
{ _initFromBasis(basisX, basisY, basisZ); }
IL Quat & conjugate()
{ F(i, 3) _[i+1] = -_[i+1]; return *this; }
IL Quat conjugated() const
{ return Quat(_[0], -_[1], -_[2], -_[3]); }
IL Quat inverse() const
{ return conjugated() * (1 / this->normSq()); }
IL Quat & invert()
{ return *this = inverse(); }
IL Quat & log() const
{
S l = this->norm();
return (Quat(0, _[1], _[2], _[3]) * (l > 1e-6 ? acos(_[0]) / l : 1));
}
IL Quat & exp() const
{
S t = this->norm();
if (t < 1e-6) {
return Quat(cos(t), _[1], _[2], _[3]);
} else {
S c = sin(t) / t;
return Quat(cos(t), _[1] * c, _[2] * c, _[3] * c);
}
}
struct AxisAngle
{
Vec<S, 3> axis;
S radians;
AxisAngle() {}
AxisAngle(const Vec<S, 3> &axis, S radians):
axis(axis), radians(radians) {}
};
IL AxisAngle getAxisAngle()
{ return AxisAngle(acos(w)*2, Vec<S, 3>(x,y,z).normalized()); }
template <class T, class V, U R, U C>
IL Quat & setAxisAngle(S radians, const tVec3Base<T, V, R, C> &axis)
{
S r = radians / 2, s = sin(r) / axis.norm();
_[0] = cos(r); _[1] = axis.x * s; _[2] = axis.y * s; _[3] = axis.z * s;
}
IL Quat & setAxisAngle(const AxisAngle &axisAngle)
{ setAxisAngle(axisAngle.axis, axisAngle.radians); }
template <class T>
IL Quat(S radians, const Vec<T, 3> &axis) { setAxisAngle(radians, axis); }
IL Quat(const AxisAngle &axisAngle) { setAxisAngle(axisAngle); }
};
/// Returns the linear interpolation between a and b
template <class S, class T>
IL Quat<S> lerp(const Quat<S> &a, const Quat<S> &b, T t)
{ return (b + t * (b - a)).normalized(); }
/// Returns the spherical interpolation between a and b
template <class S, class T>
IL Quat<S> slerp(const Quat<S> &a, const Quat<S> &b, T t,
bool allowFlip = true)
{
S c1, c2, cosAngle = a.dot(b);
if (1 - fabs(cosAngle) < 0.001) {
c1 = 1 - t; c2 = t;
} else {
S angle = acos(fabs(cosAngle));
S sinAngle = sin(angle);
c1 = sin(angle * (1 - t)) / sinAngle;
c2 = sin(angle * t) / sinAngle;
}
// Use the shortest path
if (allowFlip && (cosAngle < 0)) c1 = -c1;
return c1 * a + c2 * b;
}
/// Returns the spherical quadrangle interpolation between a and b
template <class S, class T>
IL Quat<S> squad(const Quat<S> &a, const Quat<S> &tanA,
const Quat<S> &tanB, const Quat<S> &b, T t)
{
Quat<S> ab = slerp(a, b, t, true), tangent = slerp(tanA, tanB, t, false);
return slerp(ab, tangent, 2 * t * (1 - t), false);
}
/// Returns the cubic interpolation between a and b
template <class S, class T>
IL Quat<S> cubicInterpolate(const Quat<S> &q0, const Quat<S> &q1,
const Quat<S> &q2, const Quat<S> &q3, T t)
{
Quat<S> q0q1 = slerp(q0, q1, t + 1);
Quat<S> q1q2 = slerp(q1, q2, t);
Quat<S> q2q3 = slerp(q2, q3, t - 1);
Quat<S> q0q1_q1q2 = slerp(q0q1, q1q2, 0.5 * (t + 1));
Quat<S> q1q2_q2q3 = slerp(q1q2, q2q3, 0.5 * t);
return slerp(q0q1_q1q2, q1q2_q2q3, t);
}
/// Returns the log difference between a and b
template <class S>
IL Quat<S> logDifference(const Quat<S> &a, const Quat<S> &b)
{ return (a.inverse() * b).normalized().log(); }
/// Returns the tangent for spherical quadrangle interpolation
template <class S>
IL Quat<S> squadTangent(const Quat<S> &before,
const Quat<S> ¢er,
const Quat<S> &after)
{
Quat<S> l1 = logDifference(center, before);
Quat<S> l2 = logDifference(center, after);
return center * (-0.25 * (l1 + l2)).exp();
}
template <class S> IL Quat<S> operator * (const Quat<S> &p, const Quat<S> &q)
{
return Quat<S>(p.w*q.w - p.x*q.x - p.y*q.y - p.z*q.z,
p.w*q.x + p.x*q.w + p.y*q.z - p.z*q.y,
p.w*q.y - p.x*q.z + p.y*q.w + p.z*q.x,
p.w*q.z + p.x*q.y - p.y*q.x + p.z*q.w);
}
template <class S> IL Quat<S> & operator *= (Quat<S> &p, const Quat<S> &q)
{ return p = p * q; }
namespace tMatUtil
{
template <class S, U Dims> struct MatInv;
template <class S, U Dims> struct MatDet;
#define SM(I0,I1,I2) (src[0x##I0] * src[0x##I1] * src[0x##I2])
#define SI(I0,I1,I2,I3,I4,I5,I6,I7,I8,I9,IA,IB,IC,ID,IE,IF,IG,IH) \
(SM(I0,I1,I2) - SM(I3,I4,I5) + SM(I6,I7,I8) - \
SM(I9,IA,IB) + SM(IC,ID,IE) - SM(IF,IG,IH))
template <class S> struct MatInv <S, 4>
{
IL void operator()(const S *src, S *dst)
{
S dst0 = SI(5,a,f,5,b,e,9,7,e,9,6,f,d,6,b,d,7,a);
S dst4 = SI(4,b,e,4,a,f,8,6,f,8,7,e,c,7,a,c,6,b);
S dst8 = SI(4,9,f,4,b,d,8,7,d,8,5,f,c,5,b,c,7,9);
S dst12 = SI(4,a,d,4,9,e,8,5,e,8,6,d,c,6,9,c,5,a);
S det = src[0]*dst0 + src[1]*dst4 + src[2]*dst8 + src[3]*dst12;
if (det == 0) { F(i, 16) dst[i] /= 0; return; }
S invDet = 1 / det;
dst[0] = dst0, dst[4] = dst4, dst[8] = dst8, dst[12] = dst12;
dst[1 ] = SI(1,b,e,1,a,f,9,2,f,9,3,e,d,3,a,d,2,b);
dst[5 ] = SI(0,a,f,0,b,e,8,3,e,8,2,f,c,2,b,c,3,a);
dst[9 ] = SI(0,b,d,0,9,f,8,1,f,8,3,d,c,3,9,c,1,b);
dst[13] = SI(0,9,e,0,a,d,8,2,d,8,1,e,c,1,a,c,2,9);
dst[2 ] = SI(1,6,f,1,7,e,5,3,e,5,2,f,d,2,7,d,3,6);
dst[6 ] = SI(0,7,e,0,6,f,4,2,f,4,3,e,c,3,6,c,2,7);
dst[10] = SI(0,5,f,0,7,d,4,3,d,4,1,f,c,1,7,c,3,5);
dst[14] = SI(0,6,d,0,5,e,4,1,e,4,2,d,c,2,5,c,1,6);
dst[3 ] = SI(1,7,a,1,6,b,5,2,b,5,3,a,9,3,6,9,2,7);
dst[7 ] = SI(0,6,b,0,7,a,4,3,a,4,2,b,8,2,7,8,3,6);
dst[11] = SI(0,7,9,0,5,b,4,1,b,4,3,9,8,3,5,8,1,7);
dst[15] = SI(0,5,a,0,6,9,4,2,9,4,1,a,8,1,6,8,2,5);
F(i, 16) dst[i] *= invDet;
}
};
template <class S> struct MatDet <S, 4>
{
IL S operator()(const S *src)
{
return (src[0] * SI(5,a,f,5,b,e,9,7,e,9,6,f,d,6,b,d,7,a) +
src[1] * SI(4,b,e,4,a,f,8,6,f,8,7,e,c,7,a,c,6,b) +
src[2] * SI(4,9,f,4,b,d,8,7,d,8,5,f,c,5,b,c,7,9) +
src[3] * SI(4,a,d,4,9,e,8,5,e,8,6,d,c,6,9,c,5,a) );
}
};
#undef SM
#undef SI
// Mat 4x4 SSE inverse
#if defined(__SSE2__) || defined(_M_IX86_FP)
// Eigen's 4x4 float inverse
#define SM _mm_mul_ps
#define SI(V, OP) _mm_shuffle_ps(V, V, OP)
#define DEF_SSE_INV \
__m128 L1,L2,L3,L4,A,B,C,D,iA,iB,iC,iD,DC,AB,dA,dB,dC,dD,dt,d,d1,d2,rd;L1=_mm_l\
oadu_ps(src+0);L2=_mm_loadu_ps(src+4);L3=_mm_loadu_ps(src+8);L4=_mm_loadu_ps(sr\
c+12);A=_mm_unpacklo_ps(L1,L2);B=_mm_unpacklo_ps(L3,L4);C=_mm_unpackhi_ps(L1,L2\
);D=_mm_unpackhi_ps(L3,L4);AB=SM(SI(A,0x0F),B);AB=_mm_sub_ps(AB,SM(SI(A,0xA5),S\
I(B,0x4E)));DC=SM(SI(D,0x0F),C);DC=_mm_sub_ps(DC,SM(SI(D,0xA5),SI(C,0x4E)));dA=\
SM(SI(A,0x5F),A);dA=_mm_sub_ss(dA,_mm_movehl_ps(dA,dA));dB=SM(SI(B,0x5F),B);dB=\
_mm_sub_ss(dB,_mm_movehl_ps(dB,dB));dC=SM(SI(C,0x5F),C);dC=_mm_sub_ss(dC,_mm_mo\
vehl_ps(dC,dC));dD=SM(SI(D,0x5F),D);dD=_mm_sub_ss(dD,_mm_movehl_ps(dD,dD));d=SM\
(SI(DC,0xD8),AB);iD=SM(SI(C,0xA0),_mm_movelh_ps(AB,AB));iD=_mm_add_ps(iD,SM(SI(\
C,0xF5),_mm_movehl_ps(AB,AB)));iA=SM(SI(B,0xA0),_mm_movelh_ps(DC,DC));iA=_mm_ad\
d_ps(iA,SM(SI(B,0xF5),_mm_movehl_ps(DC,DC)));d=_mm_add_ps(d,_mm_movehl_ps(d,d))\
;d=_mm_add_ss(d,SI(d,1));d1=_mm_mul_ss(dA,dD);d2=_mm_mul_ss(dB,dC);iD=_mm_sub_p\
s(SM(D,SI(dA,0)),iD);iA=_mm_sub_ps(SM(A,SI(dD,0)),iA);dt=_mm_sub_ss(_mm_add_ss(\
d1,d2),d);rd=_mm_div_ss(_mm_set_ss(1.0f),dt);iB=SM(D,SI(AB,0x33));iB=_mm_sub_ps\
(iB,SM(SI(D,0xB1),SI(AB,0x66)));iC=SM(A,SI(DC,0x33));iC=_mm_sub_ps(iC,SM(SI(A,0\
xB1),SI(DC,0x66)));rd=SI(rd,0);rd=_mm_xor_ps(rd,_mm_castsi128_ps(_mm_set_epi32(\
0,1<<31,1<<31,0)));iB=_mm_sub_ps(SM(C,SI(dB,0)),iB);iC=_mm_sub_ps(SM(B,SI(dC,0)\
),iC);iA=SM(rd,iA);iB=SM(rd,iB);iC=SM(rd,iC);iD=SM(rd,iD);_mm_storeu_ps(dst+0,S\
I(iB,0x77));_mm_storeu_ps(dst+4,SI(iB,0x22));_mm_storeu_ps(dst+8,SI(iD,0x77));_\
mm_storeu_ps(dst+12,SI(iD,0x22));
template <> struct MatInv <float, 4>
{ IL void operator()(const float *src, float *dst) { DEF_SSE_INV; } };
#undef DEF_SSE_INV
#undef SI
#undef SM
// Eigen's 4x4 double inverse
#define SM _mm_mul_pd
#define SS _mm_sub_pd
#define SI _mm_shuffle_pd
#define ST(O,A,K,D) _mm_storeu_pd(i+O,SM(SI(i##A##2,i##A##1,K),d##D))
#define SX(A,B) _mm_xor_pd(rd,_mm_castsi128_pd(_mm_set_epi32(1<<A,0,1<<B,0)))
#define DEF_SSE_INV \
__m128d A1,A2,B1,B2,C1,C2,D1,D2,iA1,iA2,iB1,iB2,iC1,iC2,iD1,iD2,DC1,DC2,AB1,AB2\
,dA,dB,dC,dD,det,d1,d2,rd;double*i=dst;A1=_mm_loadu_pd(src+0);B1=_mm_loadu_pd(s\
rc+2);A2=_mm_loadu_pd(src+4);B2=_mm_loadu_pd(src+6);C1=_mm_loadu_pd(src+8);D1=_\
mm_load_pd(src+10);C2=_mm_loadu_pd(src+12);D2=_mm_loadu_pd(src+14);dA=SI(A2,A2,\
1);dA=SM(A1,dA);dA=_mm_sub_sd(dA,SI(dA,dA,3));dB=SI(B2,B2,1);dB=SM(B1,dB);dB=_m\
m_sub_sd(dB,SI(dB,dB,3));AB1=SM(B1,SI(A2,A2,3));AB2=SM(B2,SI(A1,A1,0));AB1=SS(A\
B1,SM(B2,SI(A1,A1,3)));AB2=SS(AB2,SM(B1,SI(A2,A2,0)));dC=SI(C2,C2,1);dC=SM(C1,d\
C);dC=_mm_sub_sd(dC,SI(dC,dC,3));dD=SI(D2,D2,1);dD=SM(D1,dD);dD=_mm_sub_sd(dD,S\
I(dD,dD,3));DC1=SM(C1,SI(D2,D2,3));DC2=SM(C2,SI(D1,D1,0));DC1=SS(DC1,SM(C2,SI(D\
1,D1,3)));DC2=SS(DC2,SM(C1,SI(D2,D2,0)));d1=SM(AB1,SI(DC1,DC2,0));d2=SM(AB2,SI(\
DC1,DC2,3));rd=_mm_add_pd(d1,d2);rd=_mm_add_sd(rd,SI(rd,rd,3));iD1=SM(AB1,SI(C1\
,C1,0));iD2=SM(AB1,SI(C2,C2,0));iD1=_mm_add_pd(iD1,SM(AB2,SI(C1,C1,3)));iD2=_mm\
_add_pd(iD2,SM(AB2,SI(C2,C2,3)));iA1=SM(DC1,SI(B1,B1,0));iA2=SM(DC1,SI(B2,B2,0)\
);iA1=_mm_add_pd(iA1,SM(DC2,SI(B1,B1,3)));iA2=_mm_add_pd(iA2,SM(DC2,SI(B2,B2,3)\
));dA=SI(dA,dA,0);iD1=SS(SM(D1,dA),iD1);iD2=SS(SM(D2,dA),iD2);dD=SI(dD,dD,0);iA\
1=SS(SM(A1,dD),iA1);iA2=SS(SM(A2,dD),iA2);d1=_mm_mul_sd(dA,dD);d2=_mm_mul_sd(dB\
,dC);iB1=SM(D1,SI(AB2,AB1,1));iB2=SM(D2,SI(AB2,AB1,1));iB1=SS(iB1,SM(SI(D1,D1,1\
),SI(AB2,AB1,2)));iB2=SS(iB2,SM(SI(D2,D2,1),SI(AB2,AB1,2)));det=_mm_add_sd(d1,d\
2);det=_mm_sub_sd(det,rd);iC1=SM(A1,SI(DC2,DC1,1));iC2=SM(A2,SI(DC2,DC1,1));iC1\
=SS(iC1,SM(SI(A1,A1,1),SI(DC2,DC1,2)));iC2=SS(iC2,SM(SI(A2,A2,1),SI(DC2,DC1,2))\
);rd=_mm_div_sd(_mm_set_sd(1.0),det);rd=SI(rd,rd,0);dB=SI(dB,dB,0);iB1=SS(SM(C1\
,dB),iB1);iB2=SS(SM(C2,dB),iB2);d1=SX(31,0);d2=SX(0,31);dC=SI(dC,dC,0);iC1=SS(S\
M(B1,dC),iC1);iC2=SS(SM(B2,dC),iC2);ST(0,A,3,1);ST(4,A,0,2);ST(2,B,3,1);ST(6,B,\
0,2);ST(8,C,3,1);ST(12,C,0,2);ST(10,D,3,1);ST(14,D,0,2);
template <> struct MatInv <double, 4>
{ IL void operator()(const double *src, double *dst) { DEF_SSE_INV; }; };
#undef DEF_SSE_INV
#undef SM
#undef SS
#undef ST
#undef SI
#undef SX
#endif
template <class S> struct MatInv <S, 3>
{
IL void operator()(const S *src, S *dst)
{
dst[0] = + src[4] * src[8] - src[5] * src[7];
dst[1] = - src[1] * src[8] + src[2] * src[7];
dst[2] = + src[1] * src[5] - src[2] * src[4];
dst[3] = - src[3] * src[8] + src[5] * src[6];
dst[4] = + src[0] * src[8] - src[2] * src[6];
dst[5] = - src[0] * src[5] + src[2] * src[3];
dst[6] = + src[3] * src[7] - src[4] * src[6];
dst[7] = - src[0] * src[7] + src[1] * src[6];
dst[8] = + src[0] * src[4] - src[1] * src[3];
S det = src[0] * dst[0] + src[1] * dst[3] + src[2] * dst[6];
det = 1 / det;
F(i, 9) dst[i] *= det;
}
};
template <class S> struct MatDet <S, 3>
{
IL S operator()(const S *src)
{
S d0 = + src[4] * src[8] - src[5] * src[7];
S d3 = - src[3] * src[8] + src[5] * src[6];
S d6 = + src[3] * src[7] - src[4] * src[6];
return src[0] * d0 + src[1] * d3 + src[2] * d6;
}
};
template <class S> struct MatInv<S, 2>
{
IL void operator()(const S *src, S *dst)
{
dst[0] = + src[3]; dst[1] = - src[1];
dst[2] = - src[2]; dst[3] = + src[0];
S det = 1 / (src[0] * dst[0] + src[1] * dst[2]);
dst[0] *= det; dst[1] *= det;
dst[2] *= det; dst[3] *= det;
}
};
template <class S> struct MatDet<S, 2>
{
IL S operator()(const S *src)
{
return 1 / (src[0] * src[3] - src[2] * src[1]);
}
};
template <class S> struct MatInv<S, 1>
{
IL void operator()(const S *src, S *dst) { dst[0] = 1 / src[0]; }
};
template <class S> struct MatDet<S, 1>
{
IL S operator()(const S *src) { return src[0]; }
};
}
// Square Mat ------------------------------------------------------------------
//~~~~~~~~~~~~~~~~~~~~~~~~~
#define DEF_SQ_MAT_COMMON(R) \
\
template <class T> \
IL Mat(const T &t) { tMatUtil::InitMat<R, R>(_, t); } \
\
IL Mat(const Mat &m) { F(j, R*R) _[j] = m._[j]; } \
\
IL S & operator()(U row, U col) { return _[col * R + row]; } \
IL S operator()(U row, U col) const { return _[col * R + row]; } \
\
IL operator S * () { return _; } \
IL operator const S * () const { return _; } \
\
S _[R*R];
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define DEF_SQ_MAT_BLOCK_COMMON(R) \
\
DEF_MAT_BLOCK_COMMON(R, R) \
\
template <class T, class M, bool IR, bool IV> \
IL tMatBlock & operator *= (const tMatBase<T, R, R, M, IR, IV> &m) \
{ Mat<S, R> c(*this); F(j, R) F(i, R) F(x, R) MI(i,j) += c(i,x) * m(x,j); \
return *this; } \
\
template <class T> \
IL tMatBlock & operator *= (const tMatSingle<T, R, R, true> &m) \
{ return *this; }
template <class S, class Derived, U R> struct tSqMatBase:
public tMatBase<S, R, R, tSqMatBase<S, Derived, R>, R==1, R==1>
{
DEF_MI;
/// Transposes the matrix or block in place
IL tSqMatBase & transpose()
{
Mat<S, R, R> n(*this);
F(i,R) F(j,R) MI(i,j) = n(j,i);
return *this;
}
};
template <class S, class Derived, U R> struct tInvertibleSqMatBlock:
public tSqMatBase<S, tInvertibleSqMatBlock<S, Derived, R>, R>
{
DEF_MI;
/// Invert in place
IL tInvertibleSqMatBlock & invert()
{
S src[R*R], dst[R*R];
F(j, R) F(i, R) src[j*R+i] = MI(i,j);
tMatUtil::MatInv<S, R>()(src, dst);
F(j, R) F(i, R) MI(i,j) = dst[j*R+i];
return *this;
}
/// Returns the inverse
IL Mat<S, R> inverse() const
{
Mat<S, R> m;
S src[R*R]; S *dst = m;
F(j, R) F(i, R) src[j*R+i] = MI(i,j);
tMatUtil::MatInv<S, R>()(src, dst);
return m;
}
/// Returns the determinant
IL S determinant() const
{
S src[R*R];
F(j, R) F(i, R) src[j*R+i] = MI(i,j);
return tMatUtil::MatDet<S, R>()(src);
}
};
template <class S, class Derived, U R> struct tInvertibleSqMat:
public tSqMatBase<S, tInvertibleSqMat<S, Derived, R>, R>
{
DEF_MI;
/// Invert in place
IL tInvertibleSqMat & invert()
{
Mat<S, R> c(*this);
S *dst = & MI(0,0), *src = c;
tMatUtil::MatInv<S, R>()(src, dst);
return *this;
}
/// Returns the inverse
IL Mat<S, R> inverse() const
{
Mat<S, R> m;
S src[R*R]; S *dst = m;
F(j, R) F(i, R) src[j*R+i] = MI(i,j);
tMatUtil::MatInv<S, R>()(src, dst);
return m;
}
/// Returns the determinant
IL S determinant() const
{
const S *src = & MI(0,0);
return tMatUtil::MatDet<S, R>()(src);
}
};
template <class S, U NumRows> struct Mat <S, NumRows, NumRows>:
public tSqMatBase<S, Mat<S, NumRows, NumRows>, NumRows>
{
/// Constructs a matrix with the diagonal = s
IL Mat(S s = 0)
{
enum { R = NumRows, RR = R*R };
F(j, RR) _[j] = 0;
F(j, R) _[j*R+j] = s;
}
DEF_SQ_MAT_COMMON(NumRows);
};
template <class S, class Derived, U MR, U MC, U R>
struct tMatBlock<S, Derived, MR, MC, R, R>:
public tSqMatBase<S, tMatBlock<S, Derived, MR, MC, R, R>, R>
{
DEF_SQ_MAT_BLOCK_COMMON(R);
IL tMatBlock(Derived &d, U r, U c): _d(d), _r(r), _c(c) {}
};
// Mat4x4 ----------------------------------------------------------------------
template <class S, class Derived, U MR, U MC>
struct tMatBlock<S, Derived, MR, MC, 4, 4>:
public tInvertibleSqMatBlock<S, tMatBlock<S, Derived, MR, MC, 4, 4>, 4>
{
DEF_SQ_MAT_BLOCK_COMMON(4);
IL tMatBlock(Derived &_d, U _r, U _c): _d(_d), _r(_r), _c(_c) {}
};
template <class S> struct Mat<S, 4, 4>:
public tInvertibleSqMat<S, Mat<S, 4, 4>, 4>
{
IL Mat(S m00, S m01, S m02, S m03,
S m10, S m11, S m12, S m13,
S m20, S m21, S m22, S m23,
S m30, S m31, S m32, S m33,
bool rowWise = true)
{
if (rowWise) {
_[0] = m00; _[4] = m01; _[8] = m02; _[12] = m03;
_[1] = m10; _[5] = m11; _[9] = m12; _[13] = m13;
_[2] = m20; _[6] = m21; _[10] = m22; _[14] = m23;
_[3] = m30; _[7] = m31; _[11] = m32; _[15] = m33;
} else {
_[0] = m00; _[4] = m10; _[8] = m20; _[12] = m30;
_[1] = m01; _[5] = m11; _[9] = m21; _[13] = m31;
_[2] = m02; _[6] = m12; _[10] = m22; _[14] = m32;
_[3] = m03; _[7] = m13; _[11] = m23; _[15] = m33;
}
}
template <class V0, class V1, class V2, class V3>
IL Mat(const tVec4Base<S, V0, 4, 1> &v0,
const tVec4Base<S, V1, 4, 1> &v1,
const tVec4Base<S, V2, 4, 1> &v2,
const tVec4Base<S, V3, 4, 1> &v3) // by columns
{
_[0] = v0(0,0); _[4] = v1(0,0); _[8] = v2(0,0); _[12] = v3(0,0);
_[1] = v0(1,0); _[5] = v1(1,0); _[9] = v2(1,0); _[13] = v3(1,0);
_[2] = v0(2,0); _[6] = v1(2,0); _[10] = v2(2,0); _[14] = v3(2,0);
_[3] = v0(3,0); _[7] = v1(3,0); _[11] = v2(3,0); _[15] = v3(3,0);
}
template <class V0, class V1, class V2, class V3>
IL Mat(const tVec4Base<S, V0, 1, 4> &v0,
const tVec4Base<S, V1, 1, 4> &v1,
const tVec4Base<S, V2, 1, 4> &v2,
const tVec4Base<S, V3, 1, 4> &v3) // by rows
{
_[0] = v0(0,0); _[4] = v0(0,1); _[8] = v0(0,2); _[12] = v0(0,3);
_[1] = v1(0,0); _[5] = v1(0,1); _[9] = v1(0,2); _[13] = v1(0,3);
_[2] = v2(0,0); _[6] = v2(0,1); _[10] = v2(0,2); _[14] = v2(0,3);
_[3] = v3(0,0); _[7] = v3(0,1); _[11] = v3(0,2); _[15] = v3(0,3);
}
/// Constructs a matrix with the diagonal = s
IL Mat(S s = 0) { F(j, 4*4) _[j] = 0; F(j, 4) _[j*4+j] = s; }
DEF_SQ_MAT_COMMON(4);
};
// Mat3x3 ----------------------------------------------------------------------
template <class S, class Derived, U MR, U MC>
struct tMatBlock<S, Derived, MR, MC, 3, 3>:
public tInvertibleSqMatBlock<S, tMatBlock<S, Derived, MR, MC, 3, 3>, 3>
{
DEF_SQ_MAT_BLOCK_COMMON(3);
IL tMatBlock(Derived &_d, U _r, U _c): _d(_d), _r(_r), _c(_c) {}
};
template <class S> struct Mat<S, 3, 3>:
public tInvertibleSqMat<S, Mat<S, 3, 3>, 3>
{
IL Mat(S m00, S m01, S m02,
S m10, S m11, S m12,
S m20, S m21, S m22,
bool rowWise = true)
{
if (rowWise) {
_[0] = m00; _[3] = m01; _[6] = m02;
_[1] = m10; _[4] = m11; _[7] = m12;
_[2] = m20; _[5] = m21; _[8] = m22;
} else {
_[0] = m00; _[3] = m10; _[6] = m20;
_[1] = m01; _[4] = m11; _[7] = m21;
_[2] = m02; _[5] = m12; _[8] = m22;
}
}
/// Constructs a matrix with the diagonal = s
IL Mat(S s = 0) { F(j, 3*3) _[j] = 0; F(j, 3) _[j*3+j] = s; }
DEF_SQ_MAT_COMMON(3);
};
// Mat2x2 ----------------------------------------------------------------------
template <class S, class Derived, U MR, U MC>
struct tMatBlock<S, Derived, MR, MC, 2, 2>:
public tInvertibleSqMatBlock<S, tMatBlock<S, Derived, MR, MC, 2, 2>, 2>
{
DEF_SQ_MAT_BLOCK_COMMON(2);
IL tMatBlock(Derived &_d, U _r, U _c): _d(_d), _r(_r), _c(_c) {}
};
template <class S> struct Mat<S, 2, 2>:
public tInvertibleSqMat<S, Mat<S, 2, 2>, 2>
{
IL Mat(S m00, S m01,
S m10, S m11,
bool rowWise = true)
{
if (rowWise) {
_[0] = m00; _[2] = m01;
_[1] = m10; _[3] = m11;
} else {
_[0] = m00; _[2] = m10;
_[1] = m01; _[3] = m11;
}
}
/// Constructs a matrix with the diagonal = s
IL Mat(S s = 0) { F(j, 2*2) _[j] = 0; F(j, 2) _[j*2+j] = s; }
DEF_SQ_MAT_COMMON(2);
};
// The single vector or matrix -------------------------------------------------
#define DEF_VEC \
IL S & operator()(U row, U col) { return _; } \
IL S operator()(U row, U col) const { return _; } \
IL operator S & () { return _; } \
IL operator const S & () const { return _; } \
IL operator S * () { return &_; } \
IL operator const S * () const { return &_; }
template <class S> struct Vec<S, 1>:
public tInvertibleSqMat<S, Vec<S, 1>, 1>
{
S _;
IL Vec(S s = 0): _(s) {};
template <class V> Vec(const V &v) { tMatUtil::InitSingle(_, v); };
DEF_VEC;
};
template <class S, class Derived, U MR, U MC>
struct tMatBlock<S, Derived, MR, MC, 1, 1>:
public tMatBase<S, 1, 1, tMatBlock<S, Derived, MR, MC, 1, 1>, true, true>
{
DEF_SQ_MAT_BLOCK_COMMON(1);
IL tMatBlock(Derived &_d, U _r, U _c): _d(_d), _r(_r), _c(_c) {}
};
template <class S> struct Mat<S, 1, 1>:
public tInvertibleSqMat<S, Vec<S, 1>, 1>
{
S _;
IL Mat(S s = 0): _(s) {};
template <class V> Mat(const V &v) { tMatUtil::InitSingle(_, v); }
DEF_VEC;
};
// Utility ----------------------------------------------------------------------
/// Rotates a 2x2 transform matrix counter-clockwise.
template <class S, class M, class A>
IL Mat<S, 2> rotate(const tMatBase<S, 2, 2, M, false, false> &m, A radians)
{
const S c = cos(radians), s = sin(radians);
return Mat<S, 2>(c, -s, s, c) * m;
}
/// Rotates a 3x3 transform matrix counter-clockwise about the Y axis.
template <class S, class M, class A>
IL Mat<S, 3> rotateY(const tMatBase<S, 3, 3, M, false, false> &m, A radians)
{
const S c = cos(radians), s = sin(radians);
return Mat<S, 3>(c, 0, s,
0, 1, 0,
-s, 0, c) * m;
}
/// Rotates a 3x3 transform matrix counter-clockwise about the Z axis.
template <class S, class M, class A>
IL Mat<S, 3> rotateZ(const tMatBase<S, 3, 3, M, false, false> &m, A radians)
{
const S c = cos(radians), s = sin(radians);
return Mat<S, 3>(c, -s, 0,
s, c, 0,
0, 0, 1) * m;
}
/// Rotates a 3x3 transform matrix counter-clockwise about the specified axis.
template <class S, class M, class A, class T, class V, U R, U C>
IL Mat<S, 3> rotate(const tMatBase<S, 3, 3, M, false, false> &m, A radians,
const tVec3Base<T, V, R, C> &axis)
{
const Vec<S, 3> a = axis.normalized();
const S c = cos(radians), s = sin(radians), d = 1 - c;
const S &x = a[0], &y = a[1], &z = a[2];
return Mat<S, 3>(x*x*d + c, y*x*d - z*s, z*x*d + y*s,
x*y*d + z*s, y*y*d + c, z*y*d - x*s,
x*z*d - y*s, y*z*d + x*s, z*z*d + c) * m;
}
/// Scales a 3x3 transform matrix.
template <class S, class M, class T, class V, U R, U C>
IL Mat<S, 3> scale(const tMatBase<S, 3, 3, M, false, false> &m,
const tVec3Base<T, V, R, C> &s)
{
return Mat<S, 3>(s[0], 0, 0, 0,
0, s[1], 0, 0,
0, 0, s[2], 0,
0, 0, 0, 1) * m;
}
/// Rotates a 4x4 transform matrix counter-clockwise about the X axis.
template <class S, class M, class A>
IL Mat<S, 4> rotateX(const tMatBase<S, 4, 4, M, false, false> &m, A radians)
{
const S c = cos(radians), s = sin(radians);
return Mat<S, 4>(1, 0, 0, 0,
0, c, -s, 0,
0, s, c, 0,
0, 0, 0, 1) * m;
}
/// Rotates a 4x4 transform matrix counter-clockwise about the Y axis.
template <class S, class M, class A>
IL Mat<S, 4> rotateY(const tMatBase<S, 4, 4, M, false, false> &m, A radians)
{
const S c = cos(radians), s = sin(radians);
return Mat<S, 4>(c, 0, s, 0,
0, 1, 0, 0,
-s, 0, c, 0,
0, 0, 0, 1) * m;
}
/// Rotates a 4x4 transform matrix counter-clockwise about the Z axis.
template <class S, class M, class A>
IL Mat<S, 4> rotateZ(const tMatBase<S, 4, 4, M, false, false> &m, A radians)
{
const S c = cos(radians), s = sin(radians);
return Mat<S, 4>(c, -s, 0, 0,
s, c, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1) * m;
}
/// Rotates a 4x4 transform matrix counter-clockwise about the specified axis.
template <class S, class M, class A, class T, class V, U R, U C>
IL Mat<S, 4> rotate(const tMatBase<S, 4, 4, M, false, false> &m,
A radians,
const tVec3Base<T, V, R, C> &axis)
{
const Vec<S, 3> a = axis.normalized();
const S c = cos(radians), s = sin(radians), d = 1 - c;
const S &x = a[0], &y = a[1], &z = a[2];
return Mat<S, 4>(x*x*d + c, y*x*d - z*s, z*x*d + y*s, 0,
x*y*d + z*s, y*y*d + c, z*y*d - x*s, 0,
x*z*d - y*s, y*z*d + x*s, z*z*d + c, 0,
0, 0, 0, 1) * m;
}
/// Translates a 4x4 transform matrix.
template <class S, class M, class T, class V, U R, U C>
IL Mat<S, 4> translate(const tMatBase<S, 4, 4, M, false, false> &m,
const tVec3Base<T, V, R, C> &v)
{
return Mat<S, 4>(1, 0, 0, v[0],
0, 1, 0, v[1],
0, 0, 1, v[2],
0, 0, 0, 1) * m;
}
/// Scales a 4x4 transform matrix.
template <class S, class M, class T, class V, U R, U C>
IL Mat<S, 4> scale(const tMatBase<S, 4, 4, M, false, false> &m,
const tVec3Base<T, V, R, C> &s)
{
return Mat<S, 4>(s[0], 0, 0, 0,
0, s[1], 0, 0,
0, 0, s[2], 0,
0, 0, 0, 1) * m;
}
/// Constructs a look-at view matrix.
template <class S,
class V0, U R0, U C0,
class V1, U R1, U C1,
class V2, U R2, U C2>
IL Mat<S, 4> lookAt(const tVec3Base<S, V0, R0, C0> &eye,
const tVec3Base<S, V1, R1, C1> ¢er,
const tVec3Base<S, V2, R2, C2> &up)
{
const Vec<S, 3> z = (eye - center).normalized();
const Vec<S, 3> y = up;
const Vec<S, 3> x = y.cross(z);
return Mat<S, 4>(x[0], x[1], x[2], -x.dot(eye),
y[0], y[1], y[2], -y.dot(eye),
z[0], z[1], z[2], -z.dot(eye),
0, 0, 0, 1);
}
/// Constructs a orthographic view matrix.
template <class S>
IL Mat<S, 4> ortho(S width, S height, S zNear, S zFar,
bool directX = false)
{
S n = zNear, f = zFar, nf = n - f;
bool d = directX;
return Mat<S, 4>(2 / width, 0, 0, -1,
0, 2 / height, 0, -1,
0, 0, (d ? 1 : 2) / nf, (n + (d ? 0 : f)) / nf,
0, 0, 0, 1);
}
/// Constructs a orthographic view matrix.
template <class S>
IL Mat<S, 4> ortho(S left, S right, S bottom, S top, S zNear, S zFar,
bool directX = false)
{
S l = left, r = right, b = bottom, t = top, n = zNear, f = zFar;
bool d = directX;
return Mat<S, 4>(2 / (r - l), 0, 0, (l + r) / (l - r),
0, 2 / (t - b), 0, (t + b) / (b - t),
0, 0, (d ? 1 : 2) / (n - f), (n + (d ? 0 : f)) / (n - f),
0, 0, 0, 1);
}
/// Constructs a perspective view matrix.
template <class S>
IL Mat<S, 4> perspective(S left, S right, S bottom, S top, S zNear, S zFar,
bool directX = false)
{
S l = left, r = right, b = bottom, t = top, n = zNear, f = zFar,
rl = r - l, tb = t - b, nf = n - f;
bool d = directX;
return Mat<S, 4>((2 * n) / rl, 0, (r + l) / rl, 0,
0, (2 * n) / tb, (t + b) / tb, 0,
0, 0, ((d ? 0 : n) + f) / nf, ((d ? 1 : 2) * n * f) / nf,
0, 0, -1, 0);
}
/// Constructs a perspective view matrix.
template <class S>
IL Mat<S, 4> perspective(S fovYRadians, S aspect, S zNear, S zFar,
bool directX = false)
{
S n = zNear, f = zFar, ys = 1 / tanf(0.5 * fovYRadians), nf = n - f;
bool d = directX;
return Mat<S, 4>(ys / aspect, 0, 0, 0,
0, ys, 0, 0,
0, 0, ((d ? 0 : n) + f) / nf, ((d ? 1 : 2) * n * f) / nf,
0, 0, -1, 0);
}
/// Constructs a perspective view matrix.
template <class S>
IL Mat<S, 4> infinitePerspective(S left, S right, S bottom, S top, S zNear,
bool directX = false)
{
S rl = right - left, tb = top - bottom;
return Mat<S, 4>((2 * zNear) / rl, 0, (right + left) / rl, 0,
0, (2 * zNear) / tb, (top + bottom) / tb, 0,
0, 0, -1, (directX ? -zNear : -2 * zNear),
0, 0, -1, 0);
}
#undef min
#undef max
/// Returns a matrix with the component wise minimums
template <class S, U R, U C,
class D0, class D1, bool IR0, bool IR1, bool IV0, bool IV1>
IL Mat<S, R, C> min(const tMatBase<S, R, C, D0, IR0, IV0> &n,
const tMatBase<S, R, C, D1, IR1, IV1> &m)
{ Mat<S, R, C> r; F(j, C) F(i, R) r(i,j) = n(i,j) < m(i,j) ? n(i,j) : m(i,j);
return r; }
/// Returns a matrix with the component wise minimums
template <class S, U R, U C, class D, bool IR, bool IV, class T>
IL typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value, Mat<S, R, C> >::type
min(const tMatBase<S, R, C, D, IR, IV> &m, const T &t)
{ Mat<S, R, C> r; F(j, C) F(i, R) r(i,j) = m(i,j) < t ? m(i,j) : t; return r; }
/// Returns a matrix with the component wise minimums
template <class S, U R, U C, class D, bool IR, bool IV, class T>
IL typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value, Mat<S, R, C> >::type
min(const T &t, const tMatBase<S, R, C, D, IR, IV> &m)
{ Mat<S, R, C> r; F(j, C) F(i, R) r(i,j) = t < m(i,j) ? t : m(i,j); return r; }
/// Returns a matrix with the component wise maximums
template <class S, U R, U C,
class D0, class D1, bool IR0, bool IR1, bool IV0, bool IV1>
IL Mat<S, R, C> max(const tMatBase<S, R, C, D0, IR0, IV0> &n,
const tMatBase<S, R, C, D1, IR1, IV1> &m)
{ Mat<S, R, C> r; F(j, C) F(i, R) r(i,j) = n(i,j) > m(i,j) ? n(i,j) : m(i,j);
return r; }
/// Returns a matrix with the component wise maximums
template <class S, U R, U C, class D, bool IR, bool IV, class T>
IL typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value, Mat<S, R, C> >::type
max(const tMatBase<S, R, C, D, IR, IV> &m, const T &t)
{ Mat<S, R, C> r; F(j, C) F(i, R) r(i,j) = m(i,j) > t ? m(i,j) : t; return r; }
/// Returns a matrix with the component wise maximums
template <class S, U R, U C, class D, bool IR, bool IV, class T>
IL typename tMatUtil::EnableIf<tMatUtil::IsAri<T>::value, Mat<S, R, C> >::type
max(const T &t, const tMatBase<S, R, C, D, IR, IV> &m)
{ Mat<S, R, C> r; F(j, C) F(i, R) r(i,j) = t > m(i,j) ? t : m(i,j); return r; }
// End -------------------------------------------------------------------------
#undef DEF_MAT_BLOCK_E_WISE_OP_EQ_TILDA
#undef DEF_MAT_BLOCK_E_WISE_OP_EQ_SCALAR
#undef DEF_MAT_BLOCK_E_WISE_OP_EQ
#undef DEF_MAT_BLOCK_COMMON
#undef DEF_VEC_COMMON
#undef DEF_SQ_MAT_COMMON
#undef DEF_SQ_MAT_BLOCK_COMMON
#undef DEF_VEC
#undef LG
#undef DEF_MI
#undef VI
#undef MI
#undef F
#undef IL
#undef U
#define DEF_NAMESPACE };
DEF_NAMESPACE
#undef DEF_NAMESPACE
#pragma pop_macro("DI")
#pragma pop_macro("DEF_SQ_MAT_BLOCK_COMMON")
#pragma pop_macro("DEF_MAT_SINGLE_OP")
#pragma pop_macro("DEF_SIMPLE_MAT_MAT_OP")
#pragma pop_macro("DEF_MAT_SINGLE_IDENTITY")
#pragma pop_macro("LG")
#pragma pop_macro("DEF_MAT_BLOCK_COMMON")
#pragma pop_macro("DEF_MAT_SINGLE")
#pragma pop_macro("DEF_MI")
#pragma pop_macro("DEF_VEC")
#pragma pop_macro("DEF_VEC_SINGLE")
#pragma pop_macro("F")
#pragma pop_macro("VI")
#pragma pop_macro("DEF_MAT_BLOCK_E_WISE_OP_EQ_TILDA")
#pragma pop_macro("DEF_VEC_COMMON")
#pragma pop_macro("DEF_VEC_BLOCK")
#pragma pop_macro("DEF_NAMESPACE")
#pragma pop_macro("U")
#pragma pop_macro("IL")
#pragma pop_macro("DEF_SSE_INV")
#pragma pop_macro("SX")
#pragma pop_macro("DEF_MAT_BLOCK_E_WISE_OP_EQ")
#pragma pop_macro("SS")
#pragma pop_macro("DEF_MAT_TILDA_OP")
#pragma pop_macro("MI")
#pragma pop_macro("ST")
#pragma pop_macro("DEF_MAT_SCALAR_OP")
#pragma pop_macro("DEF_IS_ARI")
#pragma pop_macro("SI")
#pragma pop_macro("SM")
#pragma pop_macro("DEF_SQ_MAT_COMMON")
#pragma pop_macro("DEF_MAT_BLOCK_E_WISE_OP_EQ_SCALAR")
#pragma pop_macro("DEF_MAT_SINGLE_OP_SCALAR")
#endif
| [
"me@nikhil.sh"
] | me@nikhil.sh |
ae23262f6be105101085c4dd2edc75763c7d1a5d | a9f5f6b6d436eead6dd4864eceae00c8fa478a8f | /CustomerOrder.h | ef0a9ed190a2c8cc83c37418062e0e790475b140 | [] | no_license | ODAVING/BTP305 | 1fd5945b669e85df3f2c88f05cfd661b7232c2b6 | ea8625dfa902f06dcd2befb90d281f6f012fcd67 | refs/heads/master | 2020-04-11T05:36:54.854816 | 2018-03-08T02:58:29 | 2018-03-08T02:58:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,055 | h | //Sina Lahsaee
//129948162
#pragma once
// CustomerOrder Milestone - CustomerOrder Interface
// CustomerOrder.h
// Chris Szalwinski
// v1.0 - 9/11/2015
// v2.0 - 23/02/2016
#include <iostream>
#include <string>
#ifndef _MSC_VER
#define NOEXCEPT noexcept
#else
#define NOEXCEPT
#endif
class Item;
class CustomerItem;
class CustomerOrder {
std::string name; // name of the customer
std::string product; // name of the product
CustomerItem* order; // address of the customer requests
unsigned int nOrders; // number of requests
static size_t field_width; // current maximum field width
public:
CustomerOrder(const std::string&);
CustomerOrder(const CustomerOrder&);
CustomerOrder& operator=(const CustomerOrder&) = delete;
CustomerOrder(CustomerOrder&&) noexcept;
CustomerOrder&& operator=(CustomerOrder&&) noexcept;
~CustomerOrder();
unsigned int noOrders() const;
const std::string& operator[](unsigned int) const;
void fill(Item&);
void remove(Item&);
bool empty() const;
void display(std::ostream&) const;
}; | [
"slahsaee1990@gmail.com"
] | slahsaee1990@gmail.com |
ce5db0b1ba4edb93cee12e39d3337e2dc7a8f443 | b635e59e795fc53b05903de09f4fbe1e1616b652 | /src/unknown_objects.h | aab454bfbf14fb72b1ad1300f23a8cba5c304e70 | [] | no_license | stevevista/qia | d4b0505434e5290462b8bab6cd615570a0b84aa9 | b3201c1187b1b4c109a2d5282d47bfd8654b1952 | refs/heads/master | 2020-04-01T03:22:34.111920 | 2018-10-20T02:03:20 | 2018-10-20T02:03:20 | 152,819,380 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,321 | h | #pragma once
#include <SDKDDKVer.h>
// Windows Header Files:
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#include <windows.h>
#include <ole2.h>
#include <ocidl.h>
// STD headers
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <map>
#include <memory>
#include <initializer_list>
// Node JS headers
#include <v8.h>
#include <node.h>
#include <node_version.h>
#include <node_object_wrap.h>
#include <node_buffer.h>
using namespace v8;
using namespace node;
#include <nan.h>
#include <uv.h>
class CComVariant : public VARIANT {
public:
inline CComVariant() {
memset((VARIANT*)this, 0, sizeof(VARIANT));
}
inline CComVariant(const CComVariant &src) {
memset((VARIANT*)this, 0, sizeof(VARIANT));
VariantCopyInd(this, &src);
}
inline CComVariant(const VARIANT &src) {
memset((VARIANT*)this, 0, sizeof(VARIANT));
VariantCopyInd(this, &src);
}
inline CComVariant(LONG v) {
memset((VARIANT*)this, 0, sizeof(VARIANT));
vt = VT_I4;
lVal = v;
}
inline CComVariant(LPOLESTR v) {
memset((VARIANT*)this, 0, sizeof(VARIANT));
vt = VT_BSTR;
bstrVal = SysAllocString(v);
}
inline ~CComVariant() {
Clear();
}
inline void Clear() {
if (vt != VT_EMPTY)
VariantClear(this);
}
inline void Detach(VARIANT *dst) {
*dst = *this;
vt = VT_EMPTY;
}
inline HRESULT CopyTo(VARIANT *dst) {
return VariantCopy(dst, this);
}
inline HRESULT ChangeType(VARTYPE vtNew, const VARIANT* pSrc = NULL) {
return VariantChangeType(this, pSrc ? pSrc : this, 0, vtNew);
}
inline ULONG ArrayLength() {
if ((vt & VT_ARRAY) == 0) return 0;
SAFEARRAY *varr = (vt & VT_BYREF) != 0 ? *pparray : parray;
return varr ? varr->rgsabound[0].cElements : 0;
}
inline HRESULT ArrayGet(LONG index, CComVariant &var) {
if ((vt & VT_ARRAY) == 0) return E_NOTIMPL;
SAFEARRAY *varr = (vt & VT_BYREF) != 0 ? *pparray : parray;
if (!varr) return E_FAIL;
index += varr->rgsabound[0].lLbound;
VARTYPE vart = vt & VT_TYPEMASK;
HRESULT hr = SafeArrayGetElement(varr, &index, (vart == VT_VARIANT) ? (void*)&var : (void*)&var.byref);
if (SUCCEEDED(hr) && vart != VT_VARIANT) var.vt = vart;
return hr;
}
template<typename T>
inline T* ArrayGet(ULONG index = 0) {
return ((T*)parray->pvData) + index;
}
inline HRESULT ArrayCreate(VARTYPE avt, ULONG cnt) {
Clear();
parray = SafeArrayCreateVector(avt, 0, cnt);
if (!parray) return E_UNEXPECTED;
vt = VT_ARRAY | avt;
return S_OK;
}
inline HRESULT ArrayResize(ULONG cnt) {
SAFEARRAYBOUND bnds = { cnt, 0 };
return SafeArrayRedim(parray, &bnds);
}
};
class CComBSTR {
public:
BSTR p;
inline CComBSTR() : p(0) {}
inline CComBSTR(const CComBSTR &src) : p(0) {}
inline ~CComBSTR() { Free(); }
inline void Attach(BSTR _p) { Free(); p = _p; }
inline BSTR Detach() { BSTR pp = p; p = 0; return pp; }
inline void Free() { if (p) { SysFreeString(p); p = 0; } }
inline operator BSTR () const { return p; }
inline BSTR* operator&() { return &p; }
inline bool operator!() const { return (p == 0); }
inline bool operator!=(BSTR _p) const { return !operator==(_p); }
inline bool operator==(BSTR _p) const { return p == _p; }
inline BSTR operator = (BSTR _p) {
if (p != _p) Attach(_p ? SysAllocString(_p) : 0);
return p;
}
};
class CComException: public EXCEPINFO {
public:
inline CComException() {
memset((EXCEPINFO*)this, 0, sizeof(EXCEPINFO));
}
inline ~CComException() {
Clear(true);
}
inline void Clear(bool internal = false) {
if (bstrSource) SysFreeString(bstrSource);
if (bstrDescription) SysFreeString(bstrDescription);
if (bstrHelpFile) SysFreeString(bstrHelpFile);
if (!internal) memset((EXCEPINFO*)this, 0, sizeof(EXCEPINFO));
}
};
template <typename T = IUnknown>
class CComPtr {
public:
T *p;
inline CComPtr() : p(0) {}
inline CComPtr(T *_p) : p(0) { Attach(_p); }
inline CComPtr(const CComPtr<T> &ptr) : p(0) { if (ptr.p) Attach(ptr.p); }
inline ~CComPtr() { Release(); }
inline void Attach(T *_p) { Release(); p = _p; if (p) p->AddRef(); }
inline T *Detach() { T *pp = p; p = 0; return pp; }
inline void Release() { if (p) { p->Release(); p = 0; } }
inline operator T*() const { return p; }
inline T* operator->() const { return p; }
inline T& operator*() const { return *p; }
inline T** operator&() { return &p; }
inline bool operator!() const { return (p == 0); }
inline bool operator!=(T* _p) const { return !operator==(_p); }
inline bool operator==(T* _p) const { return p == _p; }
inline T* operator = (T* _p) {
if (p != _p) Attach(_p);
return p;
}
inline HRESULT CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter = NULL, DWORD dwClsContext = CLSCTX_ALL) {
Release();
return ::CoCreateInstance(rclsid, pUnkOuter, dwClsContext, __uuidof(T), (void**)&p);
}
inline HRESULT CoCreateInstance(LPCOLESTR szProgID, LPUNKNOWN pUnkOuter = NULL, DWORD dwClsContext = CLSCTX_ALL) {
Release();
CLSID clsid;
HRESULT hr = CLSIDFromProgID(szProgID, &clsid);
if FAILED(hr) return hr;
return ::CoCreateInstance(clsid, pUnkOuter, dwClsContext, __uuidof(T), (void**)&p);
}
};
//-------------------------------------------------------------------------------------------------------
template<typename IBASE = IUnknown>
class UnknownImpl : public IBASE {
public:
inline UnknownImpl() : refcnt(0) {}
virtual ~UnknownImpl() {}
// IUnknown interface
virtual HRESULT __stdcall QueryInterface(REFIID qiid, void **ppvObject) {
if ((qiid == IID_IUnknown) || (qiid == __uuidof(IBASE))) {
*ppvObject = this;
AddRef();
return S_OK;
}
return E_NOINTERFACE;
}
virtual ULONG __stdcall AddRef() {
return InterlockedIncrement(&refcnt);
}
virtual ULONG __stdcall Release() {
if (InterlockedDecrement(&refcnt) != 0) return refcnt;
delete this;
return 0;
}
protected:
LONG refcnt;
};
class DispArrayImpl : public UnknownImpl<IDispatch> {
public:
CComVariant var;
DispArrayImpl(const VARIANT &v): var(v) {}
// IDispatch interface
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo) { *pctinfo = 0; return S_OK; }
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { return E_NOTIMPL; }
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
};
class DispEnumImpl : public UnknownImpl<IDispatch> {
public:
CComPtr<IEnumVARIANT> ptr;
DispEnumImpl() {}
DispEnumImpl(IEnumVARIANT *p) : ptr(p) {}
// IDispatch interface
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo) { *pctinfo = 0; return S_OK; }
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { return E_NOTIMPL; }
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
};
// {9DCE8520-2EFE-48C0-A0DC-951B291872C0}
extern const GUID CLSID_DispObjectImpl;
class DispObjectImpl : public UnknownImpl<IDispatch> {
public:
Persistent<Object> obj;
struct name_t {
DISPID dispid;
std::wstring name;
inline name_t(DISPID id, const std::wstring &nm): dispid(id), name(nm) {}
};
typedef std::shared_ptr<name_t> name_ptr;
typedef std::map<std::wstring, name_ptr> names_t;
typedef std::map<DISPID, name_ptr> index_t;
DISPID dispid_next;
names_t names;
index_t index;
inline DispObjectImpl(const Local<Object> &_obj) : obj(Isolate::GetCurrent(), _obj), dispid_next(1) {}
virtual ~DispObjectImpl() { obj.Reset(); }
// IUnknown interface
virtual HRESULT __stdcall QueryInterface(REFIID qiid, void **ppvObject) {
if (qiid == CLSID_DispObjectImpl) { *ppvObject = this; AddRef(); return S_OK; }
return UnknownImpl<IDispatch>::QueryInterface(qiid, ppvObject);
}
// IDispatch interface
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo) { *pctinfo = 0; return S_OK; }
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { return E_NOTIMPL; }
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
};
| [
"stevevista@gmail.com"
] | stevevista@gmail.com |
40626ef49c059eb1e65aa49e550702b984777a58 | b2e5311f2aa0608a7da6d9a7a9f6b7e8f900f2d6 | /InteractiveMandelbrot/Includes.h | 66e69649adf53f389e41882e6730ed06624102ce | [] | no_license | Shorte240/DSaA-Submission | 9653401bbd7323fc9cd58cb8f0a85672e744b9ed | f018185c4142fded96127f141ed42f5f83a8aa6f | refs/heads/master | 2020-03-11T16:49:29.830135 | 2018-04-28T10:49:04 | 2018-04-28T10:49:04 | 130,129,151 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 904 | h | #pragma once
// Include glut, opengl libraries and custom classes
#include "glut.h"
#include <gl/GL.h>
#include <gl/GLU.h>
#include "Input.h"
#include <stdio.h>
// Further includes should go here:
#include "SOIL.h"
#include <vector>
// Mandelbrot specific includes
#include <chrono>
#include <iostream>
#include <iomanip>
#include <amp.h>
#include <time.h>
#include <string>
#include <fstream>
#include <array>
// Need to access the concurrency libraries
using namespace concurrency;
// Import things we need from the standard library
using std::chrono::duration_cast;
using std::chrono::milliseconds;
using std::vector;
using std::cout;
using std::endl;
using std::ofstream;
using std::thread;
using namespace concurrency;
// Define the alias "the_clock" for the clock type we're going to use.
typedef std::chrono::steady_clock the_serial_clock;
typedef std::chrono::steady_clock the_amp_clock;
| [
"fraserbarker@hotmail.com"
] | fraserbarker@hotmail.com |
798979b1759a5ef34814fbf6895c3704c0041e89 | 52e2ef423ca1a8d57c32e4aa79466b710c2691c6 | /LimbEscape/Sources/jeu.cpp | 3c97f012c6d9098994358fd8ce5113c4b4fba9b1 | [] | no_license | jimoniak/LimbStudio | bfdd09bc1277383f56e36edfb1a911eb84013d17 | 2d35d06e05832e775bc9af8f639f36f2b7dbc2e4 | refs/heads/master | 2021-01-02T09:27:20.878423 | 2015-01-27T07:59:00 | 2015-01-27T07:59:24 | 29,106,019 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 35,188 | cpp | /*
LimbEscape,
Crée par Jimmy PEAULT sous le nom de LimbStudio
Jeu sokoban en 2d isometrique
utilisant la technologie de la SFML 2.1.
LimbEscape de Limb'Studio est mis à disposition selon les termes de la licence Creative Commons Attribution - Pas d’Utilisation Commerciale 4.0 International.
Les autorisations au-delà du champ de cette licence peuvent être obtenues à mail.limbStudio@gmail.com.
depot officiel : https://github.com/jimoniak/LimbStudio
*/
#include <SFML/Graphics.hpp>
#include "Randomizer.hpp"
#include <math.h>
#include <vector>
#include "constantes.h"
#include <iostream>
#include <fstream>
#include <string>
#include <ios>
#include "outils.hpp"
#include "element.hpp"
#include "carte.hpp"
#include "gestionSouris.hpp"
#include "joueur.hpp"
#include "jeu.hpp"
#include "vignette.hpp"
using namespace sf;
using namespace std;
Jeu::Jeu() :fenetrePrincipale(sf::VideoMode(LFENETRE, HFENETRE), "LimbEscape"),
view1(Vector2f(0,HFENETRE / 2),Vector2f(LFENETRE,HFENETRE)),
gestionSouris(&fenetrePrincipale)
{
view1.zoom(1.2);
if (!font.loadFromFile("Data/Fonts/upheavtt.ttf")) {
std::cout<<"erreur avec la police upheavtt.ttf"<<std::endl;
}
if(!m_icone.loadFromFile("Data/icone.png")) std::cerr<<"impossible de charger icone.png"<<std::endl;
fenetrePrincipale.setIcon(16,16,m_icone.getPixelsPtr());
fond.setSize(sf::Vector2f(LFENETRE,HFENETRE));
fond.setFillColor(sf::Color(125,125,200));
m_texlimbEscape.loadFromFile("Data/LimbEscape.png");
m_limbEscape.setTexture(m_texlimbEscape);
m_limbEscape.setScale(0.8,0.8);
m_limbEscape.setPosition(LFENETRE / 2 - (m_texlimbEscape.getSize().x/2 * 0.8) , 0);
if(!textBoutonR.loadFromFile("Data/GUI/boutonf.png")) std::cout<<"Erreur avec texture boutonf.png"<<std::endl;
if(!textBoutonV.loadFromFile("Data/GUI/boutond.png")) std::cout<<"Erreur avec texture boutond.png"<<std::endl;
infoSouris.setFont(font);
infoSouris.setString("Souris en position : X: , Y: "); //text info coordonnées souris
infoSouris.setColor(sf::Color::Blue);
infoSouris.setCharacterSize(24);
infoVersion.setFont(font);
infoVersion.setString("Souris en position : X: , Y: "); //text info coordonnées souris
infoVersion.setColor(sf::Color::Blue);
infoVersion.setCharacterSize(20);
infoVersion.setStyle(sf::Text::Bold);
infoVersion.setPosition(0,10);
infoVersion.setString(VERSION);
m_pageMenu=0;
m_ressourceHolder = nullptr;
m_carte = nullptr;
m_joueur = nullptr;
fenetrePrincipale.setVerticalSyncEnabled(true);
m_tabCartes = rechercheFichier("Cartes\\",".map");
m_tabSuites = rechercheFichier("Cartes\\Suites\\",".ste");
m_ptrthis = this;
m_jouerSuite= false;
m_comptSuite = 0;
if (!m_clickbuffer.loadFromFile("Data/Sounds/Clicks/click.wav")) cerr<<"Impossible de charger click.wav"<<endl;
m_click.setBuffer(m_clickbuffer);
if(!m_theme.openFromFile("Data/Sounds/Musics/Main.ogg"))
std::cerr<< "erreur musique!"<<std::endl;
}
Jeu::~Jeu()
{
if(m_carte!=nullptr) delete m_carte;
if(m_ressourceHolder!=nullptr) delete m_ressourceHolder;
if(m_joueur!= nullptr) delete m_joueur;
}
bool Jeu::objectifRempli()
{
m_objectifRestant = m_repereObjectif.size();
Objectif * cast;
for(unsigned i=0; i< m_repereObjectif.size(); i++) {
cast = dynamic_cast<Objectif*>(m_carte->getElementHolder()[m_repereObjectif[i]]);
cast->testEtat();
if(cast->estResolu()) {
m_objectifRestant --;
}
//std::cout<<m_objectifRestant <<"\b" ;
}
if(m_objectifRestant == 0) {
return true;
} else return false;
}
int Jeu::gagner()
{
float tempsEcoule = m_chronometre.getElapsedTime().asSeconds();
std::string s = utils::ConvertionFltString(tempsEcoule);
if(s.size() >5) s.resize(5);
sf::Text temps;
temps.setFont(font);
temps.setCharacterSize(18);
temps.setColor(sf::Color::Blue);
if(tempsEcoule < 60)
{
std::string s = utils::ConvertionFltString(tempsEcoule);
if(s.size() >5) s.resize(5);
temps.setString(L"Terminé en : " + s + " secondes ! ");
}
else
{
int minute = tempsEcoule / 60 ;
float seconde = tempsEcoule - minute* 60 ;
std:: string m;
m = utils::ConvertionFltString(minute);
s=utils::ConvertionFltString(seconde);
if(s.size() >5) s.resize(5);
temps.setString(L"Terminé en : " + m + " minute(s) et " + s + "secondes ! ");
}
temps.setPosition(LFENETRE/2 - temps.getLocalBounds().width / 2 , HFENETRE / 2 - 150);
fenetrePrincipale.setView(fenetrePrincipale.getDefaultView());
lgui::Bouton suite(font,&textBoutonR,&textBoutonV);
suite.setTitre("Suivant");
suite.setTailleTexte(15);
suite.setFenetrelie(fenetrePrincipale);
suite.setPosition(sf::Vector2f(LFENETRE / 2 - ( textBoutonV.getSize().x /2),HFENETRE /2 - textBoutonR.getSize().y / 2 -15));
sf::Event event;
while (fenetrePrincipale.isOpen()) {
while (fenetrePrincipale.pollEvent(event)) {
if (event.type == sf::Event::Closed)
fenetrePrincipale.close();
}
if(m_horlogeEvent.getElapsedTime().asSeconds() > 0.1)
{
if(suite.actionner())
{
m_click.play();
if(m_jouerSuite) {
m_comptSuite++;
if(m_comptSuite<m_suiteCarte.size()){
desallouer();
chargerCarte(m_suiteCarte[m_comptSuite]);
m_chronometre.restart();
return 0;
}
else
{
m_comptSuite =0;
m_jouerSuite = false;
return 1;
}
}
else return 1;
}
}
fenetrePrincipale.clear();
fenetrePrincipale.draw(fond);
fenetrePrincipale.draw(temps);
fenetrePrincipale.draw(m_limbEscape);
suite.afficher();
fenetrePrincipale.display();
}
return 0;
}
void Jeu::menuPrincipal()
{
fenetrePrincipale.setKeyRepeatEnabled(false);
sf::RectangleShape fondCredit;
fondCredit.setFillColor(sf::Color(30,56,65,125));
fondCredit.setSize(sf::Vector2f(LFENETRE / 2,HFENETRE/2));
fondCredit.setPosition(LFENETRE/2 - fondCredit.getSize().x/2,HFENETRE/2 - fondCredit.getSize().y/2);
sf::Text apropos;
std::string version = VERSION;
apropos.setFont(font);
apropos.setCharacterSize(16);
apropos.setColor(sf::Color::White);
apropos.setString(L"Crédit : \n \n \n Limbescape réalisé par Jimmy PEAULT pour LimbStudio \n Limbescape est un projet OpenSource sous Licence: \n CeCILL 2.1 \n\n\n\n" + version);
apropos.setPosition(fondCredit.getPosition().x + fondCredit.getSize().x / 2 - apropos.getGlobalBounds().width / 2 , fondCredit.getPosition().y + fondCredit.getSize().y / 2 - apropos.getGlobalBounds().height / 2);
lgui::Bouton jouer(font,&textBoutonR,&textBoutonV); lgui::Bouton quitter(font,&textBoutonR,&textBoutonV);
jouer.setTitre("Jouer"); quitter.setTitre("Quitter");
jouer.setTailleTexte(15); quitter.setTailleTexte(15);
lgui::Bouton retour(font,&textBoutonR,&textBoutonV);
retour.setTitre("Retour");
retour.setTailleTexte(15);
lgui::Bouton credit(font,&textBoutonR,&textBoutonV);
credit.setTitre("Credit");
credit.setTailleTexte(15);
lgui::Bouton esbrouffe(font,&textBoutonR,&textBoutonV);
esbrouffe.setTitre("Esbrouffe");
esbrouffe.setTailleTexte(15);
lgui::Bouton suite(font,&textBoutonR,&textBoutonV);
suite.setTitre("Suites");
suite.setTailleTexte(15);
lgui::Bouton choisirSuite(font,&textBoutonR,&textBoutonV);
choisirSuite.setTitre("Choisir");
choisirSuite.setTailleTexte(15);
lgui::Bouton classique(font,&textBoutonR,&textBoutonV);
classique.setTitre("Classique");
classique.setTailleTexte(15);
lgui::Bouton charger(font,&textBoutonR,&textBoutonV);
charger.setTitre("Choisir");
charger.setTailleTexte(15);
lgui::Bouton aleatoire(font,&textBoutonR,&textBoutonV);
aleatoire.setTitre("Aleatoire");
aleatoire.setTailleTexte(15);
jouer.setPosition(sf::Vector2f(LFENETRE / 2 - textBoutonV.getSize().x / 2 ,HFENETRE /2 - 50));
esbrouffe.setPosition(sf::Vector2f(LFENETRE / 2 - textBoutonV.getSize().x / 2 ,HFENETRE /2 + 150 ));
suite.setPosition(sf::Vector2f(LFENETRE / 2 - textBoutonV.getSize().x / 2 ,HFENETRE /2 - 50 ));
choisirSuite.setPosition(sf::Vector2f(LFENETRE / 2 - textBoutonV.getSize().x / 2 ,HFENETRE /2 + 150 ));
classique.setPosition(sf::Vector2f(LFENETRE / 2 - textBoutonV.getSize().x / 2 ,HFENETRE /2 - 50 ));
quitter.setPosition(sf::Vector2f(LFENETRE / 2 - textBoutonV.getSize().x /2,HFENETRE /2+150));
charger.setPosition(sf::Vector2f(LFENETRE / 2 - textBoutonV.getSize().x / 2 ,HFENETRE /2 + 150 ));
aleatoire.setPosition(sf::Vector2f(LFENETRE / 2 - textBoutonV.getSize().x /2 ,HFENETRE /2-50));
retour.setPosition(sf::Vector2f(LFENETRE - textBoutonV.getSize().x - 30 ,HFENETRE -100));
credit.setPosition(sf::Vector2f(LFENETRE - textBoutonV.getSize().x - 30 ,HFENETRE -100));
jouer.setFenetrelie(fenetrePrincipale);
esbrouffe.setFenetrelie(fenetrePrincipale);
suite.setFenetrelie(fenetrePrincipale);
choisirSuite.setFenetrelie(fenetrePrincipale);
classique.setFenetrelie(fenetrePrincipale);
charger.setFenetrelie(fenetrePrincipale);
aleatoire.setFenetrelie(fenetrePrincipale);
quitter.setFenetrelie(fenetrePrincipale);
retour.setFenetrelie(fenetrePrincipale);
credit.setFenetrelie(fenetrePrincipale);
sf::Event event;
while (fenetrePrincipale.isOpen()) {
while (fenetrePrincipale.pollEvent(event)) {
if (event.type == sf::Event::Closed)
fenetrePrincipale.close();
}
if(m_horlogeEvent.getElapsedTime().asSeconds() > 0.1) // protection afin d'eviter d'appuyer sur deux boutons qui se superpose sur deux page connexes.
{
switch(m_pageMenu)
{
case 0:
if(jouer.actionner()) {
m_click.play();
m_pageMenu++;
m_horlogeEvent.restart();
}
if(credit.actionner())
{
m_click.play();
m_pageMenu = 4;
m_horlogeEvent.restart();
}
if(quitter.actionner()) {
m_click.play();
return;
}
break;
case 1:
if(esbrouffe.actionner()) {
m_click.play();
m_pageMenu++;
m_horlogeEvent.restart();
}
if(suite.actionner()) {
m_click.play();
m_pageMenu=3;
m_horlogeEvent.restart();
}
if(retour.actionner()) {
m_click.play();
m_pageMenu--;
m_horlogeEvent.restart();
}
break;
case 2:
if(aleatoire.actionner())
{
m_click.play();
int randnb;
string carte;
randnb= Randomizer::Random( 0, m_tabCartes.size()-1); //-1 est une sécurité pour pas sortir du tableau
carte= m_tabCartes[randnb];
carte.resize(carte.size() - 4);// -4 pour retirer le ".map"
chargerCarte(carte);
Jeu::jouer();
m_horlogeEvent.restart();
}
if(charger.actionner())
{
m_click.play();
std::string nom;
//nom = saisieNom.getTexte() ;
nom = menuVignette(m_tabCartes);
if(nom != "errStr" && chargerCarte(nom))
Jeu::jouer();
m_horlogeEvent.restart();
}
if(retour.actionner())
{
m_click.play();
m_pageMenu--;
m_horlogeEvent.restart();
}
break;
case 3:
if(retour.actionner()) {
m_click.play();
m_pageMenu =1;
m_horlogeEvent.restart();
}
if(classique.actionner()) {
m_click.play();
chargerSuite("Default");
Jeu::jouer();
m_horlogeEvent.restart();
}
if(choisirSuite.actionner()) {
m_click.play();
std::string nomSuite;
nomSuite= menuVignette(m_tabSuites);
if(nomSuite != "errStr" && chargerSuite(nomSuite) ) Jeu::jouer();
else std::cout<<"La fonction chargerSuite à retournee errStr"<<std::endl;
m_horlogeEvent.restart();
}
break;
case 4:
if(retour.actionner()) {
m_click.play();
m_pageMenu =0;
m_horlogeEvent.restart();
}
break;
}
}
fenetrePrincipale.setView(fenetrePrincipale.getDefaultView());//Changement de vue pour dessiner l'interface.
fenetrePrincipale.clear();
fenetrePrincipale.draw(fond);
fenetrePrincipale.draw(m_limbEscape);
if(m_pageMenu==0)
{
jouer.afficher();//
quitter.afficher();//
credit.afficher();
}
if(m_pageMenu==1)
{
esbrouffe.afficher();//
suite.afficher();
retour.afficher();
}
else if(m_pageMenu == 2)
{
aleatoire.afficher();
charger.afficher();
retour.afficher();
}
else if(m_pageMenu == 3)
{
classique.afficher();
choisirSuite.afficher();
retour.afficher();
}
else if(m_pageMenu == 4)
{
fenetrePrincipale.draw(fondCredit);
fenetrePrincipale.draw(apropos);
retour.afficher();
}
fenetrePrincipale.display();
}
}
std::string Jeu::menuVignette(std::vector<std::string> const &liste)
{
sf::RectangleShape fondVignette;
lgui::Bouton pageSuivante(font,&textBoutonR,&textBoutonV);
pageSuivante.setTitre("->");
pageSuivante.setTailleTexte(15);
pageSuivante.setFenetrelie(fenetrePrincipale);
pageSuivante.setPosition(sf::Vector2f(LFENETRE - (textBoutonR.getSize().x + 20),HFENETRE - 0.12 * HFENETRE));
lgui::Bouton pagePrecedente(font,&textBoutonR,&textBoutonV);
pagePrecedente.setTitre("<-");
pagePrecedente.setTailleTexte(15);
pagePrecedente.setFenetrelie(fenetrePrincipale);
pagePrecedente.setPosition(sf::Vector2f( 20,HFENETRE - 0.12 * HFENETRE));
lgui::Bouton retour(font,&textBoutonR,&textBoutonV);
retour.setTitre("Retour");
retour.setTailleTexte(15);
retour.setFenetrelie(fenetrePrincipale);
retour.setPosition(sf::Vector2f( LFENETRE / 2 - textBoutonR.getSize().x /2 , HFENETRE - 0.12 * HFENETRE));
sf::Texture vignette;
vignette.loadFromFile("Data/GUI/vignette.png");
sf::Texture vignetteS;
vignetteS.loadFromFile("Data/GUI/vignetteS.png");
std::vector<Vignette> tabptrVignette;
sf::Vector2f positionVignette;
unsigned int nombreRange = 3;
unsigned int nombreElementRange = 4;
unsigned int nombreElementPage = nombreRange * nombreElementRange ;
unsigned int nbPage = liste.size() / nombreElementPage;
unsigned int pageActuelle = 0;
int offset =( LFENETRE - ((nombreElementRange - 1 ) * (0.2 * LFENETRE) + 50)) / 2 ;
int tailleFondX = (((nombreElementRange - 1 ) * (0.2 * LFENETRE) )) + 90;
int tailleFondY = (((nombreRange - 1)* (0.2*HFENETRE) + 120)) ;
fondVignette.setSize(sf::Vector2f(tailleFondX,tailleFondY));
fondVignette.setFillColor(sf::Color(30,56,65));
fondVignette.setPosition(offset - 20 ,(m_texlimbEscape.getSize().y * 0.8 + 0.05 * HFENETRE) - 20);
for(unsigned int i = 0 ; i< liste.size();i++)
{
tabptrVignette.push_back(Vignette(font));
std::string s = liste[i];
s.resize(liste[i].size() - 4);
tabptrVignette[i].setTitre(s);
tabptrVignette[i].setFenetrelie(fenetrePrincipale);
tabptrVignette[i].setTextures(&vignette,&vignetteS);
tabptrVignette[i].setScale(1);
}
for(unsigned int i = 0 ; i < (nbPage + 1) && i * nombreElementPage < liste.size() ; i++) // 12 elements par page
{
for(unsigned int j = 0 ; j < nombreRange && i * nombreElementPage + j * nombreElementRange < liste.size() ; j ++) // 3 rangés par page
{
positionVignette.y = m_texlimbEscape.getSize().y * 0.8 + 0.05 * HFENETRE + j* HFENETRE * 0.20;
for(unsigned int k = 0 ; k< nombreElementRange &&i * nombreElementPage + j * nombreElementRange + k < liste.size();k++) // 4 elements par rangé
{
positionVignette.x = offset + k * LFENETRE * 0.20;
tabptrVignette[i*nombreElementPage + j*nombreElementRange + k].setPosition(positionVignette);
}
}
}
sf::Event event;
while (fenetrePrincipale.isOpen()) {
while (fenetrePrincipale.pollEvent(event)) {
if (event.type == sf::Event::Closed)
fenetrePrincipale.close();
if(m_horlogeEvent.getElapsedTime().asSeconds() > 0.1) // protection afin d'eviter d'appuyer sur deux bouton qui se superpose sur deux page connexes.
{
if(pageSuivante.actionner())
{
m_click.play();
if(pageActuelle<nbPage)
pageActuelle++;
m_horlogeEvent.restart();
}
if(pagePrecedente.actionner())
{
m_click.play();
if(pageActuelle>0)
pageActuelle--;
m_horlogeEvent.restart();
}
if(retour.actionner())
{
m_click.play();
return "errStr" ;
m_horlogeEvent.restart();
}
for(unsigned int i = 0 ; i<nombreElementPage && nombreElementPage * pageActuelle + i < tabptrVignette.size() ; i++)
{
if(tabptrVignette[nombreElementPage * pageActuelle + i ].actionner())
{
return tabptrVignette[nombreElementPage * pageActuelle + i].getString();
}
}
}
fenetrePrincipale.setView(fenetrePrincipale.getDefaultView());
fenetrePrincipale.clear();
fenetrePrincipale.draw(fond);
fenetrePrincipale.draw(m_limbEscape);
fenetrePrincipale.draw(fondVignette);
for(unsigned i = 0 ; i<nombreElementPage && nombreElementPage * pageActuelle + i < tabptrVignette.size(); i++ )
{
tabptrVignette[nombreElementPage * pageActuelle + i ].afficher();
}
pageSuivante.afficher();
pagePrecedente.afficher();
retour.afficher();
fenetrePrincipale.display();
}
}
return "errStr";
}
void Jeu::jouer()
{
//Création de l'interface bouton
reglerVue();
lgui::Bouton recharger(font,&textBoutonR,&textBoutonV);
recharger.setTitre("Recharger");
recharger.setTailleTexte(15);
recharger.setFenetrelie(fenetrePrincipale);
recharger.setPosition(sf::Vector2f(LFENETRE - (textBoutonV.getSize().x + 15),HFENETRE - (textBoutonV.getSize().y + 30)));
lgui::Bouton retour(font,&textBoutonR,&textBoutonV);
retour.setTitre("Retour");
retour.setTailleTexte(15);
retour.setFenetrelie(fenetrePrincipale);
retour.setPosition(sf::Vector2f(LFENETRE - (textBoutonV.getSize().x + 15),HFENETRE - (textBoutonV.getSize().y + 100)));
std::string infSouris;
//horloge pour limiter les evenements produit par seconde
sf::Clock horlogeEvent;
sf::Time tempsBoucleEvent;
m_chronometre.restart();
while (fenetrePrincipale.isOpen()) {
sf::Event event;
//Gestion des evenements et saisies utilisateur...
while (fenetrePrincipale.pollEvent(event))
{
if (event.type == sf::Event::Closed)
fenetrePrincipale.close();
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) view1.move(-150 * m_horlogeInterne.getElapsedTime().asSeconds(),0); // deplacement de la camera
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) view1.move(150 * m_horlogeInterne.getElapsedTime().asSeconds(),0);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) view1.move(0,-150 * m_horlogeInterne.getElapsedTime().asSeconds());
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) view1.move(0,150 * m_horlogeInterne.getElapsedTime().asSeconds());
m_horlogeInterne.restart();
if( objectifRempli() && !m_joueur->enDeplacement()){ if(gagner()) {desallouer();return;}}
// if(horlogeEvent.getElapsedTime().asMilliseconds() - tempsBoucleEvent.asMilliseconds()>10) {
m_joueur->gererClavier(*m_ptrthis);
tempsBoucleEvent = horlogeEvent.getElapsedTime();
// }
if(recharger.actionner())
{
m_click.play();
std::string nomcarte;
nomcarte = m_carte->getNom();
desallouer();
chargerCarte(nomcarte);
}
if(retour.actionner())
{
m_click.play();
desallouer();
m_jouerSuite = false;
return;
}
//Actualise l'animation du personnage
m_joueur->animer();
fenetrePrincipale.clear(); //nettoyage de la fenetre
fenetrePrincipale.setView(fenetrePrincipale.getDefaultView());//placement dans la vue de l'interface afin de dessiner le fond.
fenetrePrincipale.draw(fond);
fenetrePrincipale.setView(view1); //Placement dans la vue prevue pour le jeu
fenetrePrincipale.draw(m_carte->getSprCarte());
for(unsigned int i = 0 ; i< m_repereObjectif.size();i++) //Dessin des objectifs
{
fenetrePrincipale.draw(m_carte->getElementHolder()[m_repereObjectif[i]]->getApparence());
}
for(unsigned int y= 0 ; y<m_tabElement.size();y++) //dessin du reste.
{
for(unsigned int x =0 ; x< m_tabElement[y].size();x++ )
{
if(m_tabElement[y][x] !=nullptr)
{
if(m_tabElement[y][x]->getType() != DEPART)
fenetrePrincipale.draw(m_tabElement[y][x]->getApparence());
}
else
{
if(m_joueur->getPosition().x == x && m_joueur->getPosition().y == y) m_joueur->afficher(fenetrePrincipale);
}
}
}
fenetrePrincipale.setView(fenetrePrincipale.getDefaultView());//Changement de vue pour dessiner l'interface.
recharger.afficher();
retour.afficher();
// fenetrePrincipale.draw(infoSouris);
fenetrePrincipale.draw(infoVersion);
fenetrePrincipale.display();
}
}
bool Jeu::desallouer()
{
if(m_carte != nullptr) {delete m_carte;m_carte = nullptr;} //Si une carte existe dejà , on la supprime
if(m_ressourceHolder != nullptr) {delete m_ressourceHolder;m_ressourceHolder=nullptr;} // On supprime le ressourceholder si il existe deja
for(unsigned int i = 0 ; i<Element::tableauElement.size() ; i++) // On reset tout les elements deja existant .
{ if(Element::tableauElement[i] != nullptr)
delete Element::tableauElement[i];
}
Element::tableauElement.clear(); // on désalloue tout le vector
if(m_joueur != nullptr ) {delete m_joueur;m_joueur=nullptr;} //joueur...
return true;
}
bool Jeu::chargerSuite(std::string const &nom)
{
m_suiteCarte.clear();
std::string s;
if(nom =="")
{
cerr<<"Erreur, Nom de suite inexistant";
return false;
}
else if(nom.size() >300)
{
cerr<<"erreur, nom de suite trop long!";
return false;
}
else
{
std::string chemin = "Cartes/Suites/" + nom + ".ste";
ifstream chargement(chemin.c_str(), ios ::binary);
if(!chargement)
{
cerr<<"Erreur, Impossible de charger "<<nom<<"!"<<endl;
return false;
}
else
{
while(getline(chargement,s))
{
m_suiteCarte.push_back(s);
}
chargement.close();
chargerCarte(m_suiteCarte[0]);
}
m_jouerSuite= true;
return true;
}
}
bool Jeu::chargerCarte(std::string const &nom)
{
m_carte = new Carte(); //On en crée une vierge
if( !m_carte->charger(nom)) //On charge la carte à partir du fichier
{
return false; // si on echoue
}
else // Si la carte à correctement chargé
{
m_ressourceHolder= new RessourceHolder(m_carte->getPackRessource()); // On en crée un nouveau avec le pack de ressource de la carte.
m_carte->assembler(m_ressourceHolder); // et on le refait pour la carte actuelle.
trierElement(); // Enfin on tri les elements dans un vector de jeu:: en enlevant le Depart et les objectif (pour l'affichage)
m_joueur = new Joueur(fenetrePrincipale,m_carte);
return true;
}
}
void Jeu::trierElement()
{
if(m_tabElement.size()>0)
{
m_tabElement.clear();
}
for(unsigned int i = 0; i< TAILLE_MAX;i++)
{
m_tabElement.push_back(std::vector<Element*>(TAILLE_MAX));//Creation d'un vector double dimensionnel de taille TAILLE_MAX ( 15)
}
InitNombreObjectif();
for(unsigned int i = 0 ; i< m_carte->getElementHolder().size();i++) //copie des pointeurs sur les element dans le tableau ,
{
if(m_carte->getElementHolder()[i]->getType() != OBJECTIF && m_carte->getElementHolder()[i]->getType() != DEPART) //a l'exception des OBJECTIF
m_tabElement[m_carte->getElementHolder()[i]->getPosition().y][m_carte->getElementHolder()[i]->getPosition().x] = m_carte->getElementHolder()[i] ;
}
}
void Jeu::deplacerElement(sf::Vector2f positionActuelle,sf::Vector2f positionNouvelle)
{
Element* ptr;
ptr= m_tabElement[positionActuelle.y][positionActuelle.x];
m_tabElement[positionActuelle.y][positionActuelle.x] =nullptr;
m_tabElement[positionNouvelle.y][positionNouvelle.x] = ptr;
}
std::vector<std::vector<Element*>> Jeu::getTabElement()
{
return m_tabElement;
}
void Jeu::intro()
{
m_theme.play();//musique
m_theme.setLoop(true);//en boucle
sf::Text TextPasse;
TextPasse.setFont(font);
TextPasse.setCharacterSize(15); //texte qui indique la commande à utiliser pour passer
TextPasse.setColor(sf:: Color::Green);
TextPasse.setPosition(20,HFENETRE -50);
TextPasse.setString("Appuyer sur E pour passer...");
sf::Event event;
sf::Texture textureLimb; //Logo Limb'Studio
sf::Texture textureSfml;
if(!textureLimb.loadFromFile("Data/LimbStudio.png")) cout<< "Logo setLoopnon chargé!" <<endl;
if(!textureSfml.loadFromFile("Data/sfml.png")) cout<< "Logo non chargé!" <<endl;
textureLimb.setSmooth(true);
sf::Sprite LimbSp;
sf::Sprite sfmlSp; //Logo SFML
LimbSp.setColor(sf::Color(255,255,255,0));
LimbSp.setTexture(textureLimb);
LimbSp.setPosition((LFENETRE - textureLimb.getSize().x) / 2 ,(HFENETRE - textureLimb.getSize().y) / 2 );
sfmlSp.setColor(sf::Color(255,255,255,0));
sfmlSp.setTexture(textureSfml);
sfmlSp.setPosition((LFENETRE - textureSfml.getSize().x) / 2 ,(HFENETRE - textureSfml.getSize().y) / 2 );
sf::Clock temps;
sf::Time tempsDep = temps.getElapsedTime();
float tempsatt= 0;
while(temps.getElapsedTime().asSeconds() - tempsDep.asSeconds() < 5 && fenetrePrincipale.isOpen()) { //Boucle pour la SFML
if(temps.getElapsedTime().asSeconds() - tempsDep.asSeconds()< 1) {
sfmlSp.setColor(sf::Color(255,255,255, ((temps.getElapsedTime().asSeconds() - tempsDep.asSeconds()) * 255)));//On fait apparaitre le Logo
} else if(temps.getElapsedTime().asSeconds() - tempsDep.asSeconds() > 1 && temps.getElapsedTime().asSeconds() - tempsDep.asSeconds() < 3) {
sfmlSp.setColor(sf::Color(255,255,255,255)); //on garde le logo afficher un certain temps
} else if(temps.getElapsedTime().asSeconds() - tempsDep.asSeconds() > 3 && temps.getElapsedTime().asSeconds() - tempsDep.asSeconds() < 4) {
sfmlSp.setColor(sf::Color(255,255,255, 255 - (((temps.getElapsedTime().asSeconds() - (tempsDep.asSeconds() + 3)) * 255)))); //on fait disparaitre le logo
}
// TextPasse.setColor(Color(255,255,255, 128*(1+sin(4 * temps.getElapsedTime().asSeconds())))); //on change la transparence du texte de commande selon un sinus
TextPasse.setColor(utils::changerTransparence(TextPasse.getColor(),128*(1+sin(4 * temps.getElapsedTime().asSeconds())))); //on change la transparence du texte de commande selon un sinus
if(temps.getElapsedTime().asSeconds() - tempsatt > 0.01) {
fenetrePrincipale.clear();
fenetrePrincipale.draw(sfmlSp);
fenetrePrincipale.draw(TextPasse); //affichage...
fenetrePrincipale.display();
tempsatt = temps.getElapsedTime().asSeconds();
}
while (fenetrePrincipale.pollEvent(event)) {
if(sf::Keyboard::isKeyPressed(sf::Keyboard::E)) return;
switch(event.type ) {
case sf::Event::Closed :
fenetrePrincipale.close();
break;
default :
break;
}
}
}
temps.restart(); //on reset le temps
tempsDep = temps.getElapsedTime();//on reactualise la pos de depart du temsp
tempsatt= 0; //temps pour l'affichage.
while(temps.getElapsedTime().asSeconds() - tempsDep.asSeconds() < 5 && fenetrePrincipale.isOpen()) { //Même procéder pour le Logo de Jinn Studio
if(temps.getElapsedTime().asSeconds() - tempsDep.asSeconds() < 1) {
LimbSp.setColor(sf::Color(255,255,255, ((temps.getElapsedTime().asSeconds() - tempsDep.asSeconds()) * 255)));
} else if(temps.getElapsedTime().asSeconds() - tempsDep.asSeconds() > 1 && temps.getElapsedTime().asSeconds() - tempsDep.asSeconds() < 4) {
LimbSp.setColor(sf::Color(255,255,255,255));
} else if(temps.getElapsedTime().asSeconds() - tempsDep.asSeconds() > 4 && temps.getElapsedTime().asSeconds() - tempsDep.asSeconds() < 5) {
LimbSp.setColor(sf::Color(255,255,255, 255 - (((temps.getElapsedTime().asSeconds() - (tempsDep.asSeconds() + 4)) * 255))));
}
// TextPasse.setColor(Color(255,255,255, 128*(1+sin(4 * temps.getElapsedTime().asSeconds()))));
TextPasse.setColor(utils::changerTransparence(TextPasse.getColor(),128*(1+sin(4 * temps.getElapsedTime().asSeconds()))));
if(temps.getElapsedTime().asSeconds() - tempsatt > 0.01) {
fenetrePrincipale.clear();
fenetrePrincipale.draw(LimbSp);
fenetrePrincipale.draw(TextPasse); //affichage...
fenetrePrincipale.display();
tempsatt = temps.getElapsedTime().asSeconds();
}
while (fenetrePrincipale.pollEvent(event)) {
switch(event.type ) {
case sf::Event::Closed :
fenetrePrincipale.close();
break;
default :
break;
}
if(sf::Keyboard::isKeyPressed(sf::Keyboard::E)) return;
}
}
}
bool Jeu::demarrer()
{
return EXIT_SUCCESS;
}
void Jeu::reglerVue()
{
view1.setCenter(0, m_carte->getSprCarte().getTexture()->getSize().y / 2);
}
void Jeu::AfficherScene()
{}
void Jeu::AfficherHud()
{}
void Jeu::InitNombreObjectif()
{
m_repereObjectif.clear();
if(m_repereObjectif.size()==0)
{ // protection
for(unsigned int i=0 ; i< m_carte->getElementHolder().size(); i++) { //on parcourt le tableau d'element
if( m_carte->getElementHolder()[i]->getType() == OBJECTIF) { // Si on tombe sur un objectif
m_repereObjectif.push_back(i); // On enregistre sa position dans le tableau d'element dans un autre tableau.
}
}
}
}
std::vector<std::string> Jeu::rechercheFichier(std:: string chemin, std::string extension)
{
string commandeSysteme;
std::vector<std::string> stringVector;
if(chemin == "" || chemin.size() > 300 )
{
std::cerr<<"Chemin d'acces incorrecte!"<<std::endl;
return stringVector;
}
else
{
if(!(extension == "" || extension.size() > 4))
{
#ifdef WINDOW
commandeSysteme = "dir " + chemin + "*" + extension+"* /b > "+ chemin + "liste.txt" ;
#endif // WINDOW
#ifdef LINUX
commandeSysteme = "ls " + chemin + "*" + extension + "/b > "+ chemin + "liste.txt" ;
#endif // LINUX
}
}
system(commandeSysteme.c_str());
std::ifstream fichier((chemin + "liste.txt"));
std::string s;
unsigned int i = 0;
if(fichier){
while(std::getline(fichier,s))
{
stringVector.push_back(s);
//std::cout<<m_tabCartes[i]<<std::endl;
i++;
}
}
else
{
std::cerr << "Impossible d'ouvrir liste.txt " << std::endl;
}
fichier.close();
#ifdef WINDOW
commandeSysteme = "del " + chemin + "liste.txt";
#endif // WINDOW
#ifdef LINUX
commandeSysteme = "rm " + chemin + "liste.txt";
#endif // LINUX
system(commandeSysteme.c_str());
return stringVector;
}
| [
"mail.limbstudio@gmail.com"
] | mail.limbstudio@gmail.com |
c67cde69e06f364d69cf428da976a16cec6aacac | b30b65994865ce9212da5b30834b15ea9dbb9103 | /CODEFORCES/Avulso/Implementacao/200B.cpp | c4a6eebc5c7ded6e154b8004487d4fc47e4fba34 | [] | no_license | uthantvicentin/Competitive-Programming | 3d06b9cac1bf76a166f8009b7898fafdbca726bf | 6072753df64da0fa76a95fd30c9c65d89cd30a73 | refs/heads/master | 2021-09-08T19:54:18.510359 | 2021-09-05T13:14:12 | 2021-09-05T13:14:12 | 178,067,690 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 212 | cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,x,soma = 0;
scanf("%d",&n);
for(int i = 0 ; i < n ; ++i){
scanf("%d",&x);
soma += x;
}
printf("%.12lf\n",(double)soma/n);
return 0;
}
| [
"uthantvicentin@gmail.com"
] | uthantvicentin@gmail.com |
8d2067da777936b941a0aa5d87d79ffab3b965df | e733f50ae42ba2684688e82d374e485fada0c353 | /slam3d/sensor/pcl/RegistrationParameters.hpp | 6f91865a8b237c40f801347d0bf157c36ddb0f41 | [
"BSD-3-Clause"
] | permissive | dfki-ric/slam3d | 61414c9dbb7eca62d5f30ab69cbf3cb0bae696e4 | 9f06d1a6768b3a22a6e164ceea529767f5e99ea6 | refs/heads/master | 2023-06-22T14:22:24.209551 | 2023-03-09T10:29:09 | 2023-03-09T10:29:09 | 126,174,814 | 18 | 5 | BSD-3-Clause | 2023-05-08T12:53:17 | 2018-03-21T12:25:13 | C++ | UTF-8 | C++ | false | false | 4,121 | hpp | // slam3d - Frontend for graph-based SLAM
// Copyright (C) 2017 S. Kasperski
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef SLAM3D_REGISTRATION_PARAMETERS_HPP
#define SLAM3D_REGISTRATION_PARAMETERS_HPP
namespace slam3d
{
enum RegistrationAlgorithm {ICP, GICP, NDT};
/**
* @class GICPConfiguration
* @brief Parameters for the GICP algorithm.
*/
struct RegistrationParameters
{
// External parameters (not from pcl)
// ----------------------------------
// the applied registration algorithm (ICP, GICP, NDT)
RegistrationAlgorithm registration_algorithm;
// pointclouds will be downsampled to this density before the alignement
double point_cloud_density;
// maximum fitness score (e.g., sum of squared distances from the source to the target)
// to accept the registration result
double max_fitness_score;
// General registration parameters
// -------------------------------
// maximum allowed distance error before the algorithm will be considered to have converged
double euclidean_fitness_epsilon;
// transformation epsilon in order for an optimization to be considered as having converged to the final solution
double transformation_epsilon;
// maximum distance threshold between a point and its nearest neighbor
// correspondent in order to be considered in the alignment process
double max_correspondence_distance;
// the maximum number of iterations the internal optimization should run for
int maximum_iterations;
// GICP parameters
// ---------------
// maximum allowable difference between two consecutive rotations in order
// for an optimization to be considered as having converged to the final solution.
double rotation_epsilon;
// number of neighbors to use when computing covariances
int correspondence_randomness;
// maximum number of iterations for the optimizer
int maximum_optimizer_iterations;
// NDT parameters
// --------------
// side length of voxels in the grid
float resolution;
// the newton line search maximum step length
double step_size;
// point cloud outlier ratio
double outlier_ratio;
RegistrationParameters() : registration_algorithm(GICP),
point_cloud_density(0.2),
max_fitness_score(2.0),
euclidean_fitness_epsilon(1.0),
transformation_epsilon(1e-5),
max_correspondence_distance(2.5),
maximum_iterations(50),
rotation_epsilon(2e-3),
correspondence_randomness(20),
maximum_optimizer_iterations(20),
resolution(1.0),
step_size(0.05),
outlier_ratio(0.35){};
};
}
#endif | [
"sebastian.kasperski@dfki.de"
] | sebastian.kasperski@dfki.de |
d24ac5a34d04fcf55361c95725f7d88dce6c5b90 | 0912b580cfdc8ac4e0a2d42c807204d8c4203646 | /Sandbox/src/Sandbox.cpp | bf00a959b486f3a180599512b632305c89117582 | [] | no_license | MengxuanHUANG/NewEngine | 323dfba9586f4942a0f4569779086c0e58dfe868 | 32ba46760360454b4c2e2172d739a72d8b0edd78 | refs/heads/main | 2023-02-21T13:45:34.866015 | 2021-01-28T14:05:36 | 2021-01-28T14:05:36 | 326,305,677 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 361 | cpp | #include "NewEngine.h"
#include "NewEngine/Core/EntryPoint.h"
#include "ExampleLayer.h"
#include "AssimpLayer.h"
class SandboxApp :public engine::Application
{
public:
SandboxApp()
{
//PushLayer(new ExampleLayer());
PushLayer(new AssimpLayer());
}
~SandboxApp()
{
}
};
engine::Application* engine::CreateApplication()
{
return new SandboxApp();
} | [
"18082628d@connect.polyu.hk"
] | 18082628d@connect.polyu.hk |
3d9dc7c5ca8c000259bc06b7cf2a647e63cedb35 | 9851a075ce800fb1156711fd128d1619134bc2f4 | /Programa2/Suarez Adrian Marcelo A01197108 Programa 2/1prg1_Logger.h | 312e270acd657936c27aacdf5a5230e3caa5a070 | [] | no_license | amsuarez99/lab-calidad | 6624840052a8df65ba8e3a2e782017b47c2955c6 | 7ea0c2cb14289e11b6d92d572e398f455855141b | refs/heads/main | 2023-04-14T15:53:03.925983 | 2021-05-05T06:21:17 | 2021-05-05T06:21:17 | 352,393,081 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,334 | h | #pragma once
class Logger {
public:
Logger();
void log(string msg);
void logErrMess(string errMsg);
void logResult(string fileName, int (&lineCount)[3]);
};
// Constructor de la clase
Logger :: Logger() {
}
// Función: Imprime mensaje de error en consola
// Parámetros: El mensaje a imprimir
// Valor de retorno: nada
void Logger :: log(string msg) {
cout << msg;
}
// Función: Imprime mensaje de error en consola
// Parámetros: El mensaje a imprimir
// Valor de retorno: nada
void Logger :: logErrMess(string msg) {
cout << msg << endl;
}
// Función: Imprime el resultado en el formato especificado
// Parámetros: string fileName -> nombre del archivo,
// int lineCount[3] -> el resultado de conteo de líneas
// Valor de retorno: nada
void Logger :: logResult(string fileName, int (&lineCount)[3]) {
cout << "Nombre del archivo: " << fileName << endl;
cout << "--------------------------------------------" << endl;
cout << "Cantidad de líneas en blanco: " << lineCount[0] << endl;
cout << "Cantidad de líneas con comentarios: " << lineCount[1] << endl;
cout << "Cantidad de líneas con código: " << lineCount[2] << endl;
cout << "--------------------------------------------" << endl;
cout << "Cantidad total de líneas: " << (lineCount[0] + lineCount[1] + lineCount[2]) << endl;
}
| [
"amsuarez99@gmail.com"
] | amsuarez99@gmail.com |
3effa6495f94155a0aed471058fa51e39e67cce7 | 059868ce51af78f838fe2b563f616a549a28ea74 | /1.cpp | 1409feebfa90bd85fa2bfe330f5d2f04138f09a4 | [] | no_license | sajithkp/lab-6 | 9693f7f2d90aaec813c0de1059f3f55fd9cb69ad | 4bbe46a0e687646781d2056d1107c3a9408970aa | refs/heads/master | 2021-01-25T13:41:56.382681 | 2018-03-02T17:10:05 | 2018-03-02T17:10:05 | 123,607,442 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 966 | cpp | #include<iostream>
using namespace std;
// declaring function Search
void Search(int arr[],int lsize, int rsize, int key){
// Make a variable which is to make our array into two parts and find it's middle
int mid = (lsize +rsize)/2;
// assuming the array to be sorted
if (key <= arr[rsize] && key >= arr[lsize]){
// if the mid is our searched element
if(arr[mid] == key){
cout << " Found at " << mid;
}
else{
//if the value of the required element is greater than mid
if(arr[mid] < key){
Search(arr,mid+1,rsize,key);
}
//if the value of the required element is lesser than mid
else{
// not in the specified limit then gives output as -1
Search(arr,lsize,mid-1,key);
}
}
}
else{
cout << "-1";
}
}
int main(){
int x;
cout<<"Enter the number to be searched"<<endl;
cin>>x;
int a[6]={5,8,10,45,95,455};
//calling the function search
Search ( a , 0 , 5 , x);
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
4fe74b909dff58bb6a56338a8c3f8fec5fdaf2f5 | 99aa550a737e662bac5c33ab9cf10bfa20795558 | /midgard/libmagus/Typen.cc | e1c1dbd3c5cc907da0ca6695fcc34cea4da5a47c | [] | no_license | cpetig/midgard | a55b05f4f17fdb6b7dbf407282d510b3e9a21e8c | 045adc87666aab10f2f33133300d108a482d78cf | refs/heads/master | 2021-05-29T23:08:59.819983 | 2007-04-13T09:27:27 | 2007-04-13T09:27:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,604 | cc | /* Midgard Character Generator
* Copyright (C) 2001 Malte Thoma
* Copyright (C) 2003-2004 Christof Petig
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "Typen.hh"
#include "NotFound.h"
#include "Grundwerte.hh"
#include <Misc/Tag.h>
#include "Ausgabe.hh"
#include "Datenbank.hh"
cH_Typen::cache_t cH_Typen::cache;
cH_Typen::cH_Typen(const std::string& name ,bool create)
{
cH_Typen *cached(cache.lookup(name));
if (cached) *this=*cached;
else
{Ausgabe(Ausgabe::Warning, "Typen '" + name + "' nicht im Cache");
if (create)
{ Tag t2("Typ");
t2.setAttr("Abkürzung",name);
t2.setAttr("Bezeichnung-Mann",name);
t2.setAttr("Bezeichnung-Frau",name);
*this=new Typen(t2);
}
else throw NotFound(name);
}
}
bool Typen::Valid() const
{
if(typnr==0) return false;
return true;
}
Typen::Typen(const Tag &tag)
: typs(tag.getAttr("Abkürzung"))
,typnr(tag.getIntAttr("MAGUS-Index",tag.getIntAttr("MCG-Index")))
,stand(0),sb(0),ruestung(0),geld(0)
{
typl=tag.getAttr("Bezeichnung-Mann");
typlw=tag.getAttr("Bezeichnung-Frau");
typz=tag.getBoolAttr("Zauberer")?"z":(tag.getBoolAttr("kannZaubern")?"j":"n");
ausdauer=tag.getAttr("Ausdauer");
const Tag *Modifikation=tag.find("Modifikation");
if (Modifikation)
{ stand=Modifikation->getIntAttr("Stand");
sb=Modifikation->getIntAttr("Sb");
ruestung=Modifikation->getIntAttr("Rüstung");
geld=Modifikation->getIntAttr("Geld");
}
region=tag.getAttr("Region");
beruf=tag.getAttr("Berufswahl");
land=tag.getBoolAttr("Land",true);
stadt=tag.getBoolAttr("Stadt",true);
sprueche_mit_pp=tag.getAttr("SprücheMitPraxisPunkten");
nsc_only=tag.getBoolAttr("NSC_only",false);
kultwaffe=tag.getBoolAttr("Kultwaffe",false);
lernpflichten_info=tag.getAttr("Lernpflichten");
lernpflicht_schrift=tag.getBoolAttr("SchreibenPflicht");
min_st=tag.getIntAttr("MinSt");
min_gw=tag.getIntAttr("MinGw");
min_gs=tag.getIntAttr("MinGs");
min_in=tag.getIntAttr("MinIn");
min_pa=tag.getIntAttr("MinpA");
FOR_EACH_CONST_TAG_OF(i,tag,"Herkunft")
vec_herkunft.push_back(Typen::st_herkunft(i->getAttr("Land"),i->getAttr("Kultwaffe")));
FOR_EACH_CONST_TAG_OF(i,tag,"Gruppe")
vec_gruppe.push_back(i->getAttr("Name"));
}
bool Typen::Spezialwaffe() const
{
if (Zaubern()=="z") return false;
if (Short()=="Ba") return false;
if (Short()=="") return false;
return true;
}
bool Typen::Spezialgebiet() const
{
if (Short()=="Ma") return true;
if (Short()=="eBe") return true;
return false;
}
bool Typen::Mindestwerte(const Grundwerte& Werte) const
{
if (Werte.St() < min_st ||
Werte.Gw() < min_gw ||
Werte.Gs() < min_gs ||
Werte.In() < min_in ||
Werte.pA() < min_pa ) return false;
else return true;
abort();
}
/*
bool Typen::Herkunft(const cH_Land land) const
{
return true;
}
*/
bool Typen::Gruppe(const std::string &gruppe) const
{
return std::find(vec_gruppe.begin(),vec_gruppe.end(),gruppe)!=vec_gruppe.end();
}
bool Typen::get_Typ_from_long(std::string& name)
{
std::string::size_type s1=name.find_first_of("(");
if(s1!=std::string::npos) name.erase(s1,1);
std::string::size_type s2=name.find_last_of(")");
if(s2!=std::string::npos) name.erase(s2,1);
for(std::vector<cH_Typen>::const_iterator i=Datenbank.Typen.begin();
i!=Datenbank.Typen.end();++i)
{
if((*i)->Typl()==name || (*i)->Typlw()==name)
{
name = (*i)->Short();
return true;
}
}
return false;
}
cH_Typen Typen::getTyp(const std::string &s)
{
for(std::vector<cH_Typen>::const_iterator i=Datenbank.Typen.begin();
i!=Datenbank.Typen.end();++i)
{
if(s==(*i)->Name(Enums::Mann) || s==(*i)->Name(Enums::Frau)) return *i;
}
throw NotFound(s);
}
std::string Typen::getLernpflichtenInfo(cH_Land herkunft) const
{
std::vector<std::string> vk;
for(std::vector<st_herkunft>::const_iterator i=vec_herkunft.begin();i!=vec_herkunft.end();++i)
{
if(herkunft->Name()==i->land && i->kultwaffe!="")
vk.push_back(i->kultwaffe);
}
if(vk.empty()) return lernpflichten_info;
std::string K="Für einen "+Short()+" muß als erstes ";
if(vk.size()==1) K+="die ";
else K+="eine ";
K+="Kultwaffe gewählt werden: ";
if(vk.size()!=1) K+="\n";
for(std::vector<std::string>::const_iterator i=vk.begin();i!=vk.end();++i)
{
K+=" "+*i+"\n";
}
return lernpflichten_info + "\n"+K;
}
bool operator==(void *data,const cH_Typen &t)
{ return *(static_cast<Typen*>(data))==*t;
}
cH_Typen cH_Typen::load(const Tag &t)
{ cH_Typen *res=cache.lookup(t.getAttr("Abkürzung"));
assert (!res);
{ cH_Typen r2=new Typen(t);
cache.Register(t.getAttr("Abkürzung"),r2);
return r2;
}
}
void Typen_All::load(std::list<cH_Typen> &list,const Tag &t)
{ list.push_back(cH_Typen::load(t));
}
void Typen_All::load(std::vector<cH_Typen> &list,const Tag &t)
{ list.push_back(cH_Typen::load(t));
}
| [
"christof"
] | christof |
fafe18e88f6310cbffdf9f869027c6d3a7931c08 | 57d30906de95e20fb45216925791cb809a11b7f1 | /ase/gtcpp/resolver.hpp | ff5f700a7b15b0c38e1cf20fc709f52a2d9979ea | [
"MIT"
] | permissive | ahiguti/ase | ad782902ca3a8713b155769413fc5d9fd537c347 | f6bc5f337fe7df6eabf676660d9189d3c474150d | refs/heads/main | 2021-06-13T17:39:25.280776 | 2012-06-15T21:01:17 | 2012-06-15T21:01:17 | 4,680,010 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 807 | hpp |
/*
* This file is part of ASE, the abstract script engines.
* Copyright (C) 2006 A.Higuchi. All rights reserved.
* See COPYRIGHT.txt for details.
*/
#ifndef GTCPP_RESOLVER_HPP
#define GTCPP_RESOLVER_HPP
#include <boost/scoped_ptr.hpp>
#include <boost/noncopyable.hpp>
#include <vector>
#include <string>
namespace gtcpp {
class resolver : private boost::noncopyable {
public:
struct record {
uint16_t rr_type;
uint16_t rr_class;
uint32_t rr_ttl;
uint16_t mx_pref;
std::string data;
record() : rr_type(0), rr_class(0), rr_ttl(0), mx_pref(0) { }
};
resolver();
~resolver();
int lookup(const char *name, int typ, std::vector<record>& rec_r);
/* returns h_errno */
private:
struct impl_type;
const boost::scoped_ptr<impl_type> impl;
};
};
#endif
| [
"ahiguti100@gmail.com"
] | ahiguti100@gmail.com |
ad356e4cd5e5d5774638ea7c0cc9cb250ce0e4e7 | af7b4493f8aa0a4893ce4c5b96256b78ed3078b2 | /Models/computerswithpeople.cpp | 0b72e6de65e049dbe322e019411a21a6303b1280 | [] | no_license | valdimarHR/hisCompRepo | 3f6b0c4d80f77c806cf36f23f1aeb7cb3d453ab9 | e0bed82a75e76afd0ee8a72faf27c7b9373b97dd | refs/heads/master | 2021-01-10T02:08:07.246465 | 2015-12-16T14:46:32 | 2015-12-16T14:46:32 | 46,974,705 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 83 | cpp | #include "computerswithpeople.h"
computersWithPeople::computersWithPeople()
{
}
| [
"huldah15@ru.is"
] | huldah15@ru.is |
424e500ba2d175df0d0dd9f9ab0b43441d0775e7 | a96bdfb2829f508c3c1115918f644cbb10fbca71 | /2014/f1-carteiro.cc | 1455b5009346b928cb1823d6501b2f357360feb3 | [] | no_license | alequisk/resolucoes-obi | 5509296d877c52074fcc0e02e10fdbbc6fecd254 | 3230debba83cc82ad326401728f0f5c6ae696e7f | refs/heads/master | 2023-01-28T12:56:46.205815 | 2023-01-14T14:40:09 | 2023-01-14T14:40:09 | 270,109,643 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 477 | cc | #include<iostream>
#include<vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> arr(N);
for (auto& x: arr) {
cin >> x;
}
int64_t cost = 0;
int pos = 0;
for (int i = 0; i < M; i++) {
int w; cin >> w;
int pp = lower_bound(arr.begin(), arr.end(), w) - arr.begin();
cost += abs(pp - pos);
pos = pp;
}
cout << cost << '\n';
return 0;
} | [
"alexsousa1435@gmail.com"
] | alexsousa1435@gmail.com |
4e6d6732f82408b9cb523e388a35dc7148b037d9 | 26c6862bfd3ccc75cb114619d2a7b76061db9ead | /soui_20171208/SOUI/src/control/STabCtrl.cpp | 2f79757eaa84a92a58300710c91c0d11be112812 | [
"MIT"
] | permissive | Honkhat/UISOSO | 80f68d343a01c1cf14abadb2bf4e3e3ee7216b5b | 3b06f261b8c3e40662d7081052d046bb1cab9a6c | refs/heads/master | 2020-03-08T09:51:58.246144 | 2018-04-21T15:05:19 | 2018-04-21T15:05:19 | 128,057,409 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 22,574 | cpp | #include "souistd.h"
#include "control/Stabctrl.h"
#include "animator/SInterpolatorImpl.h"
#include <algorithm>
namespace SOUI
{
class STabSlider : public SWindow, public ITimelineHandler
{
SOUI_CLASS_NAME(STabSlider, L"tabslider")
public:
STabSlider(STabCtrl *pTabCtrl, int iFrom, int iTo, int nSteps, int nType,IInterpolator *pInterpolator)
: m_pTabCtrl(pTabCtrl)
, m_aniInterpoloator(pInterpolator)
, m_nSteps(nSteps)
, m_iStep(0)
{
SASSERT(pTabCtrl);
SASSERT(pInterpolator);
CRect rcPage = pTabCtrl->GetChildrenLayoutRect();
if (nType == 0)
{
pTabCtrl->InsertChild(this);
Move(rcPage);
m_bVertical = pTabCtrl->m_nTabAlign == STabCtrl::AlignLeft || pTabCtrl->m_nTabAlign == STabCtrl::AlignRight;
if (m_bVertical)
{
GETRENDERFACTORY->CreateRenderTarget(&m_memRT, rcPage.Width(), rcPage.Height() * 2);
}
else
{
GETRENDERFACTORY->CreateRenderTarget(&m_memRT, rcPage.Width() * 2, rcPage.Height());
}
CPoint pt;
if (m_bVertical)
{
if (iFrom < iTo)
{// move up
pt.x = pt.y = 0;
m_nFrom = 0;
m_nTo = rcPage.Height();
//m_nAniRange = rcPage.Height();
}
else
{// move down
pt.x = 0, pt.y = rcPage.Height();
m_ptOffset.y = rcPage.Height();
m_nFrom = rcPage.Height();
m_nTo = 0;
// m_nAniRange = -rcPage.Height();
}
}
else
{
if (iFrom < iTo)
{// move left
pt.x = pt.y = 0;
m_nFrom = 0;
m_nTo = rcPage.Width();
//m_nAniRange = rcPage.Width();
}
else
{
pt.x = rcPage.Width(), pt.y = 0;
m_ptOffset.x = rcPage.Width();
m_nFrom = rcPage.Width();
m_nTo = 0;
//m_nAniRange = -rcPage.Width();
}
}
pt -= rcPage.TopLeft();
m_memRT->SetViewportOrg(pt);
PaintBackground(m_memRT, &rcPage);
pTabCtrl->GetItem(iFrom)->SetVisible(FALSE);
if (m_bVertical)
{
if (iFrom < iTo)
{// move up
pt.x = 0, pt.y = rcPage.Height();
}
else
{// move down
pt.x = pt.y = 0;
}
}
else
{
if (iFrom < iTo)
{// move left
pt.x = rcPage.Width(), pt.y = 0;
}
else
{
pt.x = pt.y = 0;
}
}
pt -= rcPage.TopLeft();
m_memRT->SetViewportOrg(pt);
pTabCtrl->GetItem(iTo)->SetVisible(TRUE);
PaintBackground(m_memRT, &rcPage);
m_memRT->SetViewportOrg(CPoint());
GetContainer()->RegisterTimelineHandler(this);
pTabCtrl->GetItem(iTo)->SetVisible(FALSE);
SetVisible(TRUE, TRUE);
}
else
{
pTabCtrl->InsertChild(this, ICWND_FIRST);
Move(rcPage);
m_bVertical = pTabCtrl->m_nTabAlign == STabCtrl::AlignLeft || pTabCtrl->m_nTabAlign == STabCtrl::AlignRight;
if (m_bVertical)
{
GETRENDERFACTORY->CreateRenderTarget(&m_memRT, rcPage.Width(), rcPage.Height() * 2);
}
else
{
GETRENDERFACTORY->CreateRenderTarget(&m_memRT, rcPage.Width() * 2, rcPage.Height());
}
CPoint pt;
if (m_bVertical)
{
if (iFrom < iTo)
{// move up
pt.x = pt.y = 0;
m_nFrom = 0;
m_nTo = rcPage.Height();
//m_nAniRange = rcPage.Height();
}
else
{// move down
pt.x = 0, pt.y = rcPage.Height();
m_ptOffset.y = rcPage.Height();
m_nFrom = rcPage.Height();
m_nTo = 0;
//m_nAniRange = -rcPage.Height();
}
}
else
{
if (iFrom < iTo)
{// move left
pt.x = pt.y = 0;
m_nFrom = 0;
m_nTo = rcPage.Width();
//m_nAniRange = rcPage.Width();
}
else
{
pt.x = rcPage.Width(), pt.y = 0;
m_ptOffset.x = rcPage.Width();
m_nFrom = rcPage.Width();
m_nTo = 0;
//m_nAniRange = -rcPage.Width();
}
}
pt -= rcPage.TopLeft();
m_memRT->SetViewportOrg(pt);
PaintForeground2(m_memRT, &rcPage);
pTabCtrl->GetItem(iFrom)->SetVisible(FALSE);
if (m_bVertical)
{
if (iFrom < iTo)
{// move up
pt.x = 0, pt.y = rcPage.Height();
}
else
{// move down
pt.x = pt.y = 0;
}
}
else
{
if (iFrom < iTo)
{// move left
pt.x = rcPage.Width(), pt.y = 0;
}
else
{
pt.x = pt.y = 0;
}
}
pt -= rcPage.TopLeft();
m_memRT->SetViewportOrg(pt);
pTabCtrl->GetItem(iTo)->SetVisible(TRUE);
PaintForeground2(m_memRT, &rcPage);
m_memRT->SetViewportOrg(CPoint());
GetContainer()->RegisterTimelineHandler(this);
pTabCtrl->GetItem(iTo)->SetVisible(FALSE);
SetVisible(TRUE, TRUE);
}
}
virtual ~STabSlider()
{
}
void OnNextFrame()
{
if (++m_iStep > m_nSteps)
{
Stop();
}
else
{
float fPos = m_aniInterpoloator->getInterpolation(m_iStep*1.0f/m_nSteps);
int nOffset = m_nFrom + (int)(fPos * (m_nTo - m_nFrom));
if (m_bVertical)
m_ptOffset.y = nOffset;
else
m_ptOffset.x = nOffset;
InvalidateRect(NULL);
}
}
void Stop()
{
m_pTabCtrl->OnSliderFinish();
}
protected:
void OnPaint(IRenderTarget *pRT)
{
CRect rcWnd = GetWindowRect();
//pRT->BitBlt(rcWnd, m_memRT, m_ptOffset.x, m_ptOffset.y, SRCCOPY);
CRect rcSrc(m_ptOffset.x, m_ptOffset.y, m_ptOffset.x + rcWnd.Width(), m_ptOffset.y + rcWnd.Height());
pRT->AlphaBlend(rcWnd, m_memRT, rcSrc, 255);
}
void OnSize(UINT fType, CSize sz)
{
SWindow::OnSize(fType, sz);
if (!m_memRT) return;
//resize slidewnd as animitor running, just stop the animator
Stop();
}
void OnDestroy()
{
GetContainer()->UnregisterTimelineHandler(this);
SWindow::OnDestroy();
}
CAutoRefPtr<IRenderTarget> m_memRT;
CPoint m_ptOffset;
//int m_nAniRange;
int m_nFrom,m_nTo;
int m_nSteps;
int m_iStep;
bool m_bVertical;
CAutoRefPtr<IInterpolator> m_aniInterpoloator;
STabCtrl * m_pTabCtrl;
SOUI_MSG_MAP_BEGIN()
MSG_WM_PAINT_EX(OnPaint)
MSG_WM_SIZE(OnSize)
MSG_WM_DESTROY(OnDestroy)
SOUI_MSG_MAP_END()
};
//////////////////////////////////////////////////////////////////////////
// STabCtrl
STabCtrl::STabCtrl() : m_nCurrentPage(0)
, m_pSkinTab(GETBUILTINSKIN(SKIN_SYS_TAB_PAGE))
, m_pSkinIcon(NULL)
, m_pSkinTabInter(NULL)
, m_pSkinFrame(NULL)
, m_nTabInterSize(0)
, m_nTabPos(0)
, m_nHoverTabItem(-1)
, m_nTabAlign(AlignTop)
, m_nAnimateSteps(0)
, m_ptText(-1,-1)
, m_tabSlider(NULL)
, m_txtDir(Text_Horz)
,m_nAniamteType(0)
{
m_szTab.cx = m_szTab.cy = -1;
m_bFocusable=TRUE;
//create a linear animator interpolator
m_aniInterpolator.Attach(SApplication::getSingleton().CreateInterpolatorByName(SLinearInterpolator::GetClassName()));
m_evtSet.addEvent(EVENTID(EventTabSelChanging));
m_evtSet.addEvent(EVENTID(EventTabSelChanged));
m_evtSet.addEvent(EVENTID(EventTabItemHover));
m_evtSet.addEvent(EVENTID(EventTabItemLeave));
}
void STabCtrl::OnPaint(IRenderTarget *pRT)
{
SPainter painter;
BeforePaint(pRT,painter);
CRect rcItem,rcItemPrev;
CRect rcSplit;
DWORD dwState;
CRect rcTitle=GetTitleRect();
pRT->PushClipRect(&rcTitle,RGN_AND);
for(int i=0; i<(int)GetItemCount(); i++)
{
dwState=WndState_Normal;
if(i == m_nCurrentPage) dwState=WndState_PushDown;
else if(i== m_nHoverTabItem) dwState=WndState_Hover;
GetItemRect(i,rcItem);
if(rcItem.IsRectEmpty()) continue;
//画分隔线
if(i>0 && m_pSkinTabInter)
{
rcSplit=rcItem;
if(m_nTabAlign==AlignLeft)
{
rcSplit.top=rcItemPrev.bottom;
rcSplit.bottom = rcSplit.top + m_nTabInterSize;
}
else
{
rcSplit.left=rcItemPrev.right;
rcSplit.right=rcSplit.left + m_nTabInterSize;
}
m_pSkinTabInter->Draw(pRT,rcSplit,0);
}
DrawItem(pRT,rcItem,i,dwState);
rcItemPrev=rcItem;
}
pRT->PopClip();
if (m_pSkinFrame)
{
CRect rcPage = GetChildrenLayoutRect();
m_pSkinFrame->Draw(pRT, rcPage, WndState_Normal);
}
if(IsFocused() && IsFocusable() && m_bDrawFocusRect)
{
CRect rc;
GetItemRect(m_nCurrentPage,rc);
rc.DeflateRect(2,2);
DrawDefFocusRect(pRT,&rc);
}
AfterPaint(pRT,painter);
}
CRect STabCtrl::GetChildrenLayoutRect()
{
CRect rcRet;
GetClientRect(rcRet);
switch(m_nTabAlign)
{
case AlignLeft:
rcRet.left+= m_szTab.cx;
break;
case AlignRight:
rcRet.right-=m_szTab.cx;
break;
case AlignTop:
rcRet.top += m_szTab.cy;
break;
case AlignBottom:
rcRet.bottom -= m_szTab.cy;
break;
}
return rcRet;
}
void STabCtrl::OnLButtonDown( UINT nFlags, CPoint point )
{
SWindow::OnLButtonDown(nFlags,point);
int iClickItem = HitTest(point);
if(iClickItem != m_nCurrentPage)
{
SetCurSel(iClickItem);
}
}
BOOL STabCtrl::RemoveItem( int nIndex , int nSelPage/*=0*/)
{
STabPage * pTab = GetItem(nIndex);
OnItemRemoved(pTab);
DestroyChild(pTab);
m_lstPages.RemoveAt(nIndex);
if (m_nCurrentPage == nIndex)
{
if(nSelPage<0) nSelPage=0;
if(nSelPage>= GetItemCount()) nSelPage=GetItemCount()-1;
m_nCurrentPage=-1;
SetCurSel(nSelPage);
}else
{
if(m_nCurrentPage>nIndex) m_nCurrentPage--;
}
CRect rcTitle = GetTitleRect();
InvalidateRect(rcTitle);
return TRUE;
}
void STabCtrl::RemoveAllItems( void )
{
for (int i = GetItemCount()-1; i >= 0; i--)
{
STabPage * pTab = GetItem(i);
OnItemRemoved(pTab);
DestroyChild(pTab);
m_lstPages.RemoveAt(i);
}
m_nCurrentPage = -1;
Invalidate();
}
void STabCtrl::OnMouseMove( UINT nFlags, CPoint point )
{
CRect rcItem;
int nOldHover=m_nHoverTabItem;
m_nHoverTabItem=-1;
int nTabCount=GetItemCount();
for (int i = 0; i < nTabCount; i ++)
{
GetItemRect(i, rcItem);
if (rcItem.PtInRect(point))
{
m_nHoverTabItem=i;
break;
}
}
if (m_nHoverTabItem != nOldHover)
{
if(nOldHover!=-1)
{
if(nOldHover!=m_nCurrentPage)
{
GetItemRect(nOldHover, rcItem);
InvalidateRect(rcItem);
}
EventTabItemLeave evt(this);
evt.iLeave = nOldHover;
FireEvent(evt);
}
if(m_nHoverTabItem!=-1)
{
if(m_nHoverTabItem != m_nCurrentPage)
{
GetItemRect(m_nHoverTabItem, rcItem);
InvalidateRect(rcItem);
}
EventTabItemHover evt(this);
evt.iHover = m_nHoverTabItem;
FireEvent(evt);
}
}
}
void STabCtrl::OnDestroy()
{
for(int i = GetItemCount()-1; i>=0; i--)
{
DestroyChild(m_lstPages[i]);
}
m_lstPages.RemoveAll();
}
SWindow * STabCtrl::GetPage( int iPage )
{
if( iPage < 0 || iPage>= (int)GetItemCount() ) return NULL;
return m_lstPages[iPage];
}
int STabCtrl::GetPageIndex(LPCTSTR pszName,BOOL bTitle)
{
if(bTitle)
{
for(UINT i=0;i<m_lstPages.GetCount();i++)
{
if(_tcscmp(m_lstPages[i]->GetTitle(),pszName)==0)
return i;
}
}else
{
SStringW strName = S_CT2W(pszName);
for(UINT i=0;i<m_lstPages.GetCount();i++)
{
if(m_lstPages[i]->GetName()==strName)
return i;
}
}
return -1;
}
SWindow * STabCtrl::GetPage( LPCTSTR pszName,BOOL bTitle/*=TRUE*/ )
{
int iPage = GetPageIndex(pszName,bTitle);
if(iPage == -1) return NULL;
return m_lstPages[iPage];
}
void STabCtrl::OnSliderFinish()
{
SASSERT(m_tabSlider);
DestroyChild(m_tabSlider);
m_tabSlider = NULL;
STabPage * pPage = m_lstPages[m_nCurrentPage];
SASSERT(pPage);
pPage->SetVisible(TRUE,TRUE);
}
BOOL STabCtrl::SetCurSel( int nIndex )
{
if( nIndex < 0 || nIndex> (int)GetItemCount()-1 || (m_nCurrentPage == nIndex)) return FALSE;
int nOldPage = m_nCurrentPage;
EventTabSelChanging evt(this);
evt.uOldSel=nOldPage;
evt.uNewSel=nIndex;
FireEvent(evt);
if (evt.bCancel)
return FALSE;
CRect rcItem;
GetItemRect(m_nCurrentPage, rcItem);
InvalidateRect(rcItem);
if(m_tabSlider)
{
m_tabSlider->Stop();
}
if(m_nAnimateSteps && IsVisible(TRUE) && nOldPage!=-1 && nIndex !=-1)
{
m_tabSlider = new STabSlider(this, nOldPage, nIndex, m_nAnimateSteps,m_nAniamteType,m_aniInterpolator);
}else
{
if(nOldPage!=-1)
{
GetItem(nOldPage)->SetVisible(FALSE,TRUE);
}
if(nIndex!=-1)
{
GetItem(nIndex)->SetVisible(TRUE,TRUE);
}
}
m_nCurrentPage = nIndex;
GetItemRect(m_nCurrentPage, rcItem);
InvalidateRect(rcItem);
EventTabSelChanged evt2(this);
evt2.uNewSel=nIndex;
evt2.uOldSel=nOldPage;
FireEvent(evt2);
return TRUE;
}
BOOL STabCtrl::SetCurSel( LPCTSTR pszName,BOOL bTitle/*=TRUE */)
{
int iPage = GetPageIndex(pszName,bTitle);
if(iPage == -1) return FALSE;
return SetCurSel(iPage);
}
BOOL STabCtrl::SetItemTitle( int nIndex, LPCTSTR lpszTitle )
{
STabPage* pTab = GetItem(nIndex);
if (pTab)
{
pTab->SetTitle(lpszTitle);
CRect rcTitle = GetTitleRect();
InvalidateRect(rcTitle);
return TRUE;
}
return FALSE;
}
BOOL STabCtrl::CreateChildren( pugi::xml_node xmlNode )
{
for ( pugi::xml_node xmlChild = xmlNode.first_child(); xmlChild; xmlChild = xmlChild.next_sibling())
{
InsertItem(xmlChild,-1,TRUE);
}
if(m_nCurrentPage==-1 || m_nCurrentPage>=(int)m_lstPages.GetCount())
{
m_nCurrentPage=0;
}
if(m_lstPages.GetCount()==0)
{
m_nCurrentPage=-1;
}
if(m_nCurrentPage!=-1)
{
GetItem(m_nCurrentPage)->SetVisible(TRUE);
}
return TRUE;
}
STabPage * STabCtrl::CreatePageFromXml(pugi::xml_node xmlPage)
{
if (wcscmp(xmlPage.name(),STabPage::GetClassName()) != 0) return NULL;
return (STabPage *)SApplication::getSingleton().CreateWindowByName(STabPage::GetClassName());
}
int STabCtrl::InsertItem( LPCWSTR lpContent ,int iInsert/*=-1*/)
{
pugi::xml_document xmlDoc;
if(!xmlDoc.load_buffer(lpContent,wcslen(lpContent)*sizeof(wchar_t),pugi::parse_default,pugi::encoding_utf16)) return -1;
return InsertItem(xmlDoc.first_child(),iInsert);
}
int STabCtrl::InsertItem( pugi::xml_node xmlNode,int iInsert/*=-1*/,BOOL bLoading/*=FALSE*/ )
{
STabPage *pChild = CreatePageFromXml(xmlNode);
if(!pChild) return -1;
InsertChild(pChild);
pChild->InitFromXml(xmlNode);
pChild->GetLayoutParam()->SetMatchParent(Both);
if(iInsert==-1) iInsert = (int)m_lstPages.GetCount();
m_lstPages.InsertAt(iInsert,pChild);
if(!bLoading )
{
CRect rcPage=GetChildrenLayoutRect();
pChild->Move(&rcPage);
pChild->SetVisible(FALSE,FALSE);
if(m_nCurrentPage>=iInsert) m_nCurrentPage++;
InvalidateRect(GetTitleRect());
if(m_nCurrentPage == -1) SetCurSel(iInsert);
}
OnItemInserted(pChild);
return iInsert;
}
CRect STabCtrl::GetTitleRect()
{
CRect rcTitle;
GetClientRect(rcTitle);
switch(m_nTabAlign)
{
case AlignTop:
rcTitle.bottom = rcTitle.top+ m_szTab.cy;
break;
case AlignBottom:
rcTitle.top = rcTitle.bottom- m_szTab.cy;
break;
case AlignLeft:
rcTitle.right = rcTitle.left + m_szTab.cx;
break;
case AlignRight:
rcTitle.left = rcTitle.right - m_szTab.cx;
break;
}
return rcTitle;
}
BOOL STabCtrl::GetItemRect( int nIndex, CRect &rcItem )
{
if (nIndex < 0 || nIndex >= (int)GetItemCount())
return FALSE;
CRect rcTitle = GetTitleRect();
rcItem = CRect(rcTitle.TopLeft(),m_szTab);
switch (m_nTabAlign)
{
case AlignTop:
case AlignBottom:
rcItem.OffsetRect(m_nTabPos + nIndex * (rcItem.Width()+ m_nTabInterSize),0);
break;
case AlignLeft:
case AlignRight:
rcItem.OffsetRect(0, m_nTabPos + nIndex * (rcItem.Height()+ m_nTabInterSize));
break;
}
rcItem.IntersectRect(rcItem,rcTitle);
return TRUE;
}
STabPage* STabCtrl::GetItem( int nIndex )
{
if(nIndex<0 || nIndex>= (int)GetItemCount()) return NULL;
return m_lstPages[nIndex];
}
void STabCtrl::DrawItem(IRenderTarget *pRT,const CRect &rcItem,int iItem,DWORD dwState )
{
if(rcItem.IsRectEmpty()) return;
int iState = IIF_STATE3(dwState,WndState_Normal,WndState_Hover,WndState_PushDown);
if(m_pSkinTab)
m_pSkinTab->Draw(pRT,rcItem,iState);
//根据状态从style中获得字体,颜色
IFontPtr font=m_style.GetTextFont(iState);
COLORREF crTxt = m_style.GetTextColor(iState);
CAutoRefPtr<IFont> oldFont;
if(font) pRT->SelectObject(font,(IRenderObj**)&oldFont);
COLORREF crOld = 0;
if(crTxt != CR_INVALID) crOld = pRT->SetTextColor(crTxt);
CRect rcIcon(m_ptIcon+rcItem.TopLeft(),CSize(0,0));
if(m_pSkinIcon)
{
rcIcon.right=rcIcon.left+m_pSkinIcon->GetSkinSize().cx;
rcIcon.bottom=rcIcon.top+m_pSkinIcon->GetSkinSize().cy;
int iIcon=GetItem(iItem)->GetIconIndex();
if(iIcon == -1) iIcon = iItem;
m_pSkinIcon->Draw(pRT,rcIcon,iIcon);
}
if(m_ptText.x!=-1 && m_ptText.y!=-1)
{//从指定位置开始绘制文字
if(m_txtDir == Text_Horz)
pRT->TextOut(rcItem.left+m_ptText.x,rcItem.top+m_ptText.y,GetItem(iItem)->GetTitle(),-1);
else
TextOutV(pRT,rcItem.left+m_ptText.x,rcItem.top+m_ptText.y,GetItem(iItem)->GetTitle());
}
else
{
CRect rcText=rcItem;
UINT alignStyle=m_style.GetTextAlign();
UINT align=alignStyle;
if(m_ptText.x==-1 && m_ptText.y!=-1)
{//指定了Y偏移,X居中
rcText.top+=m_ptText.y;
align=alignStyle&(DT_CENTER|DT_RIGHT|DT_SINGLELINE|DT_END_ELLIPSIS);
}
else if(m_ptText.x!=-1 && m_ptText.y==-1)
{//指定了X偏移,Y居中
rcText.left+=m_ptText.x;
align=alignStyle&(DT_VCENTER|DT_BOTTOM|DT_SINGLELINE|DT_END_ELLIPSIS);
}
if(m_txtDir == Text_Horz)
pRT->DrawText(GetItem(iItem)->GetTitle(),-1,&rcText,align);
else
DrawTextV(pRT,rcText,GetItem(iItem)->GetTitle());
}
//恢复字体,颜色
if(font) pRT->SelectObject(oldFont);
if(crTxt!=CR_INVALID) pRT->SetTextColor(crOld);
}
BOOL STabCtrl::OnUpdateToolTip( CPoint pt, SwndToolTipInfo & tipInfo )
{
int iItem = HitTest(pt);
if(iItem == -1) return FALSE;
if(GetItem(iItem)->GetToolTipText().IsEmpty()) return FALSE;
tipInfo.swnd = m_swnd;
tipInfo.dwCookie = iItem;
GetItemRect(iItem,tipInfo.rcTarget);
tipInfo.strTip = GetItem(iItem)->GetToolTipText();
return TRUE;
}
void STabCtrl::OnKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags )
{
if(nChar==VK_LEFT || nChar==VK_UP)
{
if(!SetCurSel(m_nCurrentPage-1))
SetCurSel(GetItemCount()-1);
}else if(nChar==VK_RIGHT || nChar==VK_DOWN)
{
if(!SetCurSel(m_nCurrentPage+1))
SetCurSel(0);
}else if(nChar==VK_HOME)
{
SetCurSel(0);
}else if(nChar==VK_END)
{
SetCurSel(GetItemCount()-1);
}
}
int STabCtrl::HitTest( CPoint pt )
{
int nTabCount=GetItemCount();
for (int i = 0; i < nTabCount; i ++)
{
CRect rcItem;
GetItemRect(i, rcItem);
if (rcItem.PtInRect(pt))
{
return i;
}
}
return -1;
}
void STabCtrl::OnInitFinished( pugi::xml_node xmlNode )
{
if(m_pSkinTab)
{
SIZE sz = m_pSkinTab->GetSkinSize();
if(m_szTab.cx == -1) m_szTab.cx = sz.cx;
if(m_szTab.cy == -1) m_szTab.cy = sz.cy;
}
}
void STabCtrl::UpdateChildrenPosition()
{
CRect rcPage = GetChildrenLayoutRect();
for(size_t i =0 ;i<m_lstPages.GetCount() ;i++)
{
m_lstPages[i]->Move(rcPage);
}
}
void STabCtrl::BeforePaint( IRenderTarget *pRT, SPainter &painter )
{
IFontPtr pFont = m_style.GetTextFont(0);
if(pFont)
pRT->SelectObject(pFont,(IRenderObj**)&painter.oldFont);
COLORREF crTxt = m_style.GetTextColor(0);
if(crTxt != CR_INVALID)
painter.oldTextColor = pRT->SetTextColor(crTxt);
}
void STabCtrl::TextOutV(IRenderTarget *pRT,int x,int y , const SStringT & strText)
{
SStringT strTmp = strText;
LPTSTR p = strTmp.GetBuffer(0);
while(*p)
{
LPTSTR p2 = SStringT::_tchar_traits::CharNext(p);
SIZE szWord;
pRT->MeasureText(p,(int)(p2-p),&szWord);
pRT->TextOut(x,y,p,(int)(p2-p));
p = p2;
y += szWord.cy;
}
strTmp.ReleaseBuffer();
}
SIZE STabCtrl::MeasureTextV(IRenderTarget *pRT, const SStringT & strText)
{
SIZE szRet={0,0};
SStringT strTmp = strText;
LPTSTR p = strTmp.GetBuffer(0);
while(*p)
{
LPTSTR p2 = SStringT::_tchar_traits::CharNext(p);
SIZE szWord;
pRT->MeasureText(p,(int)(p2-p),&szWord);
szRet.cx = (std::max)(szRet.cx,szWord.cx);
szRet.cy += szWord.cy;
p = p2;
}
strTmp.ReleaseBuffer();
return szRet;
}
void STabCtrl::DrawTextV(IRenderTarget *pRT, CRect rcText, const SStringT & strText)
{//only support horizontal and vertical center
SIZE szText = MeasureTextV(pRT,strText);
TextOutV(pRT,
rcText.left + (rcText.Width()-szText.cx)/2,
rcText.top + (rcText.Height()-szText.cy)/2,
strText
);
}
void STabCtrl::OnColorize(COLORREF cr)
{
__super::OnColorize(cr);
if(m_pSkinIcon) m_pSkinIcon->OnColorize(cr);
if(m_pSkinTab) m_pSkinTab->OnColorize(cr);
if(m_pSkinTabInter) m_pSkinTabInter->OnColorize(cr);
if(m_pSkinFrame) m_pSkinFrame->OnColorize(cr);
}
HRESULT STabCtrl::OnLanguageChanged()
{
__super::OnLanguageChanged();
for(int i=0;i<(int)m_lstPages.GetCount();i++)
{
STabPage *pPage = m_lstPages.GetAt(i);
pPage->m_strTitle.TranslateText();
}
InvalidateRect(GetTitleRect());
return HRESULT(3);
}
}//namespace SOUI | [
"tup17x@gmail.com"
] | tup17x@gmail.com |
8c2aee5f192862a128765e6c3a40f131f3e60eb9 | e9edf6bddfbd84747f7611f54df379a327404907 | /oglplus/enums/buffer_indexed_target_class.ipp | b25b459d98a54451c117583e79c5bbe095764345 | [] | no_license | MaikKlein/OglplusGen | cb804b192121ca0c408d97f0b5fe6e2470a8c2da | 9d416f0551c795473fcfe74b4c431354f815c93f | refs/heads/master | 2021-01-20T11:31:05.478534 | 2014-12-19T17:10:20 | 2014-12-19T17:10:20 | 28,238,420 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,928 | ipp | // File implement/oglplus/enums/buffer_indexed_target_class.ipp
//
// Automatically generated file, DO NOT modify manually.
// Edit the source 'source/enums/oglplus/buffer_indexed_target.txt'
// or the 'source/enums/make_enum.py' script instead.
//
// Copyright 2010-2014 Matus Chochlik.
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
namespace enums {
template <typename Base, template<BufferIndexedTarget> class Transform>
class EnumToClass<Base, BufferIndexedTarget, Transform>
: public Base
{
private:
Base& _base(void) { return *this; }
public:
#if defined GL_ATOMIC_COUNTER_BUFFER
# if defined AtomicCounter
# pragma push_macro("AtomicCounter")
# undef AtomicCounter
Transform<BufferIndexedTarget::AtomicCounter> AtomicCounter;
# pragma pop_macro("AtomicCounter")
# else
Transform<BufferIndexedTarget::AtomicCounter> AtomicCounter;
# endif
#endif
#if defined GL_SHADER_STORAGE_BUFFER
# if defined ShaderStorage
# pragma push_macro("ShaderStorage")
# undef ShaderStorage
Transform<BufferIndexedTarget::ShaderStorage> ShaderStorage;
# pragma pop_macro("ShaderStorage")
# else
Transform<BufferIndexedTarget::ShaderStorage> ShaderStorage;
# endif
#endif
#if defined GL_TRANSFORM_FEEDBACK_BUFFER
# if defined TransformFeedback
# pragma push_macro("TransformFeedback")
# undef TransformFeedback
Transform<BufferIndexedTarget::TransformFeedback> TransformFeedback;
# pragma pop_macro("TransformFeedback")
# else
Transform<BufferIndexedTarget::TransformFeedback> TransformFeedback;
# endif
#endif
#if defined GL_UNIFORM_BUFFER
# if defined Uniform
# pragma push_macro("Uniform")
# undef Uniform
Transform<BufferIndexedTarget::Uniform> Uniform;
# pragma pop_macro("Uniform")
# else
Transform<BufferIndexedTarget::Uniform> Uniform;
# endif
#endif
EnumToClass(void) { }
EnumToClass(Base&& base)
: Base(std::move(base))
#if defined GL_ATOMIC_COUNTER_BUFFER
# if defined AtomicCounter
# pragma push_macro("AtomicCounter")
# undef AtomicCounter
, AtomicCounter(_base())
# pragma pop_macro("AtomicCounter")
# else
, AtomicCounter(_base())
# endif
#endif
#if defined GL_SHADER_STORAGE_BUFFER
# if defined ShaderStorage
# pragma push_macro("ShaderStorage")
# undef ShaderStorage
, ShaderStorage(_base())
# pragma pop_macro("ShaderStorage")
# else
, ShaderStorage(_base())
# endif
#endif
#if defined GL_TRANSFORM_FEEDBACK_BUFFER
# if defined TransformFeedback
# pragma push_macro("TransformFeedback")
# undef TransformFeedback
, TransformFeedback(_base())
# pragma pop_macro("TransformFeedback")
# else
, TransformFeedback(_base())
# endif
#endif
#if defined GL_UNIFORM_BUFFER
# if defined Uniform
# pragma push_macro("Uniform")
# undef Uniform
, Uniform(_base())
# pragma pop_macro("Uniform")
# else
, Uniform(_base())
# endif
#endif
{ }
};
} // namespace enums
| [
"maikklein@googlemail.com"
] | maikklein@googlemail.com |
5f676a3be5f23d1f9e2ec2c6b430f5615dcb1011 | 95ae6fa9cc64bc2f537753475c1b84ae526391b1 | /source/tm/bide/bide.hpp | 93d886cafaec57facbe83b54e2bdf9ff2138cd63 | [
"BSL-1.0"
] | permissive | OctalMicrobe/technical-machine | 7deeb30cf1ff2eb730bc0ad9efc4794b30c6cf5c | bffa259bd4d069ce104efa21fef34a5342ee0755 | refs/heads/master | 2023-02-04T00:43:19.534781 | 2020-12-20T17:21:50 | 2020-12-20T17:21:50 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 971 | hpp | // Handles bide damage and when it activates
// Copyright David Stone 2020.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#include <tm/bide/damage.hpp>
#include <tm/bide/duration.hpp>
#include <tm/compress.hpp>
#include <tm/operators.hpp>
#include <tm/stat/hp.hpp>
#include <bounded/optional.hpp>
namespace technicalmachine {
struct Bide {
constexpr auto add_damage(HP::current_type const damage) {
m_damage.add(damage);
}
[[nodiscard]] constexpr auto advance_one_turn() {
return BOUNDED_CONDITIONAL(m_duration.advance_one_turn(), m_damage.release(), bounded::none);
}
friend auto operator==(Bide, Bide) -> bool = default;
friend constexpr auto compress(Bide const value) {
return compress_combine(value.m_damage, value.m_duration);
}
private:
BideDamage m_damage;
BideDuration m_duration;
};
} // namespace technicalmachine
| [
"david@doublewise.net"
] | david@doublewise.net |
8a4a52754282ace209fa52c6b2fa68d5704c9bba | 6bd42a00296bd1f710e52ae890a9abe2e2917d44 | /MTL/rpipico/MTL/Pins.h | 1994b575300d9f5acf60c3c1b8e22aad2b5760ce | [
"MIT"
] | permissive | AnotherJohnH/Platform | c460f516f3c606280b04aaf1a6c5f4bdc61f8404 | 93043bd6d530e46ed22bd0e9817c3f3cf67d7337 | refs/heads/master | 2023-08-13T23:19:09.768905 | 2023-08-02T15:43:31 | 2023-08-02T15:43:31 | 96,465,068 | 6 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,777 | h | //------------------------------------------------------------------------------
// Copyright (c) 2021 John D. Haughton
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//------------------------------------------------------------------------------
//! \brief module pins
#pragma once
#include "MTL/rp2040/Pins.h"
namespace MTL {
static const unsigned PIN_1 = rp2040::IO_PIN_0;
static const unsigned PIN_2 = rp2040::IO_PIN_1;
static const unsigned PIN_4 = rp2040::IO_PIN_2;
static const unsigned PIN_5 = rp2040::IO_PIN_3;
static const unsigned PIN_6 = rp2040::IO_PIN_4;
static const unsigned PIN_7 = rp2040::IO_PIN_5;
static const unsigned PIN_9 = rp2040::IO_PIN_6;
static const unsigned PIN_10 = rp2040::IO_PIN_7;
static const unsigned PIN_11 = rp2040::IO_PIN_8;
static const unsigned PIN_12 = rp2040::IO_PIN_9;
static const unsigned PIN_14 = rp2040::IO_PIN_10;
static const unsigned PIN_15 = rp2040::IO_PIN_11;
static const unsigned PIN_16 = rp2040::IO_PIN_12;
static const unsigned PIN_17 = rp2040::IO_PIN_13;
static const unsigned PIN_19 = rp2040::IO_PIN_14;
static const unsigned PIN_20 = rp2040::IO_PIN_15;
static const unsigned PIN_21 = rp2040::IO_PIN_16;
static const unsigned PIN_22 = rp2040::IO_PIN_17;
static const unsigned PIN_24 = rp2040::IO_PIN_18;
static const unsigned PIN_25 = rp2040::IO_PIN_19;
static const unsigned PIN_26 = rp2040::IO_PIN_20;
static const unsigned PIN_27 = rp2040::IO_PIN_21;
static const unsigned PIN_29 = rp2040::IO_PIN_22;
static const unsigned PIN_LED1 = rp2040::IO_PIN_25;
static const unsigned PIN_31 = rp2040::IO_PIN_26;
static const unsigned PIN_32 = rp2040::IO_PIN_27;
static const unsigned PIN_34 = rp2040::IO_PIN_28;
} // namespace MTL
| [
"anotherjohnh@gmail.com"
] | anotherjohnh@gmail.com |
5f00e02f6ac3b2b0fca937662fcf3ce915ecda1e | 704bc998854b57d140bccab8e16a27c79c419a9a | /BIT_Shadows/sebg.cpp | 80a070efbaa6f5d5b67808efce9980a24756b4ae | [] | no_license | annsimon/bit_shadows | 50250b343f07d15133a46f73025e8705594b4351 | 909e529ac77326c2efa0462add26e2085975d01a | refs/heads/master | 2021-01-18T13:54:30.997244 | 2014-06-14T01:45:06 | 2014-06-14T01:45:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,761 | cpp | #include "sebg.h"
Sebg::Sebg():m_sebg(), m_sebgDialog()
{
m_sebgDialog.setSebg(&m_sebg);
}
bool Sebg::run(QStringList* originals)
{
m_originals = originals;
cv::Mat currentFrame = cv::imread(m_originals->at(0).toStdString());
if(currentFrame.empty())
return false;
if( !findShadowParams() )
return false;
m_sebg.findInitialBackground(originals);
for(int i = 0; i < originals->length(); i++)
{
currentFrame = cv::imread(originals->at(i).toStdString());
if(currentFrame.empty())
continue;
m_sebg.setFrame(currentFrame);
m_sebg.findSegmentation();
saveResult(originals->at(i));
}
return true;
}
void Sebg::saveResult(QString path)
{
// get the path
QStringList components = path.split('/');
components.insert(components.length()-1,"Method2");
path = components.join("/");
std::vector<std::vector<cv::Point> > contours;
// get frames
cv::Mat shadowFrame;
cv::Mat frame;
cv::Mat contourFrame;
m_sebg.getShadowFrame(shadowFrame);
m_sebg.getFrame(frame);
m_sebg.getContourFrame(contourFrame);
// draw the shadow's contours
cv::findContours(shadowFrame,contours,CV_RETR_EXTERNAL,CV_CHAIN_APPROX_NONE);
cv::drawContours(frame,contours,-1,cv::Scalar(0,255,0),1);
// draw the segmentation's contours
cv::findContours(contourFrame,contours,CV_RETR_EXTERNAL,CV_CHAIN_APPROX_NONE);
cv::drawContours(frame,contours,-1,cv::Scalar(0,0,255),1);
// save the image
cv::imwrite(path.toStdString(), frame);
}
bool Sebg::findShadowParams()
{
m_sebgDialog.setImages( m_originals );
if( m_sebgDialog.exec() == QDialog::Accepted )
return true;
return false;
}
| [
"sbexten@web.de"
] | sbexten@web.de |
db84389771857150d76e9d30103fce1969b620c0 | d0cfe73a42bac335a9c2fb3bb1f1196cdfa0a0c3 | /C++/numthory/prime_generate/prime_gen.cpp | 828df28b4957ab68eb1496fd251dd3c898f8d0d5 | [] | no_license | Kei-phi/GitAOJ | c586aceb672c651009c975a00b878ebf921a430b | 914ad03717e05f5391978cb0528f4e892dc64356 | refs/heads/master | 2021-05-09T07:58:47.359245 | 2018-01-29T12:03:38 | 2018-01-29T12:03:38 | 119,377,237 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,266 | cpp | /*
#include <iostream>
using namespace std;
struct prime prime_generator(int);
int div_prime(int, int);
int *num;
struct prime{
int counter;
int *p;
};
int main(){
int n;
cin >> n;
struct prime ans = prime_generator(n);
for(int k = 0; k <= ans.counter; k++){
cout << ans.p[k] << " ";
}
cout << endl;
delete [] num;
return 0;
}
struct prime prime_generator(int n){
num = new int[n];
num[0] = 0;
int j = 0;
for(int i = 2; i <= n; i++){
if(n == 1){
break;
} else{
if(div_prime(i, j)){
num[j] = i;
j++;
} else{
}
}
}
return (struct prime){j, num};
}
int div_prime(int i, int j){
for(int k = 0; k <= j; j++){
if(i % num[k] == 0){
return 0;
} else {
}
}
return 1;
}
*/
/*
class Prime {
public:
int prime;
int counter;
Prime ();
};
Prime::Prime() {
int prime = 0;
int counter = 0;
}
class Prime prime_generator (int n) {
class Prime data;
if (n =< 1){
return data;
} else if (n == 2) {
return data.;
}
}
*/
// 配列は返せない
// class か struct を使うしかない
// でもその数が素数かどうかのみ判定して,素数だったら配列の次に入れる,みたいなプログラムでもいいのでは?
// 配列は prime data とかいってグローバルに宣言してですよね
// りょー それで組むわ
#include <iostream>
using namespace std;
#define Max 1024
int judge_prime (int);
bool div_prime (int);
int prime_data[Max];
int main () {
int num;
cin >> num;
int counter = 0;
for (int i = 0; i < num; i++) {
if (judge_prime(i) != 0){
prime_data[counter] = i;
counter++;
}
}
int j = 0;
while (prime_data[j] != 0){
cout << prime_data[j] << " ";
j++;
}
cout << endl;
return 0;
}
int judge_prime(int n) {
int temp = -1;
if (n <= 1) {
return 0;
} else if (n == 2) {
return 2;
} else if (n % 2 == 0) {
return 0;
} else {
if (div_prime(n)){
return n;
} else {
return 0;
}
}
}
bool div_prime (int n) {
int j = 0;
while(prime_data[j] != 0) {
if (n % prime_data[j] == 0){
return false;
} else {
j++;
}
}
return true;
}
| [
"okku125@gmail.com"
] | okku125@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.