blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 3
264
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
85
| license_type
stringclasses 2
values | repo_name
stringlengths 5
140
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 905
values | visit_date
timestamp[us]date 2015-08-09 11:21:18
2023-09-06 10:45:07
| revision_date
timestamp[us]date 1997-09-14 05:04:47
2023-09-17 19:19:19
| committer_date
timestamp[us]date 1997-09-14 05:04:47
2023-09-06 06:22:19
| github_id
int64 3.89k
681M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us]date 2012-06-07 00:51:45
2023-09-14 21:58:39
⌀ | gha_created_at
timestamp[us]date 2008-03-27 23:40:48
2023-08-21 23:17:38
⌀ | gha_language
stringclasses 141
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
10.4M
| extension
stringclasses 115
values | content
stringlengths 3
10.4M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
158
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b0e9fbcf2b88a0b56297a9c27fe63c162376ddf6 | 9823d287a4ac8f526c529b7f27a154cbe14251fd | /src/Log.hpp | 62fd4c52bbabde7eb4ad5fd3be2fb15d70f459a9 | [
"BSD-3-Clause"
] | permissive | schmidma/microSDC | b2775e369aca27dc81af35199c264a76169216d1 | 47a47472f4f47adf03db116b3a95261480a13914 | refs/heads/master | 2021-05-18T11:55:48.382124 | 2020-09-22T09:54:53 | 2020-09-22T09:54:53 | 251,234,796 | 0 | 0 | BSD-3-Clause | 2020-03-30T07:40:36 | 2020-03-30T07:40:35 | null | UTF-8 | C++ | false | false | 2,844 | hpp | #pragma once
#include <iostream>
/// @brief LogLevel describes the level of severity of a log message
enum class LogLevel
{
DEBUG,
INFO,
WARNING,
ERROR,
NONE
};
struct None
{
};
template <typename List>
struct LogData
{
List list;
};
template <typename Begin, typename Value>
constexpr LogData<std::pair<Begin&&, Value&&>> operator<<(LogData<Begin>&& begin,
Value&& value) noexcept
{
return {{std::forward<Begin>(begin.list), std::forward<Value>(value)}};
}
template <typename Begin, size_t n>
constexpr LogData<std::pair<Begin&&, const char*>> operator<<(LogData<Begin>&& begin,
const char (&value)[n]) noexcept
{
return {{std::forward<Begin>(begin.list), value}};
}
using PfnManipulator = std::ostream& (*)(std::ostream&);
template <typename Begin>
constexpr LogData<std::pair<Begin&&, PfnManipulator>> operator<<(LogData<Begin>&& begin,
PfnManipulator value) noexcept
{
return {{std::forward<Begin>(begin.list), value}};
}
/// @brief Log models a simple logger; logging to an std::ostream
class Log
{
private:
/// @brief writes an LogData to the output
/// @param os the output stream to write to
/// @param data the templated list of data to log
template <typename Begin, typename Last>
static void output(std::ostream& os, std::pair<Begin, Last>&& data)
{
output(os, std::move(data.first));
os << data.second;
}
/// @brief list termination for the None LogData
static inline void output(std::ostream& os, None /*unused*/) {}
/// the lowest log level this logger is writing to the output
static LogLevel logLevel__;
public:
/// @brief sets the lowest log level this logger is writing to its output
static void setLogLevel(LogLevel level);
/// @brief logs data to the output
/// @param file the filename the log command was issued
/// @param line the line of the file the log statement was issued
/// @param data the data to log to the output
template <LogLevel level, typename List>
static void log(const char* file, int line, LogData<List>&& data)
{
if (level < logLevel__)
{
return;
}
std::cout << "\x1B[";
if constexpr (level == LogLevel::ERROR)
{
std::cout << "31m";
}
else if constexpr (level == LogLevel::WARNING)
{
std::cout << "33m";
}
else if constexpr (level == LogLevel::INFO)
{
std::cout << "32m";
}
else
{
std::cout << "37m";
}
std::cout << file << ":" << line << ": ";
output(std::cout, std::move(data.list));
std::cout << "\033[0m";
std::cout << std::endl;
}
};
#define LOG(level, msg) (Log::log<level>(__FILE__, __LINE__, LogData<None>() << msg))
| [
"[email protected]"
] | |
20f3f8e42ecd116ff4f8ac4dacad6f6fafe380e7 | 9b8a48b8cfb58711d091010445dd377d9d3247aa | /XLN/Server/ServerClientApplication.cpp | d64512383eefbc2755cd300e5f888d08bc13f5e2 | [] | no_license | rexlien/XLN | 8a96c2fe7e7076214692723325594614f424af5f | 38d5656225b3ce16f91a54a74419468bcf343fee | refs/heads/master | 2020-04-08T22:24:05.205782 | 2019-01-30T03:52:45 | 2019-01-30T03:52:45 | 159,785,856 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,186 | cpp | #include "ServerClientApplication.h"
#include <folly/io/async/EventBaseManager.h>
#include <folly/io/async/AsyncServerSocket.h>
#include <XLN/Core/Framework/System.h>
#include <XLN/Core/Foundation/ServiceMgr.h>
#include <XLN/Server/ServerClientExecutorService.h>
#undef signal_set
#include <boost/asio.hpp>
using namespace XLN;
void ServerClientApplication::Main(int argc, char** argv)
{
XGf::Application::Main(argc, argv);
boost::asio::io_service io_service;
#if (XLN_PLATFORM == XLN_PLATFORM_WIN32)
boost::asio::signal_set termSignal(io_service, SIGINT, SIGTERM, SIGBREAK);
#else
boost::asio::signal_set termSignal(io_service, SIGINT, SIGTERM);
#endif
termSignal.async_wait(
[&io_service](
const boost::system::error_code& error,
int signal_number)
{
std::cout << "Got signal " << signal_number << "; "
"stopping io_service." << std::endl;
XGf::System::Shutdown();
io_service.stop();
});
io_service.run();
}
void ServerClientApplication::OnInitService()
{
auto executorService = XLN_OBJ_NEW ServerClientExecutorService();
XCr::ServiceMgr::GetActiveServiceMgr()->RegisterService(executorService);
}
| [
""
] | |
95c18bfc45920cc67532f313dbf6e5aa673900a1 | 30ed20d82d5dc8a7d74e0ffac8259ab6c428bcae | /tensorflow/compiler/xla/layout_util_test.cc | 16e47453e1fe1cf88e1d39ef7e17deee723395f6 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"BSD-2-Clause"
] | permissive | mycolors/tensorflow | 697b35c772ebb296414978c576461be0d430ff0d | a69d8f063208f96598327cdc5f3ccec17be2608c | refs/heads/master | 2022-10-14T20:10:34.056431 | 2022-09-27T09:02:56 | 2022-09-27T09:08:16 | 122,425,023 | 0 | 0 | Apache-2.0 | 2018-02-22T03:15:57 | 2018-02-22T03:15:57 | null | UTF-8 | C++ | false | false | 22,483 | cc | /* Copyright 2017 The TensorFlow Authors. 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 "tensorflow/compiler/xla/layout_util.h"
#include <sstream>
#include "tensorflow/compiler/xla/shape_util.h"
#include "tensorflow/compiler/xla/test_helpers.h"
#include "tensorflow/tsl/platform/status_matchers.h"
namespace xla {
namespace {
class LayoutUtilTest : public ::testing::Test {
protected:
Shape MakeShapeWithLayout(
PrimitiveType element_type, absl::Span<const int64_t> dimensions,
absl::Span<const int64_t> minor_to_major,
absl::Span<const DimLevelType> dim_level_types = {}) {
Shape shape = ShapeUtil::MakeShape(element_type, dimensions);
*shape.mutable_layout() =
LayoutUtil::MakeLayout(minor_to_major, dim_level_types);
return shape;
}
};
TEST_F(LayoutUtilTest, TupleLayoutComparison) {
Shape shape =
ShapeUtil::MakeTupleShape({MakeShapeWithLayout(F32, {2, 3}, {0, 1})});
Shape other_shape =
ShapeUtil::MakeTupleShape({MakeShapeWithLayout(F32, {2, 2}, {0, 1})});
Shape tuple0 = ShapeUtil::MakeTupleShape({});
Shape tuple1 = ShapeUtil::MakeTupleShape({shape});
Shape tuple2 = ShapeUtil::MakeTupleShape({shape, shape});
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(tuple0, tuple0));
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(tuple0, tuple1));
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(tuple0, tuple2));
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(tuple1, tuple0));
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(tuple2, tuple0));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(tuple1, tuple1));
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(tuple1, tuple2));
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(tuple2, tuple1));
Shape other_tuple2 = ShapeUtil::MakeTupleShape({shape, other_shape});
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(tuple2, tuple2));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(tuple2, other_tuple2));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(other_tuple2, tuple2));
}
TEST_F(LayoutUtilTest, CopyLayoutDenseArray) {
Shape src = MakeShapeWithLayout(F32, {2, 3}, {0, 1});
Shape dst = MakeShapeWithLayout(F32, {2, 3}, {1, 0});
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_IS_OK(LayoutUtil::CopyLayoutBetweenShapes(src, &dst));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
// Should work if destination has no layout.
dst.clear_layout();
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_IS_OK(LayoutUtil::CopyLayoutBetweenShapes(src, &dst));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
// If source is cleared, then destination should be cleared.
src.clear_layout();
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_TRUE(dst.has_layout());
EXPECT_IS_OK(LayoutUtil::CopyLayoutBetweenShapes(src, &dst));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_FALSE(dst.has_layout());
}
TEST_F(LayoutUtilTest, CopyLayoutCSRArray) {
Shape src =
MakeShapeWithLayout(F32, {2, 3}, {1, 0}, {DIM_DENSE, DIM_COMPRESSED});
Shape dst = MakeShapeWithLayout(F32, {2, 3}, {0, 1});
EXPECT_TRUE(LayoutUtil::IsSparseArray(src));
EXPECT_FALSE(LayoutUtil::IsSparseArray(dst));
EXPECT_TRUE(LayoutUtil::IsCSRArray(src));
EXPECT_FALSE(LayoutUtil::IsCSRArray(dst));
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_IS_OK(LayoutUtil::CopyLayoutBetweenShapes(src, &dst));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_TRUE(LayoutUtil::IsCSRArray(dst));
// Should work if destination has no layout.
dst.clear_layout();
EXPECT_FALSE(LayoutUtil::IsCSRArray(dst));
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_IS_OK(LayoutUtil::CopyLayoutBetweenShapes(src, &dst));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_TRUE(LayoutUtil::IsCSRArray(dst));
// Convert dst to a CSC array with dim 0 minor layout.
*dst.mutable_layout()->mutable_minor_to_major() = {0, 1};
EXPECT_TRUE(LayoutUtil::IsCSCArray(dst));
EXPECT_FALSE(LayoutUtil::IsCSRArray(dst));
EXPECT_IS_OK(LayoutUtil::CopyLayoutBetweenShapes(src, &dst));
*src.mutable_layout()->mutable_physical_shape() = ShapeUtil::MakeTupleShape({
ShapeUtil::MakeShapeWithLayout(U32, {2}, {0}, {}, {Tile({100})}),
ShapeUtil::MakeShapeWithLayout(U32, {4}, {0}, {}, {Tile({100})}),
ShapeUtil::MakeShapeWithLayout(F32, {4}, {0}, {}, {Tile({100})}),
});
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(src, dst));
dst.clear_layout();
EXPECT_IS_OK(LayoutUtil::CopyLayoutBetweenShapes(src, &dst));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
// If source is cleared, then destination should be cleared.
src.clear_layout();
EXPECT_FALSE(LayoutUtil::IsCSRArray(src));
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_TRUE(dst.has_layout());
EXPECT_IS_OK(LayoutUtil::CopyLayoutBetweenShapes(src, &dst));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_FALSE(dst.has_layout());
EXPECT_FALSE(LayoutUtil::IsCSRArray(dst));
}
TEST_F(LayoutUtilTest, CopyLayoutTuple) {
Shape src = ShapeUtil::MakeTupleShape(
{MakeShapeWithLayout(F32, {2, 3}, {0, 1}),
MakeShapeWithLayout(F32, {42, 123}, {1, 0}),
ShapeUtil::MakeTupleShape(
{MakeShapeWithLayout(F32, {}, {}),
MakeShapeWithLayout(F32, {1, 2, 3}, {0, 2, 1})})});
Shape dst = ShapeUtil::MakeTupleShape(
{MakeShapeWithLayout(F32, {2, 3}, {1, 0}),
MakeShapeWithLayout(F32, {42, 123}, {1, 0}),
ShapeUtil::MakeTupleShape(
{MakeShapeWithLayout(F32, {}, {}),
MakeShapeWithLayout(F32, {1, 2, 3}, {1, 2, 0})})});
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_IS_OK(LayoutUtil::CopyLayoutBetweenShapes(src, &dst));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
}
TEST_F(LayoutUtilTest, CopyLayoutNotCompatibleSameRank) {
Shape src = MakeShapeWithLayout(F32, {123, 42, 7}, {2, 0, 1});
Shape dst = MakeShapeWithLayout(F32, {2, 3, 5}, {1, 0});
ASSERT_IS_OK(LayoutUtil::CopyLayoutBetweenShapes(src, &dst));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
}
TEST_F(LayoutUtilTest, CopyLayoutNotCompatibleDifferentRank) {
Shape src = MakeShapeWithLayout(F32, {123, 42, 7}, {2, 0, 1});
Shape dst = MakeShapeWithLayout(F32, {2, 3}, {1, 0});
auto status = LayoutUtil::CopyLayoutBetweenShapes(src, &dst);
EXPECT_FALSE(status.ok());
EXPECT_THAT(status.error_message(),
::testing::ContainsRegex("cannot copy layout from shape"));
}
TEST_F(LayoutUtilTest, CopyLayoutNotCompatibleTuple) {
Shape src =
ShapeUtil::MakeTupleShape({MakeShapeWithLayout(F32, {2, 3}, {0, 1}),
MakeShapeWithLayout(F32, {42, 123}, {1, 0}),
ShapeUtil::MakeTupleShape({MakeShapeWithLayout(
F32, {1, 2, 3}, {0, 2, 1})})});
Shape dst = ShapeUtil::MakeTupleShape(
{MakeShapeWithLayout(F32, {2, 3}, {1, 0}),
MakeShapeWithLayout(F32, {42, 123}, {1, 0}),
ShapeUtil::MakeTupleShape(
{MakeShapeWithLayout(F32, {}, {}),
MakeShapeWithLayout(F32, {1, 2, 3}, {1, 2, 0})})});
auto status = LayoutUtil::CopyLayoutBetweenShapes(src, &dst);
EXPECT_FALSE(status.ok());
EXPECT_THAT(status.error_message(),
::testing::ContainsRegex("cannot copy layout from shape"));
}
TEST_F(LayoutUtilTest, CopyLayoutBogusLayout) {
Shape src = ShapeUtil::MakeShape(F32, {2, 3});
Shape dst = ShapeUtil::MakeShape(F32, {2, 3});
// Set layout to invalid value.
*src.mutable_layout() = LayoutUtil::MakeLayout({1, 2, 3, 4});
auto status = LayoutUtil::CopyLayoutBetweenShapes(src, &dst);
EXPECT_FALSE(status.ok());
EXPECT_THAT(
status.error_message(),
::testing::ContainsRegex("layout minor_to_major field contains .* "
"elements, but shape is rank"));
}
TEST_F(LayoutUtilTest, CopyTokenLayout) {
Shape src = ShapeUtil::MakeTokenShape();
Shape dst = ShapeUtil::MakeTokenShape();
// Layouts are trivially the same for token types and copying layouts should
// be a nop.
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_IS_OK(LayoutUtil::CopyLayoutBetweenShapes(src, &dst));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
}
TEST_F(LayoutUtilTest, CopyOpaqueLayout) {
Shape src = ShapeUtil::MakeOpaqueShape();
Shape dst = ShapeUtil::MakeOpaqueShape();
// Layouts are trivially the same for opaque types and copying layouts should
// be a nop.
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_IS_OK(LayoutUtil::CopyLayoutBetweenShapes(src, &dst));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
}
TEST_F(LayoutUtilTest, CopyTupleLayoutWithTokenAndOpaque) {
Shape src = ShapeUtil::MakeTupleShape(
{MakeShapeWithLayout(F32, {2, 3}, {0, 1}),
MakeShapeWithLayout(F32, {42, 123}, {1, 0}), ShapeUtil::MakeTokenShape(),
ShapeUtil::MakeTupleShape(
{ShapeUtil::MakeOpaqueShape(), MakeShapeWithLayout(F32, {}, {}),
MakeShapeWithLayout(F32, {1, 2, 3}, {0, 2, 1})})});
Shape dst = ShapeUtil::MakeTupleShape(
{MakeShapeWithLayout(F32, {2, 3}, {1, 0}),
MakeShapeWithLayout(F32, {42, 123}, {1, 0}), ShapeUtil::MakeTokenShape(),
ShapeUtil::MakeTupleShape(
{ShapeUtil::MakeOpaqueShape(), MakeShapeWithLayout(F32, {}, {}),
MakeShapeWithLayout(F32, {1, 2, 3}, {1, 2, 0})})});
EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(src, dst));
EXPECT_IS_OK(LayoutUtil::CopyLayoutBetweenShapes(src, &dst));
EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(src, dst));
}
TEST_F(LayoutUtilTest, ClearLayoutTuple) {
Shape shape = ShapeUtil::MakeTupleShape(
{MakeShapeWithLayout(F32, {2, 3}, {1, 0}),
MakeShapeWithLayout(F32, {42, 123}, {1, 0}),
ShapeUtil::MakeTupleShape(
{MakeShapeWithLayout(F32, {}, {}),
MakeShapeWithLayout(F32, {1, 2, 3}, {1, 2, 0})})});
EXPECT_TRUE(LayoutUtil::HasLayout(shape));
EXPECT_TRUE(shape.tuple_shapes(0).has_layout());
EXPECT_TRUE(shape.tuple_shapes(2).tuple_shapes(1).has_layout());
LayoutUtil::ClearLayout(&shape);
EXPECT_FALSE(LayoutUtil::HasLayout(shape));
EXPECT_FALSE(shape.tuple_shapes(0).has_layout());
EXPECT_FALSE(shape.tuple_shapes(2).tuple_shapes(1).has_layout());
}
TEST_F(LayoutUtilTest, ClearLayoutOpaqueAndToken) {
// Opaque and token types trivially have layouts.
for (Shape shape :
{ShapeUtil::MakeOpaqueShape(), ShapeUtil::MakeTokenShape()}) {
EXPECT_TRUE(LayoutUtil::HasLayout(shape));
LayoutUtil::ClearLayout(&shape);
EXPECT_TRUE(LayoutUtil::HasLayout(shape));
}
}
TEST_F(LayoutUtilTest, SetToDefaultLayoutTuple) {
Shape shape = ShapeUtil::MakeTupleShape(
{MakeShapeWithLayout(F32, {2, 3, 4}, {1, 0, 2}),
MakeShapeWithLayout(F32, {42, 123, 7}, {1, 2, 0}),
ShapeUtil::MakeTupleShape(
{MakeShapeWithLayout(F32, {}, {}),
MakeShapeWithLayout(F32, {1, 2, 3, 4}, {3, 1, 2, 0})})});
EXPECT_FALSE(LayoutUtil::Equal(shape.tuple_shapes(0).layout(),
shape.tuple_shapes(1).layout()));
LayoutUtil::SetToDefaultLayout(&shape);
EXPECT_TRUE(LayoutUtil::Equal(shape.tuple_shapes(0).layout(),
shape.tuple_shapes(1).layout()));
EXPECT_TRUE(LayoutUtil::Equal(
LayoutUtil::GetDefaultLayoutForShape(shape.tuple_shapes(0)),
shape.tuple_shapes(1).layout()));
}
TEST_F(LayoutUtilTest, DefaultLayoutGettersMajorToMinor) {
EXPECT_TRUE(LayoutUtil::Equal(LayoutUtil::MakeLayout({1, 0}),
LayoutUtil::GetDefaultLayoutForR2()));
EXPECT_TRUE(LayoutUtil::Equal(LayoutUtil::MakeLayout({2, 1, 0}),
LayoutUtil::GetDefaultLayoutForR3()));
EXPECT_TRUE(LayoutUtil::Equal(LayoutUtil::MakeLayout({3, 2, 1, 0}),
LayoutUtil::GetDefaultLayoutForR4()));
EXPECT_TRUE(
LayoutUtil::Equal(LayoutUtil::MakeLayout({4, 3, 2, 1, 0}),
LayoutUtil::GetDefaultLayoutForShape(
ShapeUtil::MakeShape(F32, {10, 20, 30, 15, 25}))));
}
TEST_F(LayoutUtilTest, MakeDescending) {
EXPECT_TRUE(LayoutUtil::Equal(LayoutUtil::MakeDescendingLayout(5),
LayoutUtil::MakeLayout({4, 3, 2, 1, 0})));
EXPECT_TRUE(LayoutUtil::Equal(LayoutUtil::MakeDescendingLayout(1),
LayoutUtil::MakeLayout({0})));
EXPECT_TRUE(LayoutUtil::Equal(LayoutUtil::MakeDescendingLayout(0),
LayoutUtil::MakeLayout({})));
}
TEST_F(LayoutUtilTest, MakeAscending) {
EXPECT_TRUE(LayoutUtil::Equal(LayoutUtil::MakeAscendingLayout(5),
LayoutUtil::MakeLayout({0, 1, 2, 3, 4})));
EXPECT_TRUE(LayoutUtil::Equal(LayoutUtil::MakeAscendingLayout(1),
LayoutUtil::MakeLayout({0})));
EXPECT_TRUE(LayoutUtil::Equal(LayoutUtil::MakeAscendingLayout(0),
LayoutUtil::MakeLayout({})));
}
TEST_F(LayoutUtilTest, HumanStringWithTiling) {
Shape shape = ShapeUtil::MakeShapeWithLayout(F32, {2, 3, 4}, {0, 1, 2});
Tile* tile;
// No tiling.
EXPECT_EQ(ShapeUtil::HumanStringWithLayout(shape), "f32[2,3,4]{0,1,2}");
// 2D tile.
tile = shape.mutable_layout()->add_tiles();
tile->add_dimensions(512);
tile->add_dimensions(1024);
EXPECT_EQ(ShapeUtil::HumanStringWithLayout(shape),
"f32[2,3,4]{0,1,2:T(512,1024)}");
// 1D tile.
shape.mutable_layout()->clear_tiles();
tile = shape.mutable_layout()->add_tiles();
tile->add_dimensions(512);
EXPECT_EQ(ShapeUtil::HumanStringWithLayout(shape),
"f32[2,3,4]{0,1,2:T(512)}");
// 2 tiles.
shape = ShapeUtil::MakeShapeWithLayout(BF16, {2, 3, 4}, {1, 2, 0});
tile = shape.mutable_layout()->add_tiles();
tile->add_dimensions(16);
tile->add_dimensions(256);
tile = shape.mutable_layout()->add_tiles();
tile->add_dimensions(2);
tile->add_dimensions(1);
EXPECT_EQ(ShapeUtil::HumanStringWithLayout(shape),
"bf16[2,3,4]{1,2,0:T(16,256)(2,1)}");
// PRED with element size of 8 bits.
shape = ShapeUtil::MakeShapeWithLayout(PRED, {8, 8, 8}, {0, 2, 1});
tile = shape.mutable_layout()->add_tiles();
tile->add_dimensions(8);
tile->add_dimensions(128);
EXPECT_EQ(ShapeUtil::HumanStringWithLayout(shape),
"pred[8,8,8]{0,2,1:T(8,128)}");
// PRED with element size of 32 bits.
shape.mutable_layout()->clear_tiles();
tile = shape.mutable_layout()->add_tiles();
tile->add_dimensions(8);
tile->add_dimensions(128);
shape.mutable_layout()->set_element_size_in_bits(32);
EXPECT_EQ(ShapeUtil::HumanStringWithLayout(shape),
"pred[8,8,8]{0,2,1:T(8,128)E(32)}");
// No tile. PRED with element size of 32 bits.
shape.mutable_layout()->clear_tiles();
shape.mutable_layout()->set_element_size_in_bits(32);
EXPECT_EQ(ShapeUtil::HumanStringWithLayout(shape),
"pred[8,8,8]{0,2,1:E(32)}");
// Tile with negative dimension size for combining dimensions.
shape = ShapeUtil::MakeShapeWithLayout(BF16, {2, 3, 1004}, {2, 1, 0});
tile = shape.mutable_layout()->add_tiles();
tile->add_dimensions(2);
tile->add_dimensions(Tile::kCombineDimension);
tile->add_dimensions(128);
EXPECT_EQ(ShapeUtil::HumanStringWithLayout(shape),
"bf16[2,3,1004]{2,1,0:T(2,*,128)}");
// Tile with two negative dimensions.
shape = ShapeUtil::MakeShapeWithLayout(BF16, {8, 2, 3, 1004}, {3, 2, 1, 0});
tile = shape.mutable_layout()->add_tiles();
tile->add_dimensions(2);
tile->add_dimensions(Tile::kCombineDimension);
tile->add_dimensions(Tile::kCombineDimension);
tile->add_dimensions(128);
EXPECT_EQ(ShapeUtil::HumanStringWithLayout(shape),
"bf16[8,2,3,1004]{3,2,1,0:T(2,*,*,128)}");
}
TEST_F(LayoutUtilTest, ValidateLayout_ValidArrayLayout) {
Shape shape = ShapeUtil::MakeShapeWithLayout(F32, {2, 3}, {0, 1});
auto status =
LayoutUtil::ValidateLayoutInShape(shape, /*allow_missing_layouts=*/false);
EXPECT_TRUE(status.ok());
status =
LayoutUtil::ValidateLayoutInShape(shape, /*allow_missing_layouts=*/true);
EXPECT_TRUE(status.ok());
}
TEST_F(LayoutUtilTest, ValidateLayout_InvalidArrayLayout) {
Shape shape = ShapeUtil::MakeShape(F32, {2, 3});
*shape.mutable_layout() = LayoutUtil::MakeLayout({0, 1, 2});
auto status =
LayoutUtil::ValidateLayoutInShape(shape, /*allow_missing_layouts=*/false);
EXPECT_FALSE(status.ok());
EXPECT_THAT(status.error_message(),
::testing::HasSubstr("layout minor_to_major field "
"contains 3 elements, but shape is rank 2"));
status =
LayoutUtil::ValidateLayoutInShape(shape, /*allow_missing_layouts=*/true);
EXPECT_FALSE(status.ok());
EXPECT_THAT(status.error_message(),
::testing::HasSubstr("layout minor_to_major field "
"contains 3 elements, but shape is rank 2"));
}
TEST_F(LayoutUtilTest, ValidateLayout_InvalidDimLevelTypes) {
Shape shape = ShapeUtil::MakeShape(F32, {2, 3});
*shape.mutable_layout() = LayoutUtil::MakeLayout({0, 1});
*shape.mutable_layout()->mutable_dim_level_types() = {DIM_DENSE, DIM_DENSE,
DIM_DENSE};
auto status =
LayoutUtil::ValidateLayoutInShape(shape, /*allow_missing_layouts=*/false);
EXPECT_FALSE(status.ok());
EXPECT_THAT(status.error_message(),
::testing::HasSubstr("layout dim_level_types field "
"contains 3 elements, but shape is rank 2"));
status =
LayoutUtil::ValidateLayoutInShape(shape, /*allow_missing_layouts=*/true);
EXPECT_FALSE(status.ok());
EXPECT_THAT(status.error_message(),
::testing::HasSubstr("layout dim_level_types field "
"contains 3 elements, but shape is rank 2"));
}
TEST_F(LayoutUtilTest, ValidateLayout_MissingArrayLayout) {
Shape shape = ShapeUtil::MakeShape(F32, {2, 3});
LayoutUtil::ClearLayout(&shape);
auto status =
LayoutUtil::ValidateLayoutInShape(shape, /*allow_missing_layouts=*/false);
EXPECT_FALSE(status.ok());
EXPECT_THAT(status.error_message(),
::testing::HasSubstr("shape f32[2,3] does not have a layout"));
status =
LayoutUtil::ValidateLayoutInShape(shape, /*allow_missing_layouts=*/true);
EXPECT_TRUE(status.ok());
}
TEST_F(LayoutUtilTest, ValidateLayout_Sparse) {
Shape shape = ShapeUtil::MakeShape(F32, {2, 3});
*shape.mutable_layout() = LayoutUtil::MakeLayout(
{1, 0}, {DIM_DENSE, DIM_COMPRESSED}, {Tile({10, 10})});
EXPECT_THAT(LayoutUtil::ValidateLayoutInShape(shape),
tsl::testing::StatusIs(
tensorflow::error::INVALID_ARGUMENT,
::testing::HasSubstr(
"layout has tiles, but the shape is a sparse array")));
shape.mutable_layout()->clear_tiles();
EXPECT_THAT(LayoutUtil::ValidateLayoutInShape(shape), tsl::testing::IsOk());
*shape.mutable_layout()->mutable_physical_shape() =
ShapeUtil::MakeShape(F32, {6});
EXPECT_THAT(LayoutUtil::ValidateLayoutInShape(shape), tsl::testing::IsOk());
*shape.mutable_layout()
->mutable_physical_shape()
->mutable_layout()
->mutable_physical_shape() = ShapeUtil::MakeShape(S32, {10});
EXPECT_THAT(LayoutUtil::ValidateLayoutInShape(shape),
tsl::testing::StatusIs(
tensorflow::error::INVALID_ARGUMENT,
::testing::HasSubstr("layout has a physical_shape, whose "
"layout also has a physical shape")));
shape.mutable_layout()->mutable_physical_shape()->clear_layout();
shape.mutable_layout()->clear_dim_level_types();
EXPECT_THAT(
LayoutUtil::ValidateLayoutInShape(shape),
tsl::testing::StatusIs(
tensorflow::error::INVALID_ARGUMENT,
::testing::HasSubstr(
"layout has a physical_shape, but is not a sparse array")));
}
TEST_F(LayoutUtilTest, ValidateLayout_TupleSubshapesWithMissingLayouts) {
Shape sub_1_1_1 = ShapeUtil::MakeShape(F32, {1, 2});
Shape sub_1_1 = ShapeUtil::MakeTupleShape({sub_1_1_1});
Shape sub_1_2 = ShapeUtil::MakeShape(F32, {1, 2});
LayoutUtil::ClearLayout(&sub_1_2);
Shape sub_1 = ShapeUtil::MakeTupleShape({sub_1_1, sub_1_2});
Shape sub_2_1 = ShapeUtil::MakeShape(F32, {9});
LayoutUtil::ClearLayout(&sub_2_1);
Shape sub_2 = ShapeUtil::MakeTupleShape({sub_2_1});
Shape shape = ShapeUtil::MakeTupleShape({sub_1, sub_2});
auto status =
LayoutUtil::ValidateLayoutInShape(shape, /*allow_missing_layouts=*/false);
EXPECT_FALSE(status.ok());
EXPECT_THAT(status.error_message(),
::testing::HasSubstr("shape f32[1,2] does not have a layout"));
status =
LayoutUtil::ValidateLayoutInShape(shape, /*allow_missing_layouts=*/true);
EXPECT_TRUE(status.ok());
// Add invalid layout on one of sub-shapes.
*shape.mutable_tuple_shapes(1)->mutable_tuple_shapes(0)->mutable_layout() =
LayoutUtil::MakeLayout({0, 2, 3});
status =
LayoutUtil::ValidateLayoutInShape(shape, /*allow_missing_layouts=*/true);
EXPECT_FALSE(status.ok());
EXPECT_THAT(status.error_message(),
::testing::HasSubstr("layout minor_to_major field "
"contains 3 elements, but shape is rank 1"));
}
TEST_F(LayoutUtilTest, MoveDimToMajor) {
const Layout layout = LayoutUtil::MakeLayout({2, 1, 0});
Layout new_layout = LayoutUtil::MoveDimToMajor(layout, 0);
EXPECT_EQ(new_layout, layout);
new_layout = LayoutUtil::MoveDimToMajor(layout, 1);
EXPECT_EQ(new_layout, LayoutUtil::MakeLayout({2, 0, 1}));
}
} // namespace
} // namespace xla
| [
"[email protected]"
] | |
7afa7346baea4d39bb822823e7fb688d59b0f9ec | 9099a81792f835956702bde8dd5e212c6eeabf58 | /Gunz/ZSoundEngine.cpp | 6f1ae05a44557a6ce4e01e899a2771bc3e10815d | [] | no_license | happyj/RefinedGunz | 352be7758a9aef2882d248cf7f0abba59f8a52a1 | 3ccaf13c79a1244df161d5b33e36e97bca254ba0 | refs/heads/master | 2021-01-22T19:59:04.906291 | 2017-03-04T01:22:47 | 2017-03-04T01:35:53 | null | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 36,210 | cpp | #include "stdafx.h"
#include "ZGameInterface.h"
#include "ZGame.h"
#include "ZSoundEngine.h"
#include "MDebug.h"
#include "RealSpace2.h"
#include "MMatchItem.h"
#include "ZConfiguration.h"
#include "Physics.h"
#include "Fileinfo.h"
#include "ZApplication.h"
#include "ZSoundFMod.h"
#include "MMath.h"
#include "ZInitialLoading.h"
#include "RBspObject.h"
_USING_NAMESPACE_REALSPACE2
#ifdef _DEBUG
#define _SOUND_LOG
#endif
extern ZGame* m_gGame;
#define ZDEF_MINDISTANCE 300.0f // 3m
#define ZDEF_MAXDISTANCE 4000.f // 40m
#define ZDEF_MAXDISTANCESQ 16000000.F
#define ZDEF_MAX_DISTANCE_PRIORITY 100
#define ZDEF_ROLLFACTOR 1.0f
// Sound FX
#define SOUNDEFFECT_DIR "sound/effect/"
#define SOUNDEFFECT_EXT "*.wav"
#define SOUND_OPTION_FILE_NAME "SoundOption.xml"
#define SOUNDEFFECT_XML "sound/effect/effect.xml"
#define SOUNDNPC_DIR "sound/npc/"
#define DEFAULT_SOUND_FRAME 30
#ifdef _BIRDSOUND
void ZSoundEngine::OnCreate()
{
SetRollFactor(1.0f);
SetDistanceFactor(100.0f);
SetDopplerFactor(1.0f);
if( !LoadResource( SOUNDEFFECT_XML ) )
{
mlog("fail to load sound effect\n");
}
}
bool ZSoundEngine::LoadResource(char* pFileName)
{
MXmlDocument Data;
MZFile mzf;
if(!mzf.Open(pFileName, m_pZFileSystem)) return false;
char *buffer;
buffer=new char[mzf.GetLength()+1];
mzf.Read(buffer,mzf.GetLength());
buffer[mzf.GetLength()]=0;
Data.Create();
if(!Data.LoadFromMemory(buffer))
{
delete buffer;
return false;
}
delete buffer;
mzf.Close();
MXmlElement root, chr, attr;
char szSoundName[256];
char szSoundFileName[256];
root = Data.GetDocumentElement();
int iCount = root.GetChildNodeCount();
for( int i = 0 ; i < iCount; ++i )
{
chr = root.GetChildNode(i);
chr.GetTagName( szSoundName );
if( szSoundName[0] == '#' ) continue;
chr.GetAttribute( szSoundName, "name" );
strcpy_safe( szSoundFileName, SOUNDEFFECT_DIR );
strcat( szSoundFileName, szSoundName );
strcat( szSoundFileName, ".wav" );
char szType[64] = "";
chr.GetAttribute(szType, "type", "3d");
float min = ZDEF_MINDISTANCE;
float max = ZDEF_MAXDISTANCE;
float fTemp;
if( chr.GetAttribute( &fTemp, "MINDISTANCE" )) min = fTemp;
if( chr.GetAttribute( &fTemp, "MAXDISTANCE" )) max = fTemp;
bool bLoop = false;
chr.GetAttribute(&bLoop, "loop");
float fDefaultVolume = 1.0f;
chr.GetAttribute(&fDefaultVolume, "volume", 1.0f);
unsigned long int nFlags=0;
if (bLoop) nFlags |= RSOUND_LOOP_NORMAL;
else nFlags |= RSOUND_LOOP_OFF;
if (!_stricmp(szType, "2d"))
{
OpenSound(szSoundFileName, RSOUND_2D | nFlags);
if (!IS_EQ(fDefaultVolume, 1.0f))
{
RBaseSoundSource* pSoundSource = GetSoundSource(szSoundFileName, RSOUND_]2D);
if (pSoundSource)
{
SetDefaultVolume(pSoundSource, fDefaultVolume);
}
}
}
else
{
OpenSound(szSoundFileName, RSOUND_3D | nFlags);
RBaseSoundSource* pSoundSource = GetSoundSource(szSoundFileName, RSOUND_3D);
if (pSoundSource)
{
SetMinMaxDistance( pSoundSource, min, max);
if (!IS_EQ(fDefaultVolume, 1.0f))
{
SetDefaultVolume(pSoundSource, fDefaultVolume);
}
}
}
}
return true;
}
void ZSoundEngine::GetSoundName(const char* szSrcSoundName, char* out)
{
strcpy_safe(out, SOUNDEFFECT_DIR);
strcat(out, szSrcSoundName);
strcat(out, ".wav");
}
bool ZSoundEngine::OpenMusic(int nBgmIndex)
{
// if( !m_bSoundEnable ) return false;
// 가짜
static char m_stSndFileName[MAX_BGM][64] = {"Intro Retake2(D-R).ogg",
"Theme Rock(D).ogg",
"HardBgm3 Vanessa Retake(D).ogg",
"HardTech(D).ogg",
"HardCore(D).ogg",
"Ryswick style.ogg",
"El-tracaz.ogg",
"Industrial technolism.ogg",
"Fin.ogg" };
char szFileName[256] = "";
#define BGM_FOLDER "Sound/BGM/"
int nRealBgmIndex = nBgmIndex;
if ((nBgmIndex >= BGMID_BATTLE) && (nBgmIndex < BGMID_FIN)) nRealBgmIndex = RandomNumber(BGMID_BATTLE, BGMID_BATTLE+2);
sprintf_safe(szFileName, "%s%s", BGM_FOLDER, m_stSndFileName[nRealBgmIndex]);
return RealSound2::OpenMusic((const char*)szFileName);
}
class ZPlayingChannels : public list<int>
{
} g_Channels;
int ZSoundEngine::PlaySoundCharacter(const char* szSoundName, rvector& pos, bool bHero, int nPriority)
{
char key[256] = "";
GetSoundName(szSoundName, key);
int nChannel = -1;
if (bHero)
{
//nChannel= RealSound2::PlaySound(key, nPriority);
return RealSound2::PlaySound(key, nPriority);
}
else
{
float p[3];
p[0] = pos.x;
p[1] = pos.y;
p[2] = pos.z;
nChannel= RealSound2::PlaySound(key, p, NULL, nPriority);
g_Channels.push_back(nChannel);
}
/*
char temp[256];
sprintf_safe(temp, "Play Channel:%4d\n", nChannel);
mlog(temp);
*/
return nChannel;
}
/*
int ZSoundEngine::PlaySound(const char* szSoundName, rvector& pos, int nPriority, DWORD dwDelay)
{
float p[3];
p[0] = pos.x;
p[1] = pos.y;
p[2] = pos.z;
return RealSound2::PlaySound(szSoundName, p, NULL, nPriority);
}
*/
// 이건 나중에 삭제될 것
void ZSoundEngine::PlaySound(char* Name,rvector& pos,bool bHero, bool bLoop, DWORD dwDelay)
{
// if( !m_bSoundEnable ) return;
// if( !m_b3DSoundUpdate ) return;
//Culling
// SetPriority
if( dwDelay > 0 )
{
_ASSERT(0);
/*
DelaySound DS;
DS.dwDelay = dwDelay + GetGlobalTimeMS();
DS.pSS = pSS;
DS.pos = pos;
DS.priority = priority;
DS.bPlayer = bHero;
m_DelaySoundList.push_back(DS);
return;
*/
}
// char key[256] = "";
// GetSoundName(Name, key);
PlaySoundCharacter((const char*)Name, pos, bHero);
}
int ZSoundEngine::PlaySound(const char* szSoundName, int nPriority)
{
char key[256] = "";
GetSoundName(szSoundName, key);
return RealSound2::PlaySound(key, nPriority);
}
int ZSoundEngine::PlaySound(const char* szSoundName, float* pos, float* vel, int nPriority)
{
char key[256] = "";
GetSoundName(szSoundName, key);
return RealSound2::PlaySound(key, pos, vel, nPriority);
}
#include "fmod.h"
void ZSoundEngine::OnUpdate()
{
/*
DWORD currentTime = GetGlobalTimeMS();
if( (currentTime - m_Time) < m_DelayTime ) return;
m_Time = currentTime;
*/
if(g_pGame)
{
rvector Pos = RCameraPosition;
ZCharacter* pInterestCharacter = ZGetGameInterface()->GetCombatInterface()->GetTargetCharacter();
if(pInterestCharacter != NULL)
{
Pos = pInterestCharacter->GetPosition();
Pos.z += 170.f;
}
rvector Orientation = Pos - RCameraPosition;
D3DXVec3Normalize(&Orientation, &Orientation);
rvector right;
D3DXVec3Cross(&right, &Orientation, &RCameraUp);
// UpdateAmbSound(Pos, right);
rvector m_ListenerPos = Pos;
float pos[3];
float forward[3];
float vel[3] = {0.0f, 0.0f, 0.0f};
float top[3] = {0.0f, 0.0f, 1.0f};
pos[0] = Pos.x; pos[1] = Pos.y; pos[2] = Pos.z;
forward[0] = Orientation.x; forward[1] = Orientation.y; forward[2] = Orientation.z;
for (ZPlayingChannels::iterator itor=g_Channels.begin(); itor != g_Channels.end(); )
{
int nChannel = (*itor);
if (FSOUND_IsPlaying(nChannel) == FALSE)
{
itor = g_Channels.erase(itor);
}
else
{
FSOUND_3D_SetAttributes(nChannel, pos, vel);
++itor;
}
}
m_pAudio->SetListener( pos, vel, forward, top);
}
}
void ZSoundEngine::SetEffectVolume(float fVolume)
{
m_pAudio->SetVolume(fVolume);
}
void ZSoundEngine::SetEffectMute(bool bMute)
{
m_pAudio->SetMute(bMute);
}
void ZSoundEngine::PlaySEFire(MMatchItemDesc *pDesc, float x, float y, float z, bool bHero)
{
if( !pDesc ) return;
if( pDesc->m_nType == MMIT_RANGE || pDesc->m_nType == MMIT_CUSTOM )
{
char* szSndName = pDesc->m_szFireSndName;
rvector pos = rvector(x,y,z);
PlaySoundCharacter(szSndName, pos, bHero, 200);
return;
// 자기 자신이면 총소리는 2d로 낸다.
if (bHero)
{
char szFireSndName[256];
sprintf_safe(szFireSndName, "%s%s", szSndName, "_2d");
char key[256] = "";
GetSoundName(szFireSndName, key);
RealSound2::PlaySound(key, 200);
}
else
{
rvector pos = rvector(x,y,z);
PlaySoundCharacter(szSndName, pos, bHero, 200);
}
}
}
void ZSoundEngine::PlaySEDryFire(MMatchItemDesc *pDesc, float x, float y, float z, bool bHero)
{
}
void ZSoundEngine::PlaySEReload(MMatchItemDesc *pDesc, float x, float y, float z, bool bHero)
{
if(!pDesc ) return;
if(pDesc->m_nType == MMIT_RANGE)
{
char* szSndName = pDesc->m_szReloadSndName;
if(bHero)
{
char szBuffer[64];
sprintf_safe( szBuffer, "%s_2d", szSndName );
char key[256] = "";
GetSoundName(szBuffer, key);
RealSound2::PlaySound(key, 200);
}
else
{
rvector pos = rvector(x,y,z);
PlaySoundCharacter(szSndName, pos, bHero, 200);
}
//PlaySoundElseDefault(szSndName,"we_rifle_reload",rvector(x,y,z),bPlayer);
}
}
void ZSoundEngine::PlaySERicochet(float x, float y, float z)
{
}
void ZSoundEngine::PlaySEHitObject( float x, float y, float z, RBSPPICKINFO& info_ )
{
}
void ZSoundEngine::PlaySEHitBody(float x, float y, float z)
{
}
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
#else // _BIRDSOUND
FSOUND_SAMPLE* ZSoundEngine::GetFS( const char* szName, bool bHero )
{
SoundSource* pSS = GetSoundSource( szName, bHero );
if(pSS != NULL ) return pSS->pFS;
return NULL;
}
SoundSource* ZSoundEngine::GetSoundSource( const char* szName, bool bHero )
{
SESMAP::iterator i;
if( !bHero )
{
i = m_SoundEffectSource.find(string(szName));
if( i == m_SoundEffectSource.end() )
{
i = m_SoundEffectSource2D.find(string(szName));
if( i == m_SoundEffectSource2D.end() ) return NULL;
}
}
else
{
i = m_SoundEffectSource2D.find(string(szName));
if( i == m_SoundEffectSource2D.end() )
{
i = m_SoundEffectSource.find(string(szName));
if( i == m_SoundEffectSource.end() ) return NULL;
}
}
SoundSource* pRetSource = (SoundSource*)(i->second);
return pRetSource;
}
ZSoundEngine::ZSoundEngine()
{
m_pMusicBuffer = NULL;
m_fEffectVolume = 1.0f;
m_fMusicVolume = 0.0f;
m_bEffectMute = false;
m_szOpenedMusicName[0] = 0;
m_bSoundEnable = false;
m_b3DSound = true;
m_b3DSoundUpdate = false;
m_bHWMixing = true;
m_ListenerPos = rvector(0,0,0);
m_bEffectVolControl = false;
m_bBGMVolControl = false;
m_fEffectVolFactor = 0;
m_fEffectVolEnd = 0;
m_fBGMVolFactor = 0;
m_fBGMVolEnd = 0;
m_bBattleMusic=false;
m_pfs = NULL;
}
ZSoundEngine::~ZSoundEngine()
{
}
void ZSoundEngine::SetEffectVolume(float fVolume)
{
m_fEffectVolume=fVolume;
ZGetSoundFMod()->SetVolume( m_fEffectVolume * 255 );
}
void ZSoundEngine::SetEffectVolume( int iChnnel, float fVolume )
{
ZGetSoundFMod()->SetVolume( iChnnel, (int)(fVolume * 255) );
}
bool ZSoundEngine::Create(HWND hwnd, bool bHWMixing, ZLoadingProgress *pLoadingProgress )
{
m_bSoundEnable = ZGetSoundFMod()->Create( hwnd, FSOUND_OUTPUT_DSOUND, 44100, bHWMixing?16:1024, bHWMixing?16:0, bHWMixing?16:32, 0 );
if(!m_bSoundEnable && bHWMixing)
{
m_bSoundEnable = ZGetSoundFMod()->Create( hwnd, FSOUND_OUTPUT_DSOUND, 44100, 0, 0, 32, 0 ); // try software mode
if( !m_bSoundEnable )
{
mlog("Fail to Create Sound Engine..\n");
return false;
}
else
{
mlog("Create SoundEngine with Software mode after failed with hardware mode..\n");
m_bHWMixing = false;
Z_AUDIO_HWMIXING = false;
}
}
m_b8Bits = Z_AUDIO_8BITSOUND;
if( !LoadResource( SOUNDEFFECT_XML, pLoadingProgress ) )
{
mlog("fail to load sound effect\n");
}
ZGetSoundFMod()->SetRollFactor(3.f);
ZGetSoundFMod()->SetDistanceFactor(100.f);
ZGetSoundFMod()->SetDopplerFactor(1.f);
ZGetSoundFMod()->SetMusicEndCallback(MusicEndCallback, this);
SetEffectVolume(m_fEffectVolume);
SetMusicVolume(m_fMusicVolume);
ZGetSoundFMod()->SetMute( Z_AUDIO_EFFECT_MUTE );
ZGetSoundFMod()->SetMusicMute( Z_AUDIO_BGM_MUTE );
SetFramePerSecond( DEFAULT_SOUND_FRAME );
SetInverseSound( Z_AUDIO_INVERSE );
m_bHWMixing = Z_AUDIO_HWMIXING;
return true;
}
bool ZSoundEngine::Reset( HWND hwnd, bool bHWMixing )
{
if(m_bHWMixing == bHWMixing ) return false;
m_bHWMixing = bHWMixing;
char szBuffer[128];
strcpy_safe(szBuffer, m_szOpenedMusicName );
Destroy();
m_bSoundEnable = Create(hwnd, bHWMixing);
if(!m_bSoundEnable) return false;
if(g_pGame)
{
for(auto& AS : ZGetGame()->GetWorld()->GetBsp()->GetAmbSndList())
{
if(AS.itype & AS_AABB)
ZGetSoundEngine()->SetAmbientSoundBox(AS.szSoundName,
AS.min, AS.max,
(AS.itype&AS_2D)?true:false );
else if(AS.itype & AS_SPHERE )
ZGetSoundEngine()->SetAmbientSoundSphere(AS.szSoundName,
AS.center, AS.radius,
(AS.itype&AS_2D)?true:false );
}
}
OpenMusic(szBuffer, ZGetFileSystem());
PlayMusic();
return true;
}
void ZSoundEngine::Destroy()
{
mlog("ZSoundEngine::Destroy\n");
for( SESMAP::iterator iter = m_SoundEffectSource.begin(); iter != m_SoundEffectSource.end(); ++iter )
{
SoundSource* pSS = iter->second;
if( pSS != NULL && pSS->pFS != NULL )
FSOUND_Sample_Free(pSS->pFS);
SAFE_DELETE(pSS);
}
m_SoundEffectSource.clear();
for( SESMAP::iterator iter = m_SoundEffectSource2D.begin(); iter != m_SoundEffectSource2D.end(); ++iter )
{
SoundSource* pSS = iter->second;
if( pSS != NULL && pSS->pFS != NULL )
FSOUND_Sample_Free(pSS->pFS);
SAFE_DELETE(pSS);
}
m_SoundEffectSource2D.clear();
m_DelaySoundList.clear();
ClearAmbientSound();
StopMusic();
CloseMusic();
mlog("ZSoundEngine::Destroy() : Close FMod\n");
ZGetSoundFMod()->Close();
}
bool ZSoundEngine::SetSamplingBits( bool b8Bits )
{
if( b8Bits == m_b8Bits ) return true;
m_b8Bits = b8Bits;
return Reload();
}
bool ZSoundEngine::OpenMusic(const char* szFileName, MZFileSystem* pfs)
{
if( !m_bSoundEnable ) return false;
m_pfs = pfs;
if (!strcmp(m_szOpenedMusicName, szFileName)) return false;
if (m_szOpenedMusicName[0] != 0) CloseMusic();
strcpy_safe(m_szOpenedMusicName, szFileName);
MZFile mzf;
if(!mzf.Open(szFileName, pfs)) return false;
m_pMusicBuffer = new char[mzf.GetLength()+1];
mzf.Read(m_pMusicBuffer, mzf.GetLength());
m_pMusicBuffer[mzf.GetLength()] = 0;
int len = mzf.GetLength();
return ZGetSoundFMod()->OpenStream( m_pMusicBuffer, len );
}
void ZSoundEngine::CloseMusic()
{
if( !m_bSoundEnable ) return;
if (m_szOpenedMusicName[0] == 0) return;
m_szOpenedMusicName[0] = 0;
ZGetSoundFMod()->CloseMusic();
if (m_pMusicBuffer)
{
delete m_pMusicBuffer; m_pMusicBuffer = NULL;
}
}
void ZSoundEngine::SetMusicVolume(float fVolume)
{
if( !m_bSoundEnable ) return;
m_fMusicVolume = fVolume;
ZGetSoundFMod()->SetMusicVolume( fVolume * 255 );
}
float ZSoundEngine::GetMusicVolume( void)
{
return m_fMusicVolume;
}
void ZSoundEngine::MusicEndCallback(void* pCallbackContext)
{
ZSoundEngine* pSoundEngine = (ZSoundEngine*)pCallbackContext;
if (pSoundEngine->m_bBattleMusic)
{
pSoundEngine->OpenMusic(BGMID_BATTLE, pSoundEngine->m_pfs);
pSoundEngine->PlayMusic();
}
}
void ZSoundEngine::PlayMusic(bool bLoop)
{
if( !m_bSoundEnable || m_bMusicMute ) return;
if (m_bBattleMusic)
{
// 전투중에는 배경음악이 루핑되지 않고 다음노래로 넘어간다.
ZGetSoundFMod()->PlayMusic( false );
}
else
{
ZGetSoundFMod()->PlayMusic( bLoop );
}
SetMusicVolume( m_fMusicVolume );
}
void ZSoundEngine::StopMusic()
{
if( !m_bSoundEnable ) return;
ZGetSoundFMod()->StopMusic();
}
void ZSoundEngine::PlaySEFire(MMatchItemDesc *pDesc, float x, float y, float z, bool bPlayer)
{
if( !m_bSoundEnable || !pDesc ) return;
if( pDesc->m_nType == MMIT_RANGE || pDesc->m_nType == MMIT_CUSTOM )
{
char* szSndName = pDesc->m_szFireSndName;
if(bPlayer)
{
char szBuffer[64];
sprintf_safe( szBuffer, "%s_2d", szSndName );
#ifdef _SOUND_LOG
mlog("%s stereo 2d sound is played..\n",szBuffer);
#endif
PlaySoundElseDefault(szBuffer,"we_rifle_fire_2d",rvector(x,y,z),bPlayer);
}
PlaySoundElseDefault(szSndName,"we_rifle_fire",rvector(x,y,z),bPlayer);
}
}
void ZSoundEngine::PlaySEDryFire(MMatchItemDesc *pDesc, float x, float y, float z, bool bPlayer)
{
if( !m_bSoundEnable || !pDesc ) return;
PlaySound("762arifle_dryfire", rvector(x,y,z), bPlayer, false );
}
void ZSoundEngine::PlaySEReload(MMatchItemDesc *pDesc, float x, float y, float z, bool bPlayer)
{
if( !m_bSoundEnable || !pDesc ) return;
if(pDesc->m_nType == MMIT_RANGE)
{
char* szSndName = pDesc->m_szReloadSndName;
if(bPlayer)
{
char szBuffer[64];
sprintf_safe( szBuffer, "%s_2d", szSndName );
#ifdef _SOUND_LOG
mlog("%s stereo 2d sound is played..\n",szBuffer);
#endif
PlaySoundElseDefault(szBuffer,"we_rifle_reload_2d",rvector(x,y,z),bPlayer);
}
PlaySoundElseDefault(szSndName,"we_rifle_reload",rvector(x,y,z),bPlayer);
}
}
void ZSoundEngine::PlaySERicochet(float x, float y, float z)
{
if( !m_bSoundEnable) return;
PlaySound("ricochet_concrete01",rvector(x,y,z), false, false );
}
void ZSoundEngine::PlaySEHitObject( float x, float y, float z, RBSPPICKINFO& info_ )
{
if( !m_bSoundEnable ) return;
static const char* base_snd_name = "fx_bullethit_mt_";
FSOUND_SAMPLE* pFS = NULL;
static char buffer[256];
if( info_.pNode==NULL ) {
OutputDebugString("ZSoundEngine::PlaySEHitObject 엉뚱한곳이 picking ?\n");
return;
}
RMATERIAL* material_info = ZGetGame()->GetWorld()->GetBsp()->GetMaterial( info_.pNode, info_.nIndex );
if(material_info==NULL) {
OutputDebugString("ZSoundEngine::PlaySEHitObject ( material_info==NULL ) ?\n");
return;
}
const char* temp = material_info->Name.c_str();
size_t size = strlen(temp);
// Compare string...
int index = (int) (size - 1);
while( index >= 2 )
{
if( temp[index--] == 't' && temp[index--] == 'm' )
{
index += 4;
break;
}
}
if( index <= 2 )
{
PlaySound("fx_bullethit_mt_con", rvector(x,y,z), false, false );
return;
}
strcpy_safe(buffer, base_snd_name);
strncat_safe(buffer, temp + index, size - index);
PlaySoundElseDefault(buffer, "fx_bullethit_mt_con", rvector(x,y,z) );
}
void ZSoundEngine::PlaySEHitBody(float x, float y, float z)
{
if( !m_bSoundEnable ) return;
PlaySound("fx_bullethit_mt_fsh", rvector(x,y,z), false, false );
}
bool ZSoundEngine::isPlayAble(char* name)
{
if( !m_bSoundEnable ) return false;
SESMAP::iterator i = m_SoundEffectSource.find(name);
if(i==m_SoundEffectSource.end())
{
i = m_SoundEffectSource2D.find(name);
if( i == m_SoundEffectSource2D.end() )
return false;
}
return true;
}
bool ZSoundEngine::isPlayAbleMtrl(char* name)
{
if( !m_bSoundEnable ) return false;
if(!name) return false;
if(!name[0]) return false;
int len = (int)strlen(name);
SESMAP::iterator node;
FSOUND_SAMPLE* pFS = NULL;
char filename[256];
for(node = m_SoundEffectSource.begin(); node != m_SoundEffectSource.end(); ++node)
{
strcpy_safe( filename, ((string)((*node).first)).c_str());
if(strncmp(filename,name,len)==0)
return true;
}
for(node = m_SoundEffectSource2D.begin(); node != m_SoundEffectSource2D.end(); ++node)
{
strcpy_safe( filename, ((string)((*node).first)).c_str());
if(strncmp(filename,name,len)==0)
return true;
}
return false;
}
int ZSoundEngine::PlaySound(const char* Name, const rvector& pos, bool bHero, bool bLoop, DWORD dwDelay )
{
if( !m_bSoundEnable ) return 0;
if( !m_b3DSoundUpdate ) return 0;
// Find Sound Source
SoundSource* pSS = GetSoundSource(Name, bHero);
if(pSS == 0 )
{
#ifdef _SOUND_LOG
mlog("No %sSound Source[%s]\n", bHero?"2d":"3d", Name);
#endif
return 0;
}
//Culling
int priority=0;
if (!CheckCulling(Name, pSS, pos, bHero, &priority)) return 0;
if( dwDelay > 0 )
{
DelaySound DS;
DS.dwDelay = dwDelay + GetGlobalTimeMS();
DS.pSS = pSS;
DS.pos = pos;
DS.priority = priority;
DS.bPlayer = bHero;
m_DelaySoundList.push_back(DS);
return 0;
}
//Play
FSOUND_SAMPLE* pFS = pSS->pFS;
if(pFS == NULL)
{
#ifdef _SOUND_LOG
mlog("FSOUND_SAMPLE is Null for Sound Source[%s]\n", Name);
#endif
return 0;
}
return PlaySE( pFS, pos, priority, bHero, bLoop );
}
void ZSoundEngine::PlaySoundElseDefault(const char* Name, const char* NameDefault, const rvector& pos,bool bHero,bool bLoop, DWORD dwDelay )
{
if( !m_bSoundEnable ) return;
if( !m_b3DSoundUpdate ) return;
SoundSource* pSS = GetSoundSource(Name, bHero);
if(pSS == 0 )
{
pSS = GetSoundSource(NameDefault, bHero);
if(pSS == 0)
{
#ifdef _SOUND_LOG
mlog("No %sSound Source[%s] even Default Sound Source[%s]\n", bHero?"2d":"3d", Name, NameDefault);
#endif
return;
}
#ifdef _SOUND_LOG
mlog("No %sSound Source[%s] so Use Default Sound Source[%s]\n", bHero?"2d":"3d", Name, NameDefault);
#endif
}
//Culling
int priority=0;
if (!CheckCulling(Name, pSS, pos, bHero, &priority)) return;
if( dwDelay > 0 )
{
DelaySound DS;
DS.dwDelay = dwDelay + GetGlobalTimeMS();
DS.pSS = pSS;
DS.pos = pos;
DS.priority = priority;
DS.bPlayer = bHero;
m_DelaySoundList.push_back(DS);
return;
}
FSOUND_SAMPLE* pFS = pSS->pFS;
if(pFS == NULL)
{
#ifdef _SOUND_LOG
mlog("FSOUND_SAMPLE is Null for Sound Source[%s]\n", Name);
#endif
return;
}
PlaySE( pFS, pos, priority, bHero, bLoop );
}
int ZSoundEngine::PlaySound( const char* Name, bool bLoop, DWORD dwDelay )
{
if( !m_bSoundEnable ) return 0;
SoundSource* pSS = GetSoundSource(Name, true);
if(pSS == 0 )
{
#ifdef _SOUND_LOG
mlog("No 2DSound Source[%s]\n", Name);
#endif
return 0;
}
if( dwDelay > 0 )
{
DelaySound DS;
DS.dwDelay = dwDelay + GetGlobalTimeMS();
DS.pSS = pSS;
DS.priority = 200;
DS.bPlayer = true;
m_DelaySoundList.push_back(DS);
return 0;
}
FSOUND_SAMPLE* pFS = pSS->pFS;
if(pFS == NULL)
{
#ifdef _SOUND_LOG
mlog("FSOUND_SAMPLE is Null for Sound Source[%s]\n", Name);
#endif
return 0;
}
return PlaySE( pFS, rvector(0,0,0), 200, true, bLoop );
}
void ZSoundEngine::Run(void)
{
DWORD currentTime = GetGlobalTimeMS();
if( (currentTime - m_Time) < m_DelayTime ) return;
m_Time = currentTime;
auto ZSoundEngineRun = MBeginProfile("ZSoundEngine::Run");
if( !m_bSoundEnable ) return;
if( !m_b3DSoundUpdate ) return;
if(g_pGame)
{
rvector Pos = RCameraPosition;
ZCharacter* pInterestCharacter = ZGetGameInterface()->GetCombatInterface()->GetTargetCharacter();
if(pInterestCharacter != NULL)
{
Pos = pInterestCharacter->GetPosition();
Pos.z += 170.f;
}
rvector Orientation = Normalized(Pos - RCameraPosition);
rvector right = CrossProduct(Orientation, RCameraUp);
UpdateAmbSound(Pos, right);
for( DSLIST::iterator iter = m_DelaySoundList.begin(); iter != m_DelaySoundList.end();)
{
DelaySound DS = *iter;
if( DS.dwDelay < m_Time )
{
PlaySE( DS.pSS->pFS, DS.pos, DS.priority, DS.bPlayer );
iter = m_DelaySoundList.erase( iter );
continue;
}
++iter;
}
m_ListenerPos = Pos;
MBeginProfile(1004, "ZSoundEngine::Run : SetListener");
if(m_bInverse)
ZGetSoundFMod()->SetListener( &Pos, NULL, -Orientation.x, -Orientation.y, Orientation.z, 0, 0, 1 );
else
ZGetSoundFMod()->SetListener( &Pos, NULL, Orientation.x, Orientation.y, Orientation.z, 0, 0, 1 );
MEndProfile(1004);
MBeginProfile(33, "ZSoundEngine::Run : Update");
ZGetSoundFMod()->Update();
MEndProfile(33);
}
MEndProfile(ZSoundEngineRun);
}
const char* ZSoundEngine::GetBGMFileName(int nBgmIndex)
{
static char m_stSndFileName[MAX_BGM][64] = {"Intro Retake2(D-R).ogg",
"Theme Rock(D).ogg",
"HardBgm3 Vanessa Retake(D).ogg",
"HardBgm(D).ogg",
"HardTech(D).ogg",
"HardCore(D).ogg",
"Ryswick style.ogg",
"El-tracaz.ogg",
"Industrial technolism.ogg",
"Fin.ogg" };
static char szFileName[256] = "";
#define BGM_FOLDER "Sound/BGM/"
int nRealBgmIndex = nBgmIndex;
if ((nBgmIndex >= BGMID_BATTLE) && (nBgmIndex < BGMID_FIN)) nRealBgmIndex = RandomNumber(BGMID_BATTLE, BGMID_FIN-1);
sprintf_safe(szFileName, "%s%s", BGM_FOLDER, m_stSndFileName[nRealBgmIndex]);
return szFileName;
}
bool ZSoundEngine::OpenMusic(int nBgmIndex, MZFileSystem* pfs)
{
if( !m_bSoundEnable ) return false;
m_pfs=pfs;
if (nBgmIndex == BGMID_BATTLE) m_bBattleMusic = true;
else m_bBattleMusic = false;
char szFileName[256];
strcpy_safe(szFileName, GetBGMFileName(nBgmIndex));
return OpenMusic(szFileName, pfs);
}
bool ZSoundEngine::LoadResource( char* pFileName_ ,ZLoadingProgress *pLoading )
{
if( !m_bSoundEnable )
{
return false;
}
MXmlDocument Data;
MZFile mzf;
if(!mzf.Open(pFileName_,ZGetFileSystem()))
return false;
char *buffer;
buffer=new char[mzf.GetLength()+1];
mzf.Read(buffer,mzf.GetLength());
buffer[mzf.GetLength()]=0;
Data.Create();
if(!Data.LoadFromMemory(buffer))
{
delete buffer;
return false;
}
delete buffer;
mzf.Close();
MXmlElement root, chr, attr;
float fTemp;
char szSoundName[256];
char szSoundFileName[256];
int iType = 0;
root = Data.GetDocumentElement();
int iCount = root.GetChildNodeCount();
for( int i = 0 ; i < iCount; ++i )
{
if(pLoading && (i%10==0)) pLoading->UpdateAndDraw(float(i)/float(iCount));
chr = root.GetChildNode(i);
chr.GetTagName( szSoundName );
if( szSoundName[0] == '#' )
{
continue;
}
chr.GetAttribute( szSoundName, "NAME" );
strcpy_safe( szSoundFileName, SOUNDEFFECT_DIR );
strcat_safe( szSoundFileName, szSoundName );
strcat_safe( szSoundFileName, ".wav" );
chr.GetAttribute( &iType, "type", 0 );
FSOUND_SAMPLE* pFS = NULL;
FSOUND_SAMPLE* pFS2 = NULL;
int flag = FSOUND_SIGNED|FSOUND_MONO;
flag |= FSOUND_16BITS;
switch( iType )
{
case 0:
if(m_bHWMixing)
flag |= FSOUND_HW3D;
pFS = ZGetSoundFMod()->LoadWave( szSoundFileName, flag );
break;
case 1:
if(m_bHWMixing)
flag |= FSOUND_HW2D;
else flag |= FSOUND_2D;
pFS = ZGetSoundFMod()->LoadWave( szSoundFileName, flag );
break;
case 2:
if(m_bHWMixing)
flag |= FSOUND_HW3D;
pFS = ZGetSoundFMod()->LoadWave( szSoundFileName, flag );
if(m_bHWMixing)
{
flag &= ~FSOUND_HW3D;
flag |= FSOUND_HW2D;
}
else flag |= FSOUND_2D;
pFS2 = ZGetSoundFMod()->LoadWave( szSoundFileName, flag );
break;
case 3:
flag &= ~FSOUND_MONO;
flag |= FSOUND_STEREO;
if(m_bHWMixing) flag |= FSOUND_HW2D;
else flag |= FSOUND_2D;
pFS2 = ZGetSoundFMod()->LoadWave( szSoundFileName, flag );
break;
case 4:
pFS2 = ZGetSoundFMod()->LoadWave( szSoundFileName, FSOUND_LOOP_NORMAL|FSOUND_NORMAL|FSOUND_2D );
break;
case 5:
pFS2 = ZGetSoundFMod()->LoadWave( szSoundFileName, FSOUND_LOOP_NORMAL|FSOUND_SIGNED|FSOUND_STEREO|FSOUND_16BITS|FSOUND_2D );
break;
case 6:
pFS = ZGetSoundFMod()->LoadWave( szSoundFileName, FSOUND_LOOP_NORMAL|FSOUND_NORMAL );
break;
}
SoundSource* pSS = NULL;
if( pFS != NULL )
{
float min = ZDEF_MINDISTANCE;
float max = ZDEF_MAXDISTANCE;
if( chr.GetAttribute( &fTemp, "MINDISTANCE" ))
min = fTemp;
pSS = new SoundSource;
pSS->pFS = pFS;
pSS->fMaxDistance = max;
ZGetSoundFMod()->SetMinMaxDistance( pFS, min, 1000000000.0f );
#ifdef _DEBUG
_ASSERT(m_SoundEffectSource.find(szSoundName)==m_SoundEffectSource.end());
#endif
m_SoundEffectSource.insert(SESMAP::value_type(szSoundName, pSS ));
}
if( pFS2 != NULL )
{
pSS = new SoundSource;
pSS->pFS = pFS2;
#ifdef _DEBUG
_ASSERT(m_SoundEffectSource2D.find(szSoundName)==m_SoundEffectSource2D.end());
#endif
m_SoundEffectSource2D.insert(SESMAP::value_type(szSoundName, pSS ) );
}
#ifdef _DEBUG
if(pFS==NULL && pFS2==NULL) {
mlog("cannot create sound : %s\n",szSoundName);
}
#endif
}
strcpy_safe( m_SoundFileName, pFileName_ );
return true;
}
int ZSoundEngine::GetEnumDeviceCount()
{
return ZGetSoundFMod()->GetNumDriver();
}
const char* ZSoundEngine::GetDeviceDescription( int index )
{
return ZGetSoundFMod()->GetDriverName( index );
}
void ZSoundEngine::SetMusicMute( bool b )
{
if( b == m_bMusicMute ) return;
m_bMusicMute = b;
if( !m_bSoundEnable ) return;
ZGetSoundFMod()->SetMusicMute( b );
if( !b ) SetMusicVolume( m_fMusicVolume );
}
int ZSoundEngine::PlaySE(FSOUND_SAMPLE* pFS, const rvector& pos, int Priority, bool bPlayer, bool bLoop)
{
if(!m_bSoundEnable||m_bEffectMute||pFS==NULL) return -1;
return ZGetSoundFMod()->Play(pFS, &pos, NULL, m_fEffectVolume*255,Priority,bPlayer,bLoop);
}
void ZSoundEngine::StopLoopSound()
{
}
void ZSoundEngine::StopSound( int iChannel )
{
if(!m_bSoundEnable) return;
ZGetSoundFMod()->StopSound( iChannel );
}
void ZSoundEngine::SetEffectMute( bool b )
{
m_bEffectMute = b;
}
void ZSoundEngine::Set3DSoundUpdate(bool b)
{
m_b3DSoundUpdate = b;
if( !b )
{
ZGetSoundFMod()->StopSound();
}
}
bool ZSoundEngine::Reload()
{
mlog("Reload Sound Sources...\n");
for( SESMAP::iterator iter = m_SoundEffectSource.begin(); iter != m_SoundEffectSource.end(); ++iter )
{
SoundSource* pSS = iter->second;
SAFE_DELETE(pSS);
}
m_SoundEffectSource.clear();
for( SESMAP::iterator iter = m_SoundEffectSource2D.begin(); iter != m_SoundEffectSource2D.end(); ++iter )
{
SoundSource* pSS = iter->second;
SAFE_DELETE(pSS);
}
m_SoundEffectSource2D.clear();
return LoadResource( m_SoundFileName );
}
void ZSoundEngine::SetAmbientSoundBox( char* Name, rvector& pos1, rvector& pos2, bool b2d )
{
AmbSound AS;
AS.type = AS_AABB;
if(b2d) AS.type |= AS_2D;
else AS.type |= AS_3D;
AS.pSS = GetSoundSource(Name, b2d);
if(AS.pSS == NULL)
{
return;
}
strcpy_safe(AS.szSoundName, Name);
AS.iChannel = -1;
AS.pos[0] = pos1;
AS.pos[1] = pos2;
AS.center = ( pos1 + pos2 ) * 0.5f;
AS.dx = AS.pos[1].x - AS.center.x;
AS.dy = AS.pos[1].y - AS.center.y;
AS.dz = AS.pos[1].z - AS.center.z;
m_AmbientSoundList.push_back(AS);
if(!b2d)
{
auto vec = rvector(AS.dx, AS.dy, AS.dz);
float length = Magnitude(vec);
FSOUND_Sample_SetMinMaxDistance( AS.pSS->pFS, length * 0.1f, length );
}
}
void ZSoundEngine::SetAmbientSoundSphere( char* Name, rvector& pos, float radius, bool b2d )
{
AmbSound AS;
AS.type = AS_SPHERE;
if(b2d) AS.type |= AS_2D;
else AS.type |= AS_3D;
AS.pSS = GetSoundSource(Name, b2d);
if(AS.pSS == NULL)
{
return;
}
strcpy_safe(AS.szSoundName, Name);
AS.iChannel = -1;
AS.radius = radius;
AS.center = pos;
m_AmbientSoundList.push_back(AS);
if(!b2d) FSOUND_Sample_SetMinMaxDistance( AS.pSS->pFS, radius * 0.1f, radius );
}
void ZSoundEngine::ClearAmbientSound()
{
for(ASLIST::iterator iter = m_AmbientSoundList.begin(); iter != m_AmbientSoundList.end(); )
{
AmbSound* AS = &(*iter);
if(AS->iChannel != -1)
{
ZGetSoundFMod()->StopSound(AS->iChannel);
SetEffectVolume( AS->iChannel, m_fEffectVolume );
AS->iChannel = -1;
}
iter = m_AmbientSoundList.erase(iter);
}
}
void ZSoundEngine::UpdateAmbSound(rvector& Pos, rvector& Ori)
{
// 환경 사운드 처리
for( ASLIST::iterator iter = m_AmbientSoundList.begin(); iter != m_AmbientSoundList.end(); ++iter )
{
AmbSound* AS = &(*iter);
if(AS == NULL) continue;
float t = GetArea(Pos, *AS );
if( t <=0 )
{
if( AS->iChannel != -1 )
{
SetEffectVolume(AS->iChannel,m_fEffectVolume);
StopSound(AS->iChannel);
AS->iChannel = -1;
}
continue;
}
if(AS->iChannel == -1)
{
AS->iChannel = PlaySE(AS->pSS->pFS, AS->center, 150, true );
}
if(AS->iChannel != -1 )
{
float vol = m_fEffectVolume * t;
SetEffectVolume(AS->iChannel,vol);
}
}
}
#define AS_TA_ATTENUATION_RATIO_SQ 0.7f
#define AS_TB_ATTENUATION_RATIO_SQ 0.1f // 10 percent
#define AS_TA_AMP_COEFFICIENT 5.0f
#define AS_TB_AMP_COEFFICIENT 1.5f
float ZSoundEngine::GetArea( rvector& Pos, AmbSound& a )
{
// box
if(a.type & AS_AABB)
{
float dX = fabs(Pos.x - a.center.x);
float dY = fabs(Pos.y - a.center.y);
float dZ = fabs(Pos.z - a.center.z);
if(dX < a.dx && dY < a.dy && dZ < a.dz )
{
return min((a.dx-dX)/a.dx * (a.dy-dY)/a.dy * (a.dz-dZ)/a.dz * ((a.type&AS_2D)?AS_TA_AMP_COEFFICIENT:AS_TB_AMP_COEFFICIENT), 1.0f );
}
return -1;
}
// sphere
else if( a.type & AS_SPHERE )
{
auto vec = a.center - Pos;
float length = Magnitude(vec);
float radius = a.radius;
if( length >= radius ) return -1;
float sacred = radius*((a.type&AS_2D)?AS_TA_ATTENUATION_RATIO_SQ:AS_TB_ATTENUATION_RATIO_SQ);
if( length <= sacred ) return 1;
return (radius - length)/(radius-sacred);
}
return -1;
}
void ZSoundEngine::SetVolumeControlwithDuration( float fStartPercent, float fEndPercent, DWORD dwDuration, bool bEffect, bool bBGM )
{
m_bEffectVolControl = bEffect;
m_bBGMVolControl = bBGM;
DWORD currentTime = GetGlobalTimeMS();
DWORD endTime = currentTime + dwDuration;
int nUpdate = ( endTime - currentTime ) / m_DelayTime;
float startEffectVol, startBGMVol;
if( bEffect && !m_bEffectMute )
{
startEffectVol = fStartPercent*m_fEffectVolume;
m_fEffectVolEnd = fEndPercent*m_fEffectVolume;
m_fEffectVolFactor = ( m_fEffectVolEnd - startEffectVol ) / nUpdate;
m_fEffectVolume = startEffectVol;
}
if( bBGM && !m_bMusicMute )
{
startBGMVol = fStartPercent*m_fMusicVolume;
m_fBGMVolEnd = fEndPercent*m_fMusicVolume;
m_fBGMVolFactor = ( m_fBGMVolEnd - startBGMVol ) / nUpdate;
m_fMusicVolume = startBGMVol;
}
}
//#define _VOICE_EFFECT
void ZSoundEngine::PlayVoiceSound(char* szName)
{
#ifndef _VOICE_EFFECT
return;
#endif
if( !m_bSoundEnable ) return;
SoundSource* pSS = GetSoundSource(szName, true);
if(pSS == 0 )
{
return;
}
FSOUND_SAMPLE* pFS = pSS->pFS;
if(pFS == NULL)
{
return;
}
PlaySE( pFS, rvector(0,0,0), 254, true, false );
}
bool ZSoundEngine::LoadNPCResource(MQUEST_NPC nNPC, ZLoadingProgress* pLoading)
{
FSOUND_SAMPLE* pFS = NULL;
FSOUND_SAMPLE* pFS2 = NULL;
int flag = FSOUND_SIGNED|FSOUND_MONO | FSOUND_16BITS;
if (m_bHWMixing) flag |= FSOUND_HW3D;
for (int i = 0; i < NPC_SOUND_END; i++)
{
MQuestNPCInfo* pNPCInfo = ZGetQuest()->GetNPCCatalogue()->GetInfo(nNPC);
if (pNPCInfo == NULL) return false;
if (pNPCInfo->szSoundName[i][0] == 0) continue;
char szSoundFileName[256] = "";
strcpy_safe(szSoundFileName, SOUNDNPC_DIR);
strcat_safe(szSoundFileName, pNPCInfo->szSoundName[i] );
strcat_safe(szSoundFileName, ".wav" );
pFS = ZGetSoundFMod()->LoadWave( szSoundFileName, flag );
if( pFS != NULL )
{
float min = 500.0f;
float max = ZDEF_MAXDISTANCE;
SoundSource* pSS = new SoundSource;
pSS->pFS = pFS;
pSS->fMaxDistance = max;
ZGetSoundFMod()->SetMinMaxDistance( pFS, min, 1000000000.0f );
m_SoundEffectSource.insert(SESMAP::value_type(szSoundFileName, pSS ));
}
}
m_ASManager.insert(nNPC);
return true;
}
void ZSoundEngine::ReleaseNPCResources()
{
}
void ZSoundEngine::PlayNPCSound(MQUEST_NPC nNPC, MQUEST_NPC_SOUND nSound, rvector& pos, bool bMyKill)
{
MQuestNPCInfo* pNPCInfo = ZGetQuest()->GetNPCCatalogue()->GetInfo(nNPC);
if (pNPCInfo == NULL) return;
if (pNPCInfo->szSoundName[nSound][0] != 0)
{
char szSoundFileName[256] = "";
strcpy_safe(szSoundFileName, SOUNDNPC_DIR);
strcat_safe(szSoundFileName, pNPCInfo->szSoundName[nSound] );
strcat_safe(szSoundFileName, ".wav" );
int nChannel = PlaySound(szSoundFileName, pos, false, false);
if (nChannel != 0)
{
if (bMyKill)
{
ZGetSoundFMod()->SetMinMaxDistance(nChannel, 3500.0f, ZDEF_MAXDISTANCE);
}
else
{
ZGetSoundFMod()->SetMinMaxDistance(nChannel, 500.0f, ZDEF_MAXDISTANCE);
}
}
}
}
bool ZSoundEngine::CheckCulling(const char* szName, SoundSource* pSS, const rvector& vSoundPos, bool bHero, int* pnoutPriority)
{
auto vec = vSoundPos - m_ListenerPos;
float fDistSq = MagnitudeSq(vec);
if(!bHero)
{
if( fDistSq > (pSS->fMaxDistance*pSS->fMaxDistance) )
{
#ifdef _SOUND_LOG
mlog("Cull by Distance[%s]\n", szName);
#endif
return false;
}
}
unsigned long int nNowTime = GetGlobalTimeMS();
if ((nNowTime - pSS->nLastPlayedTime) < 10)
{
if (strncmp("fx_dash", szName, 7))
{
#ifdef _DEBUG
mlog("--------- 복수 sound 출력(%s, %u)\n", szName, nNowTime - pSS->nLastPlayedTime);
#endif
return false;
}
}
pSS->nLastPlayedTime = nNowTime;
if (pnoutPriority)
{
*pnoutPriority = ((1-fDistSq/pSS->fMaxDistance)*ZDEF_MAX_DISTANCE_PRIORITY ); // 0~100
}
return true;
}
#endif | [
"[email protected]"
] | |
2b3554816f985e0677052bb8f3199eb679c09e2f | 7908290a3386df7be468ea7745e10208e15a74fb | /wip/graphics_pipeline.hxx | a19f407b1aceca03e48924a73c35987e159ee5c6 | [] | no_license | jaguardeer/automatic-garbanzo | 77cf173378ea4320cd3fe6d97d571c89643db86e | cd4708e1d07d1d3598b65370c68955651ff3aba6 | refs/heads/master | 2020-03-16T14:02:17.399371 | 2018-05-09T05:26:28 | 2018-05-09T05:26:28 | 132,705,760 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 110 | hxx | #ifndef GRAPHICS_PIPELINE_HXX
#define GRAPHICS_PIPELINE_HXX
struct Graphics_Pipeline_Init_Info
{
};
#endif
| [
"[email protected]"
] | |
239a7b06648f582da091032e09b4d413151f62f9 | 6613d47c2b699fd42a66b7b28ff7f1e86825f382 | /Praktikum/Praktikum/P4.1/hashtable.cpp | 29a60f40a576cc236b9907b8462770814fcd268a | [] | no_license | n3dryFH/ads | e75f7de91ea4fb5468e89b49c290c12550fd9606 | 84a85bf49056249acbc279953d13ab7c0a1169e0 | refs/heads/master | 2020-05-05T11:41:53.829842 | 2019-07-01T17:04:36 | 2019-07-01T17:04:36 | 179,999,893 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,634 | cpp | #include <cassert>
#include <vector>
#include "hashtable.h"
#include <iostream>
using namespace std;
HashTable::HashTable(int size) : size(size), elements(0), collisionCount(0)
{
//*****************************
// implement constructor here *
//*****************************
hashTable = new vector<int>(size);
for (int i = 0; i < size; ++i)
hashTable->at(i) = -1;
}
HashTable::~HashTable()
{
//****************************
// implement destructor here *
//****************************
assert(hashTable != nullptr);
delete hashTable;
hashTable = nullptr;
}
int HashTable::hashValue(int item) {
int index = -1; //dummy initializtation
//******************************************
// implement calculation of hashindex here *
//******************************************
// hi(k) = (k+(i^2))mod M
bool hasCollision = false;
int i = 0;
do
{
index = (item + (i * i)) % size;
if (hashTable->at(index) != -1)
{
hasCollision = true;
++collisionCount;
++i;
}
else
hasCollision = false;
} while (hasCollision);
return index;
}
int HashTable::insert(int item) {
//******************************************
// implement insertion of new element here *
//******************************************
int hashIndex = hashValue(item);
assert(hashTable->at(hashIndex) == -1);
hashTable->at(hashIndex) = item;
++elements;
return 0; //dummy return
}
int HashTable::at(int i) {
return hashTable->at(i);
}
int HashTable::getCollisionCount() {
return this->collisionCount;
}
int HashTable::getSize() {
return this->size;
}
int HashTable::getElements() {
return this->elements;
}
| [
"[email protected]"
] | |
f0021819715c4b142c6563a0c8686aae68e5563e | 03634587428660c3d79a0c0b1773bd250d4c9f80 | /Build/Classes/Native/Il2CppCodeRegistration.cpp | eb714a483df2242917b2b50edf486167913f7d86 | [] | no_license | lojayrivz/ARtista-Night | a0baf0369185a7c5879882d298bb85124395c577 | a4d6d597510b8492072ae02e1de5673e6fdda203 | refs/heads/master | 2020-06-15T17:27:54.779304 | 2019-10-28T03:19:38 | 2019-10-28T03:19:38 | 195,350,886 | 0 | 0 | null | 2019-10-28T03:19:39 | 2019-07-05T06:24:33 | null | UTF-8 | C++ | false | false | 1,328 | cpp | #include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <cstring>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <limits>
#include <assert.h>
#include "class-internals.h"
#include "codegen/il2cpp-codegen.h"
extern const Il2CppMethodPointer g_MethodPointers[];
extern const Il2CppMethodPointer g_Il2CppGenericMethodPointers[];
extern const InvokerMethod g_Il2CppInvokerPointers[];
extern const CustomAttributesCacheGenerator g_AttributeGenerators[];
extern const Il2CppMethodPointer g_UnresolvedVirtualMethodPointers[];
extern Il2CppInteropData g_Il2CppInteropData[];
const Il2CppCodeRegistration g_CodeRegistration =
{
14566,
g_MethodPointers,
0,
NULL,
6956,
g_Il2CppGenericMethodPointers,
2189,
g_Il2CppInvokerPointers,
3191,
g_AttributeGenerators,
369,
g_UnresolvedVirtualMethodPointers,
99,
g_Il2CppInteropData,
};
extern const Il2CppMetadataRegistration g_MetadataRegistration;
static const Il2CppCodeGenOptions s_Il2CppCodeGenOptions =
{
false,
};
static void s_Il2CppCodegenRegistration()
{
il2cpp_codegen_register (&g_CodeRegistration, &g_MetadataRegistration, &s_Il2CppCodeGenOptions);
}
static il2cpp::utils::RegisterRuntimeInitializeAndCleanup s_Il2CppCodegenRegistrationVariable (&s_Il2CppCodegenRegistration, NULL);
| [
"[email protected]"
] | |
4c4fd5423a4caa2e8918abcafcde5416aef9bfde | e5ad7592e0637996b5881777e07947a63504a68f | /bin/hog/netconnection.H | b6516ba14337294d18aa30a5c073a2bc222a13eb | [
"Apache-2.0"
] | permissive | jeb2239/hobbes | ff3519304c381a564e1d791b7263635afc44f301 | da9bd42dc6f97a496422605ca170b15c2e6b5b81 | refs/heads/master | 2020-12-03T00:38:44.224878 | 2018-12-26T21:50:53 | 2018-12-26T21:50:53 | 96,050,296 | 1 | 0 | null | 2017-07-02T21:36:42 | 2017-07-02T21:36:42 | null | UTF-8 | C++ | false | false | 1,168 | h | #ifndef HOG_NETCONNECTION_H_INCLUDED
#define HOG_NETCONNECTION_H_INCLUDED
#include <string>
#include <vector>
#include <cstdint>
namespace hog {
class NetConnection {
public:
NetConnection() = default;
virtual ~NetConnection() = default;
NetConnection(const NetConnection&) = delete;
void operator=(const NetConnection&) = delete;
virtual bool send(const void* buf, size_t size) = 0;
virtual bool sendFile(int fd) = 0;
virtual bool receive(void* buf, size_t size) = 0;
};
class DefaultNetConnection : public NetConnection {
public:
explicit DefaultNetConnection(const std::string& hostport);
explicit DefaultNetConnection(int fd);
~DefaultNetConnection();
bool send(const void* buf, size_t size) override;
bool sendFile(int fd) override;
bool receive(void* buf, size_t size) override;
private:
int _socket;
};
/// @throw std::runtime_error
void sendString(NetConnection& c, const std::string& str);
void receiveIntoBuffer(NetConnection& c, std::vector<uint8_t>* dst);
std::vector<uint8_t> receiveBuffer(NetConnection& c);
std::string receiveString(NetConnection& c);
} // namespace hog
#endif // HOG_NETCONNECTION_H_INCLUDED
| [
"[email protected]"
] | |
637bb5d5d0218bc6900f8a63cd53075cc3e249df | a963fae6f83291e06ac131f71a3c91f3b805cbfe | /include/fl/filter/gaussian/quadrature/unscented_quadrature.hpp | 8b28283f147041d3b783cbfa5e5014ddb61acae2 | [
"MIT"
] | permissive | aeolusbot-tommyliu/fl | cbfc4df98585af3a1ce375ad3645d24fcc4d8447 | a50d0c9620a8f86e0cd14a5e22ee0f022d00bd02 | refs/heads/master | 2020-09-13T00:20:18.819882 | 2019-11-19T05:34:12 | 2019-11-19T05:34:12 | 222,603,315 | 0 | 0 | MIT | 2019-11-19T03:49:28 | 2019-11-19T03:49:28 | null | UTF-8 | C++ | false | false | 1,265 | hpp | /*
* This is part of the fl library, a C++ Bayesian filtering library
* (https://github.com/filtering-library)
*
* Copyright (c) 2015 Max Planck Society,
* Autonomous Motion Department,
* Institute for Intelligent Systems
*
* This Source Code Form is subject to the terms of the MIT License (MIT).
* A copy of the license can be found in the LICENSE file distributed with this
* source code.
*/
/**
* \file unscented_quadrature.hpp
* \date July 2015
* \author Jan Issac ([email protected])
*/
#pragma once
#include <fl/filter/gaussian/transform/unscented_transform.hpp>
#include <fl/filter/gaussian/quadrature/sigma_point_quadrature.hpp>
namespace fl
{
class UnscentedQuadrature
: public SigmaPointQuadrature<UnscentedTransform>
{
public:
/**
* Creates a UnscentedQuadrature
*
* \param alpha UT Scaling parameter alpha (distance to the mean)
* \param beta UT Scaling parameter beta (2.0 is optimal for Gaussian)
* \param kappa UT Scaling parameter kappa (higher order parameter)
*/
UnscentedQuadrature(Real alpha = 1.0, Real beta = 2., Real kappa = 0.)
: SigmaPointQuadrature<UnscentedTransform>(
UnscentedTransform(alpha, beta, kappa))
{ }
};
}
| [
"[email protected]"
] | |
49de7977d25d0b158f403b135c2c0255be592ca9 | b60bcbce8a7d36faed7bc1a2785f2106802fb66c | /testAPE.cpp | c2c55f125cff4bdeae06ddb210c0dcebb3a2b15e | [] | no_license | ym41608/L-APEcuda | 9c85330187e73fd0e91f551aa5a4145a707a867a | ce2dd8f37e39e656a5bf90c81c402a09a3314c4c | refs/heads/master | 2021-01-17T18:23:16.385131 | 2016-06-23T07:07:40 | 2016-06-23T07:07:40 | 56,775,178 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,178 | cpp | #include <opencv2/opencv.hpp>
#include <iostream>
#include "APE.h"
using namespace std;
using namespace cv;
void drawCoordinate(float *ex_mat, const float &Sfx, const float &Sfy, const float &Px, const float &Py, Mat &img, const Mat &marker, const float &minDim) {
float trans[16];
trans[0] = Sfx*ex_mat[0] + Px*ex_mat[8];
trans[1] = Sfx*ex_mat[1] + Px*ex_mat[9];
trans[2] = Sfx*ex_mat[2] + Px*ex_mat[10];
trans[3] = Sfx*ex_mat[3] + Px*ex_mat[11];
trans[4] = Sfy*ex_mat[4] + Py*ex_mat[8];
trans[5] = Sfy*ex_mat[5] + Py*ex_mat[9];
trans[6] = Sfy*ex_mat[6] + Py*ex_mat[10];
trans[7] = Sfy*ex_mat[7] + Py*ex_mat[11];
trans[8] = ex_mat[8];
trans[9] = ex_mat[9];
trans[10] = ex_mat[10];
trans[11] = ex_mat[11];
trans[12] = 0;
trans[13] = 0;
trans[14] = 0;
trans[15] = 1;
float dimX = (marker.cols < marker.rows) ? minDim : (minDim * float(marker.cols) / float(marker.rows));
float dimY = (marker.cols < marker.rows) ? (minDim * float(marker.rows) / float(marker.cols)) : minDim;
Point_<float> B1, B2, B3, B4, T1, T2, T3, T4;
B1.x = (trans[0]*dimX + trans[1]*dimY + trans[2]*0.0 + trans[3]) /
(trans[8]*dimX + trans[9]*dimY + trans[10]*0.0 + trans[11]);
B1.y = (trans[4]*dimX + trans[5]*dimY + trans[6]*0.0 + trans[7]) /
(trans[8]*dimX + trans[9]*dimY + trans[10]*0.0 + trans[11]);
B2.x = (trans[0]*dimX + trans[1]*(-dimY) + trans[2]*0.0 + trans[3]) /
(trans[8]*dimX + trans[9]*(-dimY) + trans[10]*0.0 + trans[11]);
B2.y = (trans[4]*dimX + trans[5]*(-dimY) + trans[6]*0.0 + trans[7]) /
(trans[8]*dimX + trans[9]*(-dimY) + trans[10]*0.0 + trans[11]);
B3.x = (trans[0]*(-dimX) + trans[1]*(-dimY) + trans[2]*0.0 + trans[3]) /
(trans[8]*(-dimX) + trans[9]*(-dimY) + trans[10]*0.0 + trans[11]);
B3.y = (trans[4]*(-dimX) + trans[5]*(-dimY) + trans[6]*0.0 + trans[7]) /
(trans[8]*(-dimX) + trans[9]*(-dimY) + trans[10]*0.0 + trans[11]);
B4.x = (trans[0]*(-dimX) + trans[1]*dimY + trans[2]*0.0 + trans[3]) /
(trans[8]*(-dimX) + trans[9]*dimY + trans[10]*0.0 + trans[11]);
B4.y = (trans[4]*(-dimX) + trans[5]*dimY + trans[6]*0.0 + trans[7]) /
(trans[8]*(-dimX) + trans[9]*dimY + trans[10]*0.0 + trans[11]);
T1.x = (trans[0]*dimX + trans[1]*dimY + trans[2]*dimY + trans[3]) /
(trans[8]*dimX + trans[9]*dimY + trans[10]*dimY + trans[11]);
T1.y = (trans[4]*dimX + trans[5]*dimY + trans[6]*dimY + trans[7]) /
(trans[8]*dimX + trans[9]*dimY + trans[10]*dimY + trans[11]);
T2.x = (trans[0]*dimX + trans[1]*(-dimY) + trans[2]*dimY + trans[3]) /
(trans[8]*dimX + trans[9]*(-dimY) + trans[10]*dimY + trans[11]);
T2.y = (trans[4]*dimX + trans[5]*(-dimY) + trans[6]*dimY + trans[7]) /
(trans[8]*dimX + trans[9]*(-dimY) + trans[10]*dimY + trans[11]);
T3.x = (trans[0]*(-dimX) + trans[1]*(-dimY) + trans[2]*dimY + trans[3]) /
(trans[8]*(-dimX) + trans[9]*(-dimY) + trans[10]*dimY + trans[11]);
T3.y = (trans[4]*(-dimX) + trans[5]*(-dimY) + trans[6]*dimY + trans[7]) /
(trans[8]*(-dimX) + trans[9]*(-dimY) + trans[10]*dimY + trans[11]);
T4.x = (trans[0]*(-dimX) + trans[1]*dimY + trans[2]*dimY + trans[3]) /
(trans[8]*(-dimX) + trans[9]*dimY + trans[10]*dimY + trans[11]);
T4.y = (trans[4]*(-dimX) + trans[5]*dimY + trans[6]*dimY + trans[7]) /
(trans[8]*(-dimX) + trans[9]*dimY + trans[10]*dimY + trans[11]);
line(img, B1, B2, Scalar(255, 0, 0), 2, CV_AA);
line(img, B2, B3, Scalar(255, 0, 0), 2, CV_AA);
line(img, B3, B4, Scalar(255, 0, 0), 2, CV_AA);
line(img, B4, B1, Scalar(255, 0, 0), 2, CV_AA);
line(img, B1, T1, Scalar(0, 255, 0), 2, CV_AA);
line(img, B2, T2, Scalar(0, 255, 0), 2, CV_AA);
line(img, B3, T3, Scalar(0, 255, 0), 2, CV_AA);
line(img, B4, T4, Scalar(0, 255, 0), 2, CV_AA);
line(img, T1, T2, Scalar(255, 255, 0), 2, CV_AA);
line(img, T2, T3, Scalar(255, 255, 0), 2, CV_AA);
line(img, T3, T4, Scalar(255, 255, 0), 2, CV_AA);
line(img, T4, T1, Scalar(255, 255, 0), 2, CV_AA);
}
int main(int argc, char *argv[]) {
if (argc != 13) {
cout << "invalid argument!" << endl;
cout << "./testAPE markerFile imgFile Sfx Sfy Px Py minMarkerDim minTz maxTz delta photometric verbose" << endl;
return -1;
}
// assign parameters
float Sfx = stof(string(argv[3]));
float Sfy = stof(string(argv[4]));
int Px = stoi(string(argv[5]));
int Py = stoi(string(argv[6]));
float minDim = stof(string(argv[7]));
float minTz = stof(string(argv[8]));
float maxTz = stof(string(argv[9]));
float delta = stof(string(argv[10]));;
bool photo = bool(stoi(string(argv[11])));
bool verbose = bool(stoi(string(argv[12])));
Mat marker = cv::imread(argv[1]);
Mat img = cv::imread(argv[2]);
if(!marker.data ) {
cout << "Could not open marker" << std::endl ;
return -1;
}
if(!img.data ) {
cout << "Could not open img" << std::endl ;
return -1;
}
float *ex_mat = new float[12];
APE(ex_mat, marker, img, Sfx, Sfy, Px, Py, minDim, minTz, maxTz, delta, photo, verbose);
drawCoordinate(ex_mat, Sfx, Sfy, Px, Py, img, marker, minDim);
imwrite("img/result.png", img);
delete[] ex_mat;
return 0;
}
| [
"[email protected]"
] | |
ab7c89e90f5aae621b7ba24af230dc61155f851a | 16943a756d8ea51133084b87b28ec83d57201c57 | /c++11/stl/std_lambda.cpp | 05cc7b5292774da73a0e6d59ecbce74f3439985c | [] | no_license | chengls/examples-make | cf10c0bb71ff8f842ac4837796089ab5b8f9f1f5 | 554d3323df9f9a5a41b79a2d6ce735da3ee59a81 | refs/heads/master | 2021-04-14T06:06:25.705564 | 2020-02-28T10:49:36 | 2020-02-28T10:49:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 906 | cpp | #include <algorithm>
#include <iostream>
#include <vector>
bool cmp(int a, int b)
{
return a < b;
}
int main(int argc, char const* argv[])
{
std::vector<int> vec{ 1, 2, 5, 7, 3, 0, 19, 15 };
std::vector<int> lvec{ vec };
std::sort(lvec.begin(), lvec.end(), cmp);
for (int i : lvec) {
std::cout << i << std::endl;
}
std::sort(vec.begin(), vec.end(), [](int a, int b) -> bool { return a > b; });
for (int i : vec) {
std::cout << i << std::endl;
}
//捕获外部变量
int a = 123;
auto f = [a](int b) { return a + b; };
std::cout << f(12) << "\n";
auto x = [=](int b) { return a + b; }(1236);
/**
* 值传递、 [a]
* 引入传递、[&a]
* 指针传递 []
*
* 隐式捕获 [=]
*/
//修改变量的捕获
auto mf = [=]() mutable { std::cout << ++a << "\n"; };
mf();
return 0;
}
| [
"[email protected]"
] | |
26ed5b7187cf18abf10e34e67016207b10129da8 | 5117c76d200a78e13ab79b10ba58633c0fababb2 | /lab10/lab10b.cpp | aaf9379a04c307df0b87b0b3de2f611c749f3ca0 | [] | no_license | ingridnkenli/cpluspluslabs | d23b5e49ebcc031a6967f34ecb3da028ff69e46d | 753f40902a953f362c0a11a09945602e61a7d9ae | refs/heads/master | 2022-04-08T19:47:14.982203 | 2020-02-29T21:16:58 | 2020-02-29T21:16:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,142 | cpp | #include <iostream>
using namespace std;
// Use this file to implement the templated class ProdList
// ProdList is a class that stores an array of 5 elements of a templated type
// The constructor takes no parameters and sets all elements of the array to 0
// setIndex function takes an index and value
// and sets the element of the array at the given index to the given value
// (assume 0<=index<=4)
// product function should return the product of all elements in the list
// Define Constants Here
// Implement the class ProdList here:
template <class T>
class ProdList {
public:
ProdList();
void setIndex(int index, T val);
T product();
private:
T m_array[5];
};
// Implement constructor here:
template <class T>
ProdList<T>::ProdList() {
m_array[5] = {0};
}
// Implement product function here:
template <class T>
T ProdList<T>::product() {
T prod = 1;
for(int i= 0; i<5; i++){
prod *= m_array[i];
}
return prod;
}
//Implement setIndex function here:
template <class T>
void ProdList<T>::setIndex(int index, T val) {
m_array[index] = val;
}
int main()
{
ProdList<int> intList; // list of 5 ints
ProdList<float> floatList; // list of 5 floats
ProdList<unsigned int> uintList; // list of 5 unsigned ints
// test list of ints
int intVals[] = {1,2,3,4,-5};
for (int i=0; i<5; i++) {
intList.setIndex(i, intVals[i]);
}
cout << "int results -120 expected):" << endl;
cout << intList.product() << endl;
// test list of floats
// initial list should be all 0.0
cout << endl << "float results: (0 expected):" << endl;
cout << floatList.product() << endl;
float floatVals[] = {10,1.5,2.5,4,-4.5};
for (int i=0; i<5; i++) {
floatList.setIndex(i, floatVals[i]);
}
cout << endl << "float results: (-675 expected):" << endl;
cout << floatList.product() << endl;
// test list of unsigned ints
unsigned int uintVals[] = {56,1,78,2,3};
for (int i=0; i<5; i++) {
uintList.setIndex(i, uintVals[i]);
}
cout << endl << "unsigned int results: (26208 expected):" << endl;
cout << uintList.product() << endl << endl;
return 0;
}
| [
"[email protected]"
] | |
98d3da5c555c93a421f97f01d4998059c61862ec | 3dba6c65a8588b8b9f36dbcf227d53209832676f | /OSGCh04/OSGCh04Ex02/main.cpp | 6f659bdf0d2788e02a9584a3ab64eee065195ef2 | [] | no_license | renchuanrc/OSGCookbook | fb1b73ae088e1f0688473d8b57230806d2ddf042 | 3f3eb9bcf0a34220393a2ed333646b3a4ca956a7 | refs/heads/master | 2020-12-29T04:28:28.280249 | 2020-02-05T06:53:20 | 2020-02-05T06:53:20 | 238,455,687 | 1 | 1 | null | 2020-02-05T13:23:05 | 2020-02-05T13:23:03 | null | GB18030 | C++ | false | false | 2,486 | cpp | #include <iostream>
#include <osg/Notify>
#include <osg/MatrixTransform>
#include <osg/PositionAttitudeTransform>
#include <osg/Geometry>
#include <osg/Geode>
#include <osg/ShapeDrawable>
#include <osgUtil/Optimizer>
#include <osgDB/Registry>
#include <osgDB/ReadFile>
#include <osgGA/TrackballManipulator>
#include <osgGA/FlightManipulator>
#include <osgGA/DriveManipulator>
#include <osgSim/OverlayNode>
#include <osgText/Font>
#include <osgText/Text>
#include <osgViewer/Viewer>
#include <iostream>
#include "Common.h"
#include "PickHandler.h"
osg::Camera* createSlaveCamera(int x, int y, int width, int height)
{
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
traits->screenNum = 0; // 多屏幕时可以修改
traits->x = x;
traits->y = y;
traits->width = width;
traits->height = height;
traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->sharedContext = 0;
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
if (!gc) return NULL;
osg::ref_ptr<osg::Camera> camera = new osg::Camera;
camera->setGraphicsContext(gc.get());
camera->setViewport(new osg::Viewport(0, 0, width, height));
GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
camera->setDrawBuffer(buffer);
camera->setReadBuffer(buffer);
return camera.release();
}
int main(int argc, char** argv)
{
osg::ArgumentParser arguments(&argc, argv);
int totalWidth = 1024, totalHeight = 768;
arguments.read("--total-width", totalWidth);
arguments.read("--total-height", totalHeight);
int numColumns = 3, numRows = 3;
arguments.read("--num-columns", numColumns);
arguments.read("--num-rows", numRows);
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments);
if (!scene) scene = osgDB::readNodeFile("cessna.osg");
osgViewer::Viewer viewer;
int tileWidth = totalWidth / numColumns;
int tileHeight = totalHeight / numRows;
for (int row = 0; row < numRows; ++row)
{
for (int col = 0; col < numColumns; ++col)
{
osg::Camera* camera = createSlaveCamera(
tileWidth*col, totalHeight - tileHeight*(row + 1),
tileWidth - 1, tileHeight - 1);
osg::Matrix projOffset =
osg::Matrix::scale(numColumns, numRows, 1.0) *
osg::Matrix::translate(numColumns - 1 - 2 * col,
numRows - 1 - 2 * row, 0.0);
// 2, 0, -2
viewer.addSlave(camera, projOffset, osg::Matrix(), true);
//break;
}
}
viewer.setSceneData(scene);
return viewer.run();
}
| [
"[email protected]"
] | |
7bd5ed0866e7f7acab866fb84c724acde6653e97 | 16bb1ca4f642a3d9132df34c1a7a9afbc69f1ac5 | /TommyGun/Plugins/ImageEditor/TileImage/fTileType.cpp | 6f7ce3c710e1baa7e582e63ad7120ad05f7c4db3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | tonyt73/TommyGun | 6138b81b447da0b448bcecb893ed46cadcf56c80 | 19e704243bc02500193fe798bd3bee71f75de094 | refs/heads/master | 2023-03-17T10:19:08.971368 | 2023-03-11T23:39:37 | 2023-03-11T23:39:37 | 89,913,869 | 41 | 6 | NOASSERTION | 2023-03-11T22:41:39 | 2017-05-01T10:02:20 | C++ | UTF-8 | C++ | false | false | 13,406 | cpp | /*---------------------------------------------------------------------------
(c) 2004 Scorpio Software
19 Wittama Drive
Glenmore Park
Sydney NSW 2745
Australia
-----------------------------------------------------------------------------
$Workfile:: $
$Revision:: $
$Date:: $
$Author:: $
---------------------------------------------------------------------------*/
//---------------------------------------------------------------------------
#include "pch.h"
#pragma hdrstop
//---------------------------------------------------------------------------
#include "..\..\..\SafeMacros.h"
#include "fTileType.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "KSpinEdit"
#pragma resource "*.dfm"
//---------------------------------------------------------------------------
using namespace Scorpio;
using namespace ImageTypes;
//---------------------------------------------------------------------------
TfrmTileType *frmTileType = NULL;
//---------------------------------------------------------------------------
__fastcall TfrmTileType::TfrmTileType(TComponent* Owner)
: TForm(Owner)
, m_pImageManager(NULL)
, m_bSizeEnabled(true)
{
}
//---------------------------------------------------------------------------
HRESULT __fastcall TfrmTileType::Initialize(TZX_HPLUGIN PluginHandle, HINSTANCE hParentInstance)
{
RL_HRESULT(S_OK);
m_PluginHandle = PluginHandle;
m_ImageEditor.GetInterfaces(hParentInstance);
TTabSheet* pTabSheet = NULL;
m_ImageEditor.TypeAddTab(PluginHandle, "Tiles", imgIcon->Picture->Bitmap, pTabSheet);
if (true == SAFE_PTR(pTabSheet))
{
panTiles->Parent = pTabSheet;
}
m_ImageEditor.TypeGetImageManager(PluginHandle, m_pImageManager);
return hResult;
}
//---------------------------------------------------------------------------
HRESULT __fastcall TfrmTileType::Release(void)
{
return S_OK;
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::SetPalettes(TStrings* pPalettes, std::vector<String>& vSignatures)
{
cmbTileFormat->Items->Clear();
cmbTileFormat->Enabled = false;
if (true == SAFE_PTR(pPalettes) && 0 < pPalettes->Count)
{
// filter out the required palettes
for (int i = 0; i < pPalettes->Count; i++)
{
ZXPalette* pPalette = m_pImageManager->GetPalette(i);
if (true == SAFE_PTR(pPalette) && pPalette->IsImageTypeSupported(itTile))
{
cmbTileFormat->Items->Add(pPalette->Name);
m_vPaletteSignatures.push_back(vSignatures[i]);
}
}
//cmbTileFormat->Items->AddStrings(pPalettes);
cmbTileFormat->Enabled = cmbTileFormat->Items->Count > 0;
cmbTileFormat->ItemIndex = 0;
//m_vPaletteSignatures.assign(vSignatures.begin(), vSignatures.end());
}
edtTileName->Enabled = (0 < pPalettes->Count);
lstTileList->Enabled = edtTileName->Enabled;
edtTileWidth->Enabled = edtTileName->Enabled;
edtTileHeight->Enabled = edtTileName->Enabled;
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::cmdTileAddClick(TObject *Sender)
{
if (true == SAFE_PTR(m_pImageManager))
{
int iMinWidth = 8;
ZXPalette* pPalette = m_pImageManager->GetPalette(cmbTileFormat->Items->Strings[cmbTileFormat->ItemIndex]);
if (SAFE_PTR(pPalette))
{
iMinWidth = pPalette->PixelsPerByte;
}
if (edtTileWidth->Enabled && edtTileWidth->Value % iMinWidth)
{
edtTileWidth->Value = (edtTileWidth->Value + iMinWidth) - (edtTileWidth->Value % iMinWidth);
}
if (edtTileHeight->Enabled && edtTileHeight->Value % m_iPixelsHigh)
{
edtTileHeight->Value = (edtTileHeight->Value + m_iPixelsHigh) - (edtTileHeight->Value % m_iPixelsHigh);
}
int iIndex = m_pImageManager->AddImage(g_sTypeSignature,
m_vPaletteSignatures[cmbTileFormat->ItemIndex],
edtTileName->Text,
edtTileWidth->Value,
edtTileHeight->Value,
chkTileMasked->Checked,
NULL,
true);
if (-1 != iIndex)
{
m_ImageEditor.TypeSelectImage(m_PluginHandle, g_sTypeSignature, iIndex, 0);
m_pImageManager->GetImageList(g_sTypeSignature, lstTileList->Items);
lstTileList->ItemIndex = iIndex;
UpdatePreview();
UpdateButtons();
}
}
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::lstTileListClick(TObject *Sender)
{
ZXImage* pImage = m_pImageManager->GetImage(g_sTypeSignature, lstTileList->ItemIndex, 0);
if (true == SAFE_PTR(pImage))
{
pImage->CanResize = true;
edtTileName->Text = pImage->Name;
edtTileWidth->Value = edtTileWidth->Enabled ? pImage->Width : 8;
edtTileHeight->Value = edtTileHeight->Enabled ? pImage->Height : 8;
m_iPixelsHigh = pImage->Palette->PixelsHighPerAttribute;
chkTileMasked->Checked = pImage->IsMasked;
edtTileHeight->Step = m_iPixelsHigh;
SetComboText(cmbTileFormat, pImage->Palette->Name);
cmbType->ItemIndex = m_pImageManager->GetSubType(g_sTypeSignature, lstTileList->ItemIndex);
}
m_ImageEditor.TypeSelectImage(m_PluginHandle, g_sTypeSignature, lstTileList->ItemIndex, 0);
UpdateButtons();
UpdatePreview();
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::pbxTilePreviewPaint(TObject *Sender)
{
UpdatePreview();
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::UpdatePreview(void)
{
pbxTilePreview->Canvas->Brush->Color = clWhite;
pbxTilePreview->Canvas->FillRect(pbxTilePreview->ClientRect);
if (true == SAFE_PTR(m_pImageManager))
{
ZXImage* pImage = m_pImageManager->GetImage(g_sTypeSignature, lstTileList->ItemIndex, 0);
if (true == SAFE_PTR(pImage))
{
bool bMaskMode = pImage->MaskMode;
m_pImageManager->SetMaskMode(false);
pImage->Invalidate();
float fImgX = pImage->ModeScaleX;
float fImgY = pImage->ModeScaleY;
pImage->ModeScaleX = pImage->Palette->ScalarX;
pImage->ModeScaleY = pImage->Palette->ScalarY;
int sw = std::max((int)((int)(panTilePreview->Width / pImage->Width ) / pImage->Palette->ScalarX), 1);
int sh = std::max((int)((int)(panTilePreview->Height / pImage->Height) / pImage->Palette->ScalarY), 1);
int ss = std::min(sw, sh);
pbxTilePreview->Width = ss * pImage->Width;
pbxTilePreview->Height = ss * pImage->Height;
pbxTilePreview->Left = ((panTilePreview->Width - pbxTilePreview->Width ) / 2) - 1;
pbxTilePreview->Top = ((panTilePreview->Height - pbxTilePreview->Height) / 2) - 1;
pImage->Draw(pbxTilePreview->Canvas, ss);
pImage->ModeScaleX = fImgX;
pImage->ModeScaleY = fImgY;
edtTileWidth->Value = edtTileWidth->Enabled ? pImage->Width : 8;
edtTileHeight->Value = edtTileHeight->Enabled ? pImage->Height : 8;
m_pImageManager->SetMaskMode(bMaskMode);
}
}
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::edtTileNameChange(TObject *Sender)
{
edtTileWidth->Enabled = m_bSizeEnabled || edtTileName->Text.LowerCase() == "scorepanel";
edtTileHeight->Enabled = m_bSizeEnabled || edtTileName->Text.LowerCase() == "scorepanel";
UpdateButtons();
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::UpdateButtons(void)
{
cmdTileAdd->Enabled = false;
cmdTileRemove->Enabled = false;
cmdTileRename->Enabled = false;
cmdTileClone->Enabled = false;
if (true == SAFE_PTR(m_pImageManager))
{
cmdTileAdd->Enabled = edtTileName->Text != "";
cmdTileAdd->Enabled &= !m_pImageManager->DoesImageExist(g_sTypeSignature, edtTileName->Text);
cmdTileRename->Enabled = cmdTileAdd->Enabled && -1 != lstTileList->ItemIndex;
cmdTileRemove->Enabled = 0 != m_pImageManager->GetImageCount(g_sTypeSignature);
cmdTileClone->Enabled = 0 != m_pImageManager->GetImageCount(g_sTypeSignature) && -1 != lstTileList->ItemIndex;
ZXImage* pImage = m_pImageManager->GetImage(g_sTypeSignature, lstTileList->ItemIndex, 0);
if (true == SAFE_PTR(pImage))
{
edtTileWidth->Value = pImage->Width;
edtTileHeight->Value = pImage->Height;
}
}
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::cmdTileRemoveClick(TObject *Sender)
{
if (true == SAFE_PTR(m_pImageManager))
{
int iAnswer = 0;
m_ImageEditor.SystemMessageBox(mbtWarning,
"Do you want to Remove a tile image?",
"You are about to remove a tile.",
"You have choosen to remove a tile\n"
"This is a permanent operation and you will not be able to Undo this operation\n\n"
"Click\n"
"\tYes\tto Remove the tile permanently\n"
"\tNo\tto cancel the operation and leave the tile",
"No", "Yes", "", iAnswer );
if (1 == iAnswer)
{
if (true == m_pImageManager->RemoveImage(g_sTypeSignature, lstTileList->ItemIndex))
{
lstTileList->Items->Strings[lstTileList->ItemIndex] = edtTileName->Text;
m_pImageManager->GetImageList(g_sTypeSignature, lstTileList->Items);
lstTileList->ItemIndex = -1;
edtTileName->Text = "";
m_ImageEditor.TypeSelectImage(m_PluginHandle, g_sTypeSignature, -1, 0);
UpdatePreview();
}
}
}
UpdateButtons();
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::cmdTileCloneClick(TObject *Sender)
{
if (true == SAFE_PTR(m_pImageManager))
{
String sName = edtTileName->Text;
while (true == m_pImageManager->DoesImageExist(g_sTypeSignature, sName))
{
sName = "Copy of " + sName;
}
int iIndex = m_pImageManager->CloneImage(g_sTypeSignature, sName, lstTileList->ItemIndex);
if (-1 != iIndex)
{
m_ImageEditor.TypeSelectImage(m_PluginHandle, g_sTypeSignature, iIndex, 0);
m_pImageManager->GetImageList(g_sTypeSignature, lstTileList->Items);
lstTileList->ItemIndex = iIndex;
UpdatePreview();
UpdateButtons();
}
}
UpdateButtons();
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::cmdTileRenameClick(TObject *Sender)
{
if (true == SAFE_PTR(m_pImageManager) && -1 != lstTileList->ItemIndex)
{
if (true == m_pImageManager->RenameImage(g_sTypeSignature, lstTileList->ItemIndex, edtTileName->Text))
{
lstTileList->Items->Strings[lstTileList->ItemIndex] = edtTileName->Text;
}
}
UpdateButtons();
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::RefreshList(void)
{
lstTileList->ItemIndex = -1;
m_pImageManager->GetImageList(g_sTypeSignature, lstTileList->Items);
if (0 < lstTileList->Items->Count)
{
lstTileList->ItemIndex = 0;
}
UpdatePreview();
UpdateButtons();
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::SetComboText(TComboBox* pComboBox, String sText)
{
for (int i = 0; i < pComboBox->Items->Count; i++)
{
if (pComboBox->Items->Strings[i] == sText)
{
pComboBox->ItemIndex = i;
break;
}
}
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::cmbTileFormatChange(TObject *Sender)
{
ZXPalette* pPalette = m_pImageManager->GetPalette(cmbTileFormat->Items->Strings[cmbTileFormat->ItemIndex]);
if (true == SAFE_PTR(pPalette))
{
m_iPixelsHigh = pPalette->PixelsHighPerAttribute;
edtTileHeight->Step = m_iPixelsHigh;
}
}
//---------------------------------------------------------------------------
void __fastcall TfrmTileType::cmbTypeChange(TObject *Sender)
{
m_pImageManager->SetSubType(g_sTypeSignature, lstTileList->ItemIndex, cmbType->ItemIndex);
}
//---------------------------------------------------------------------------
| [
"[email protected]"
] | |
854ac59c97bf24dfbf09cdea7a117f85d9030fae | 26a0d566b6e0b2e4faf669511b3ad5df7ee93891 | /codeforces/neerc-2017-northern/k.cpp | b76db40856e665f57edcec2a5707937a03f7bfb5 | [] | no_license | sureyeaah/Competitive | 41aeadc04b2a3b7eddd71e51b66fb4770ef64d9d | 1960531b106c4ec0c6a44092996e6f8681fe3991 | refs/heads/master | 2022-09-13T20:46:39.987360 | 2020-05-30T23:20:41 | 2020-05-30T23:31:11 | 109,183,690 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,940 | cpp | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define FOR0(i,n) for(int i=0, _##i=(n); i<_##i; ++i)
#define FOR(i,l,r) for(int i=(l), _##i=(r); i<_##i; ++i)
#define FORD(i,l,r) for(int i=(r), _##i=(l); --i>=_##i; )
#define repi(i,a) for(__typeof((a).begin()) i=(a).begin(), _##i=(a).end(); i!=_##i; ++i)
#define dwni(i,a) for(__typeof((a).rbegin()) i=(a).rbegin(), _##i=(a).rend(); i!=_##i; ++i)
#define SZ(a) ((int)((a).size()))
#define printCase() "Case #" << caseNum << ": "
#define pb push_back
#define mp make_pair
#define EPS (1e-9)
#define PI 3.1415926535
#define inf ((int)1e9)
#define INF ((ll)9e18)
#define mod (1000000000 + 7)
#define newl '\n'
#define SYNC std::ios::sync_with_stdio(false); cin.tie(NULL);
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
const int N = 105;
char out[N][N];
int main() {
ifstream cin("kotlin.in");
ofstream cout("kotlin.out");
SYNC
int h, w, n;
cin >> h >> w >> n;
FOR(i, 0, (h-1)/2 + 1) {
FOR(j, 0, (w-1)/2 + 1) {
if((i+1) * (j+1) == n) {
FOR0(x, h) FOR0(y, w) out[x][y] = '.';
for(int x = 1; x < h && i; x += 2) {
for(int y = 0; y < w; y++) {
out[x][y]= '#';
}
i--;
}
for(int y = 1; y < w && j; y += 2) {
for(int x = 0; x < h; x++) {
out[x][y]= '#';
}
j--;
}
FOR0(x, h) {
FOR0(y, w) cout << out[x][y];
cout << newl;
}
return 0;
}
}
}
cout << "Impossible";
} | [
"[email protected]"
] | |
b393a21bddfce652a8994966ab60d8794c64d707 | 2c8ec6b5de0cdf09b124354a062ed53771cac2c2 | /support/json/JSONValue.cpp | b0d35c2b82e3f6a68f4ea2ffabc05685fb8c4c22 | [] | no_license | Kawa-oneechan/newsci | 3fcbb97ef1db69d3012c1bb4bd0b4adac9b553c2 | 0ebb5f27fc82b555fd00fddda88f42a8ad74d554 | refs/heads/master | 2022-09-06T02:34:07.656398 | 2022-08-15T21:52:29 | 2022-08-15T21:52:29 | 203,455,013 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 19,323 | cpp | /*
* File JSONValue.cpp part of the SimpleJSON Library - http://mjpa.in/json
*
* Copyright (C) 2010 Mike Anchor
*
* 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 <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <vector>
#include <string>
#include <sstream>
#include <iostream>
#include <math.h>
#include "JSONValue.h"
#ifdef __MINGW32__
#define wcsncasecmp wcsnicmp
#endif
// Macros to free an array/object
#define FREE_ARRAY(x) { JSONArray::iterator iter; for (iter = x.begin(); iter != x.end(); iter++) { delete *iter; } }
#define FREE_OBJECT(x) { JSONObject::iterator iter; for (iter = x.begin(); iter != x.end(); iter++) { delete (*iter).second; } }
/**
* Parses a JSON encoded value to a JSONValue object
*
* @access protected
*
* @param char** data Pointer to a char* that contains the data
*
* @return JSONValue* Returns a pointer to a JSONValue object on success, NULL on error
*/
JSONValue *JSONValue::Parse(const char **data)
{
// Is it a string?
if (**data == '"')
{
std::string str;
if (!JSON::ExtractString(&(++(*data)), str))
return NULL;
else
return new JSONValue(str);
}
// Is it a boolean?
else if ((simplejson_wcsnlen(*data, 4) && _strnicmp(*data, "true", 4) == 0) || (simplejson_wcsnlen(*data, 5) && _strnicmp(*data, "false", 5) == 0))
{
bool value = _strnicmp(*data, "true", 4) == 0;
(*data) += value ? 4 : 5;
return new JSONValue(value);
}
// Is it a null?
else if (simplejson_wcsnlen(*data, 4) && _strnicmp(*data, "null", 4) == 0)
{
(*data) += 4;
return new JSONValue();
}
// Is it a number?
else if (**data == L'-' || (**data >= L'0' && **data <= L'9'))
{
// Negative?
bool neg = **data == L'-';
if (neg) (*data)++;
double number = 0.0;
// Parse the whole part of the number - only if it wasn't 0
if (**data == L'0')
(*data)++;
else if (**data >= L'1' && **data <= L'9')
number = JSON::ParseInt(data);
else
return NULL;
// Could be a decimal now...
if (**data == '.')
{
(*data)++;
// Not get any digits?
if (!(**data >= L'0' && **data <= L'9'))
return NULL;
// Find the decimal and sort the decimal place out
// Use ParseDecimal as ParseInt won't work with decimals less than 0.1
// thanks to Javier Abadia for the report & fix
double decimal = JSON::ParseDecimal(data);
// Save the number
number += decimal;
}
// Could be an exponent now...
if (**data == L'E' || **data == L'e')
{
(*data)++;
// Check signage of expo
bool neg_expo = false;
if (**data == L'-' || **data == L'+')
{
neg_expo = **data == L'-';
(*data)++;
}
// Not get any digits?
if (!(**data >= L'0' && **data <= L'9'))
return NULL;
// Sort the expo out
double expo = JSON::ParseInt(data);
for (double i = 0.0; i < expo; i++)
number = neg_expo ? (number / 10.0) : (number * 10.0);
}
// Was it neg?
if (neg) number *= -1;
return new JSONValue(number);
}
// An object?
else if (**data == L'{')
{
JSONObject object;
(*data)++;
while (**data != 0)
{
// Whitespace at the start?
if (!JSON::SkipWhitespace(data))
{
FREE_OBJECT(object);
return NULL;
}
// Special case - empty object
if (object.size() == 0 && **data == L'}')
{
(*data)++;
return new JSONValue(object);
}
// We want a string now...
std::string name;
if (!JSON::ExtractString(&(++(*data)), name))
{
FREE_OBJECT(object);
return NULL;
}
// More whitespace?
if (!JSON::SkipWhitespace(data))
{
FREE_OBJECT(object);
return NULL;
}
// Need a : now
if (*((*data)++) != L':')
{
FREE_OBJECT(object);
return NULL;
}
// More whitespace?
if (!JSON::SkipWhitespace(data))
{
FREE_OBJECT(object);
return NULL;
}
// The value is here
JSONValue *value = Parse(data);
if (value == NULL)
{
FREE_OBJECT(object);
return NULL;
}
// Add the name:value
if (object.find(name) != object.end())
delete object[name];
object[name] = value;
// More whitespace?
if (!JSON::SkipWhitespace(data))
{
FREE_OBJECT(object);
return NULL;
}
// End of object?
if (**data == L'}')
{
(*data)++;
return new JSONValue(object);
}
// Want a , now
if (**data != L',')
{
FREE_OBJECT(object);
return NULL;
}
(*data)++;
}
// Only here if we ran out of data
FREE_OBJECT(object);
return NULL;
}
// An array?
else if (**data == L'[')
{
JSONArray array;
(*data)++;
while (**data != 0)
{
// Whitespace at the start?
if (!JSON::SkipWhitespace(data))
{
FREE_ARRAY(array);
return NULL;
}
// Special case - empty array
if (array.size() == 0 && **data == L']')
{
(*data)++;
return new JSONValue(array);
}
// Get the value
JSONValue *value = Parse(data);
if (value == NULL)
{
FREE_ARRAY(array);
return NULL;
}
// Add the value
array.push_back(value);
// More whitespace?
if (!JSON::SkipWhitespace(data))
{
FREE_ARRAY(array);
return NULL;
}
// End of array?
if (**data == L']')
{
(*data)++;
return new JSONValue(array);
}
// Want a , now
if (**data != L',')
{
FREE_ARRAY(array);
return NULL;
}
(*data)++;
}
// Only here if we ran out of data
FREE_ARRAY(array);
return NULL;
}
// Ran out of possibilites, it's bad!
else
{
return NULL;
}
}
/**
* Basic constructor for creating a JSON Value of type NULL
*
* @access public
*/
JSONValue::JSONValue(/*NULL*/)
{
type = JSONType_Null;
}
/**
* Basic constructor for creating a JSON Value of type String
*
* @access public
*
* @param char* m_char_value The string to use as the value
*/
JSONValue::JSONValue(const char *m_char_value)
{
type = JSONType_String;
string_value = new std::string(std::string(m_char_value));
}
/**
* Basic constructor for creating a JSON Value of type String
*
* @access public
*
* @param std::string m_string_value The string to use as the value
*/
JSONValue::JSONValue(const std::string &m_string_value)
{
type = JSONType_String;
string_value = new std::string(m_string_value);
}
/**
* Basic constructor for creating a JSON Value of type Bool
*
* @access public
*
* @param bool m_bool_value The bool to use as the value
*/
JSONValue::JSONValue(bool m_bool_value)
{
type = JSONType_Bool;
bool_value = m_bool_value;
}
/**
* Basic constructor for creating a JSON Value of type Number
*
* @access public
*
* @param double m_number_value The number to use as the value
*/
JSONValue::JSONValue(double m_number_value)
{
type = JSONType_Number;
number_value = m_number_value;
}
/**
* Basic constructor for creating a JSON Value of type Number
*
* @access public
*
* @param int m_integer_value The number to use as the value
*/
JSONValue::JSONValue(int m_integer_value)
{
type = JSONType_Number;
number_value = (double) m_integer_value;
}
/**
* Basic constructor for creating a JSON Value of type Array
*
* @access public
*
* @param JSONArray m_array_value The JSONArray to use as the value
*/
JSONValue::JSONValue(const JSONArray &m_array_value)
{
type = JSONType_Array;
array_value = new JSONArray(m_array_value);
}
/**
* Basic constructor for creating a JSON Value of type Object
*
* @access public
*
* @param JSONObject m_object_value The JSONObject to use as the value
*/
JSONValue::JSONValue(const JSONObject &m_object_value)
{
type = JSONType_Object;
object_value = new JSONObject(m_object_value);
}
/**
* Copy constructor to perform a deep copy of array / object values
*
* @access public
*
* @param JSONValue m_source The source JSONValue that is being copied
*/
JSONValue::JSONValue(const JSONValue &m_source)
{
type = m_source.type;
switch (type)
{
case JSONType_String:
string_value = new std::string(*m_source.string_value);
break;
case JSONType_Bool:
bool_value = m_source.bool_value;
break;
case JSONType_Number:
number_value = m_source.number_value;
break;
case JSONType_Array:
{
JSONArray source_array = *m_source.array_value;
JSONArray::iterator iter;
array_value = new JSONArray();
for (iter = source_array.begin(); iter != source_array.end(); iter++)
array_value->push_back(new JSONValue(**iter));
break;
}
case JSONType_Object:
{
JSONObject source_object = *m_source.object_value;
object_value = new JSONObject();
JSONObject::iterator iter;
for (iter = source_object.begin(); iter != source_object.end(); iter++)
{
std::string name = (*iter).first;
(*object_value)[name] = new JSONValue(*((*iter).second));
}
break;
}
case JSONType_Null:
// Nothing to do.
break;
}
}
/**
* The destructor for the JSON Value object
* Handles deleting the objects in the array or the object value
*
* @access public
*/
JSONValue::~JSONValue()
{
if (type == JSONType_Array)
{
JSONArray::iterator iter;
for (iter = array_value->begin(); iter != array_value->end(); iter++)
delete *iter;
delete array_value;
}
else if (type == JSONType_Object)
{
JSONObject::iterator iter;
for (iter = object_value->begin(); iter != object_value->end(); iter++)
{
delete (*iter).second;
}
delete object_value;
}
else if (type == JSONType_String)
{
delete string_value;
}
}
/**
* Checks if the value is a NULL
*
* @access public
*
* @return bool Returns true if it is a NULL value, false otherwise
*/
bool JSONValue::IsNull() const
{
return type == JSONType_Null;
}
/**
* Checks if the value is a String
*
* @access public
*
* @return bool Returns true if it is a String value, false otherwise
*/
bool JSONValue::IsString() const
{
return type == JSONType_String;
}
/**
* Checks if the value is a Bool
*
* @access public
*
* @return bool Returns true if it is a Bool value, false otherwise
*/
bool JSONValue::IsBool() const
{
return type == JSONType_Bool;
}
/**
* Checks if the value is a Number
*
* @access public
*
* @return bool Returns true if it is a Number value, false otherwise
*/
bool JSONValue::IsNumber() const
{
return type == JSONType_Number;
}
/**
* Checks if the value is an Array
*
* @access public
*
* @return bool Returns true if it is an Array value, false otherwise
*/
bool JSONValue::IsArray() const
{
return type == JSONType_Array;
}
/**
* Checks if the value is an Object
*
* @access public
*
* @return bool Returns true if it is an Object value, false otherwise
*/
bool JSONValue::IsObject() const
{
return type == JSONType_Object;
}
/**
* Retrieves the String value of this JSONValue
* Use IsString() before using this method.
*
* @access public
*
* @return std::string Returns the string value
*/
const std::string &JSONValue::AsString() const
{
return (*string_value);
}
/**
* Retrieves the Bool value of this JSONValue
* Use IsBool() before using this method.
*
* @access public
*
* @return bool Returns the bool value
*/
bool JSONValue::AsBool() const
{
return bool_value;
}
/**
* Retrieves the Number value of this JSONValue
* Use IsNumber() before using this method.
*
* @access public
*
* @return double Returns the number value
*/
double JSONValue::AsNumber() const
{
return number_value;
}
/**
* Retrieves the Array value of this JSONValue
* Use IsArray() before using this method.
*
* @access public
*
* @return JSONArray Returns the array value
*/
const JSONArray &JSONValue::AsArray() const
{
return (*array_value);
}
/**
* Retrieves the Object value of this JSONValue
* Use IsObject() before using this method.
*
* @access public
*
* @return JSONObject Returns the object value
*/
const JSONObject &JSONValue::AsObject() const
{
return (*object_value);
}
/**
* Retrieves the number of children of this JSONValue.
* This number will be 0 or the actual number of children
* if IsArray() or IsObject().
*
* @access public
*
* @return The number of children.
*/
std::size_t JSONValue::CountChildren() const
{
switch (type)
{
case JSONType_Array:
return array_value->size();
case JSONType_Object:
return object_value->size();
default:
return 0;
}
}
/**
* Checks if this JSONValue has a child at the given index.
* Use IsArray() before using this method.
*
* @access public
*
* @return bool Returns true if the array has a value at the given index.
*/
bool JSONValue::HasChild(std::size_t index) const
{
if (type == JSONType_Array)
{
return index < array_value->size();
}
else
{
return false;
}
}
/**
* Retrieves the child of this JSONValue at the given index.
* Use IsArray() before using this method.
*
* @access public
*
* @return JSONValue* Returns JSONValue at the given index or NULL
* if it doesn't exist.
*/
JSONValue *JSONValue::Child(std::size_t index)
{
if (index < array_value->size())
{
return (*array_value)[index];
}
else
{
return NULL;
}
}
/**
* Checks if this JSONValue has a child at the given key.
* Use IsObject() before using this method.
*
* @access public
*
* @return bool Returns true if the object has a value at the given key.
*/
bool JSONValue::HasChild(const char* name) const
{
if (type == JSONType_Object)
{
return object_value->find(name) != object_value->end();
}
else
{
return false;
}
}
/**
* Retrieves the child of this JSONValue at the given key.
* Use IsObject() before using this method.
*
* @access public
*
* @return JSONValue* Returns JSONValue for the given key in the object
* or NULL if it doesn't exist.
*/
JSONValue* JSONValue::Child(const char* name)
{
JSONObject::const_iterator it = object_value->find(name);
if (it != object_value->end())
{
return it->second;
}
else
{
return NULL;
}
}
/**
* Retrieves the keys of the JSON Object or an empty vector
* if this value is not an object.
*
* @access public
*
* @return std::vector<std::string> A vector containing the keys.
*/
std::vector<std::string> JSONValue::ObjectKeys() const
{
std::vector<std::string> keys;
if (type == JSONType_Object)
{
JSONObject::const_iterator iter = object_value->begin();
while (iter != object_value->end())
{
keys.push_back(iter->first);
iter++;
}
}
return keys;
}
#if WITHSTRINGIFY
/**
* Creates a JSON encoded string for the value with all necessary characters escaped
*
* @access public
*
* @param bool prettyprint Enable prettyprint
*
* @return std::string Returns the JSON string
*/
std::string JSONValue::Stringify(bool const prettyprint) const
{
size_t const indentDepth = prettyprint ? 1 : 0;
return StringifyImpl(indentDepth);
}
/**
* Creates a JSON encoded string for the value with all necessary characters escaped
*
* @access private
*
* @param size_t indentDepth The prettyprint indentation depth (0 : no prettyprint)
*
* @return std::string Returns the JSON string
*/
std::string JSONValue::StringifyImpl(size_t const indentDepth) const
{
std::string ret_string;
size_t const indentDepth1 = indentDepth ? indentDepth + 1 : 0;
std::string const indentStr = Indent(indentDepth);
std::string const indentStr1 = Indent(indentDepth1);
switch (type)
{
case JSONType_Null:
ret_string = "null";
break;
case JSONType_String:
ret_string = StringifyString(*string_value);
break;
case JSONType_Bool:
ret_string = bool_value ? "true" : "false";
break;
case JSONType_Number:
{
if (isinf(number_value) || isnan(number_value))
ret_string = "null";
else
{
std::stringstream ss;
ss.precision(15);
ss << number_value;
ret_string = ss.str();
}
break;
}
case JSONType_Array:
{
ret_string = indentDepth ? "[\n" + indentStr1 : "[";
JSONArray::const_iterator iter = array_value->begin();
while (iter != array_value->end())
{
ret_string += (*iter)->StringifyImpl(indentDepth1);
// Not at the end - add a separator
if (++iter != array_value->end())
ret_string += ",";
}
ret_string += indentDepth ? "\n" + indentStr + "]" : "]";
break;
}
case JSONType_Object:
{
ret_string = indentDepth ? "{\n" + indentStr1 : "{";
JSONObject::const_iterator iter = object_value->begin();
while (iter != object_value->end())
{
ret_string += StringifyString((*iter).first);
ret_string += ":";
ret_string += (*iter).second->StringifyImpl(indentDepth1);
// Not at the end - add a separator
if (++iter != object_value->end())
ret_string += ",";
}
ret_string += indentDepth ? "\n" + indentStr + "}" : "}";
break;
}
}
return ret_string;
}
/**
* Creates a JSON encoded string with all required fields escaped
* Works from http://www.ecma-internationl.org/publications/files/ECMA-ST/ECMA-262.pdf
* Section 15.12.3.
*
* @access private
*
* @param std::string str The string that needs to have the characters escaped
*
* @return std::string Returns the JSON string
*/
std::string JSONValue::StringifyString(const std::string &str)
{
std::string str_out = "\"";
std::string::const_iterator iter = str.begin();
while (iter != str.end())
{
char chr = *iter;
if (chr == '"' || chr == '\\' || chr == '/')
{
str_out += '\\';
str_out += chr;
}
else if (chr == '\b')
{
str_out += "\\b";
}
else if (chr == '\f')
{
str_out += "\\f";
}
else if (chr == '\n')
{
str_out += "\\n";
}
else if (chr == '\r')
{
str_out += "\\r";
}
else if (chr == '\t')
{
str_out += "\\t";
}
/*
else if (chr < ' ' || chr > 126)
{
str_out += "\\u";
for (int i = 0; i < 4; i++)
{
int value = (chr >> 12) & 0xf;
if (value >= 0 && value <= 9)
str_out += (char)('0' + value);
else if (value >= 10 && value <= 15)
str_out += (char)('A' + (value - 10));
chr <<= 4;
}
}
*/
else
{
str_out += chr;
}
iter++;
}
str_out += "\"";
return str_out;
}
/**
* Creates the indentation string for the depth given
*
* @access private
*
* @param size_t indent The prettyprint indentation depth (0 : no indentation)
*
* @return std::string Returns the string
*/
std::string JSONValue::Indent(size_t depth)
{
const size_t indent_step = 2;
depth ? --depth : 0;
std::string indentStr(depth * indent_step, ' ');
return indentStr;
}
#endif
| [
"[email protected]"
] | |
7413454ed4ed7cc88ce4b75e438e9c0fd244ddc8 | 0d5eb5bf9178f6dd6bad291f793d1ee6de364fd3 | /cuda/test_io_options_rt.cudafe1.cpp | debd7f8cc8d86d7591ea9b6bfe9e5abfd754c104 | [] | 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 | 486,931 | cpp | # 1 "test_io_options_rt.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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
#pragma GCC diagnostic push
# 64
#pragma GCC diagnostic ignored "-Wunused-function"
# 66 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/device_types.h"
#if 0
# 66
enum cudaRoundMode {
# 68
cudaRoundNearest,
# 69
cudaRoundZero,
# 70
cudaRoundPosInf,
# 71
cudaRoundMinInf
# 72
};
#endif
# 98 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 98
struct char1 {
# 100
signed char x;
# 101
};
#endif
# 103 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 103
struct uchar1 {
# 105
unsigned char x;
# 106
};
#endif
# 109 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 109
struct __attribute((aligned(2))) char2 {
# 111
signed char x, y;
# 112
};
#endif
# 114 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 114
struct __attribute((aligned(2))) uchar2 {
# 116
unsigned char x, y;
# 117
};
#endif
# 119 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 119
struct char3 {
# 121
signed char x, y, z;
# 122
};
#endif
# 124 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 124
struct uchar3 {
# 126
unsigned char x, y, z;
# 127
};
#endif
# 129 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 129
struct __attribute((aligned(4))) char4 {
# 131
signed char x, y, z, w;
# 132
};
#endif
# 134 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 134
struct __attribute((aligned(4))) uchar4 {
# 136
unsigned char x, y, z, w;
# 137
};
#endif
# 139 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 139
struct short1 {
# 141
short x;
# 142
};
#endif
# 144 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 144
struct ushort1 {
# 146
unsigned short x;
# 147
};
#endif
# 149 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 149
struct __attribute((aligned(4))) short2 {
# 151
short x, y;
# 152
};
#endif
# 154 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 154
struct __attribute((aligned(4))) ushort2 {
# 156
unsigned short x, y;
# 157
};
#endif
# 159 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 159
struct short3 {
# 161
short x, y, z;
# 162
};
#endif
# 164 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 164
struct ushort3 {
# 166
unsigned short x, y, z;
# 167
};
#endif
# 169 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 169
struct __attribute((aligned(8))) short4 { short x; short y; short z; short w; };
#endif
# 170 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#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/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 172
struct int1 {
# 174
int x;
# 175
};
#endif
# 177 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 177
struct uint1 {
# 179
unsigned x;
# 180
};
#endif
# 182 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 182
struct __attribute((aligned(8))) int2 { int x; int y; };
#endif
# 183 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 183
struct __attribute((aligned(8))) uint2 { unsigned x; unsigned y; };
#endif
# 185 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 185
struct int3 {
# 187
int x, y, z;
# 188
};
#endif
# 190 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 190
struct uint3 {
# 192
unsigned x, y, z;
# 193
};
#endif
# 195 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 195
struct __attribute((aligned(16))) int4 {
# 197
int x, y, z, w;
# 198
};
#endif
# 200 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 200
struct __attribute((aligned(16))) uint4 {
# 202
unsigned x, y, z, w;
# 203
};
#endif
# 205 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 205
struct long1 {
# 207
long x;
# 208
};
#endif
# 210 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 210
struct ulong1 {
# 212
unsigned long x;
# 213
};
#endif
# 220 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 220
struct __attribute((aligned((2) * sizeof(long)))) long2 {
# 222
long x, y;
# 223
};
#endif
# 225 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 225
struct __attribute((aligned((2) * sizeof(unsigned long)))) ulong2 {
# 227
unsigned long x, y;
# 228
};
#endif
# 232 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 232
struct long3 {
# 234
long x, y, z;
# 235
};
#endif
# 237 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 237
struct ulong3 {
# 239
unsigned long x, y, z;
# 240
};
#endif
# 242 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 242
struct __attribute((aligned(16))) long4 {
# 244
long x, y, z, w;
# 245
};
#endif
# 247 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 247
struct __attribute((aligned(16))) ulong4 {
# 249
unsigned long x, y, z, w;
# 250
};
#endif
# 252 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 252
struct float1 {
# 254
float x;
# 255
};
#endif
# 274 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 274
struct __attribute((aligned(8))) float2 { float x; float y; };
#endif
# 279 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 279
struct float3 {
# 281
float x, y, z;
# 282
};
#endif
# 284 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 284
struct __attribute((aligned(16))) float4 {
# 286
float x, y, z, w;
# 287
};
#endif
# 289 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 289
struct longlong1 {
# 291
long long x;
# 292
};
#endif
# 294 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 294
struct ulonglong1 {
# 296
unsigned long long x;
# 297
};
#endif
# 299 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 299
struct __attribute((aligned(16))) longlong2 {
# 301
long long x, y;
# 302
};
#endif
# 304 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 304
struct __attribute((aligned(16))) ulonglong2 {
# 306
unsigned long long x, y;
# 307
};
#endif
# 309 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 309
struct longlong3 {
# 311
long long x, y, z;
# 312
};
#endif
# 314 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 314
struct ulonglong3 {
# 316
unsigned long long x, y, z;
# 317
};
#endif
# 319 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 319
struct __attribute((aligned(16))) longlong4 {
# 321
long long x, y, z, w;
# 322
};
#endif
# 324 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 324
struct __attribute((aligned(16))) ulonglong4 {
# 326
unsigned long long x, y, z, w;
# 327
};
#endif
# 329 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 329
struct double1 {
# 331
double x;
# 332
};
#endif
# 334 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 334
struct __attribute((aligned(16))) double2 {
# 336
double x, y;
# 337
};
#endif
# 339 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 339
struct double3 {
# 341
double x, y, z;
# 342
};
#endif
# 344 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 344
struct __attribute((aligned(16))) double4 {
# 346
double x, y, z, w;
# 347
};
#endif
# 361 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef char1
# 361
char1;
#endif
# 362 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef uchar1
# 362
uchar1;
#endif
# 363 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef char2
# 363
char2;
#endif
# 364 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef uchar2
# 364
uchar2;
#endif
# 365 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef char3
# 365
char3;
#endif
# 366 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef uchar3
# 366
uchar3;
#endif
# 367 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef char4
# 367
char4;
#endif
# 368 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef uchar4
# 368
uchar4;
#endif
# 369 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef short1
# 369
short1;
#endif
# 370 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef ushort1
# 370
ushort1;
#endif
# 371 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef short2
# 371
short2;
#endif
# 372 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef ushort2
# 372
ushort2;
#endif
# 373 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef short3
# 373
short3;
#endif
# 374 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef ushort3
# 374
ushort3;
#endif
# 375 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef short4
# 375
short4;
#endif
# 376 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef ushort4
# 376
ushort4;
#endif
# 377 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef int1
# 377
int1;
#endif
# 378 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef uint1
# 378
uint1;
#endif
# 379 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef int2
# 379
int2;
#endif
# 380 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef uint2
# 380
uint2;
#endif
# 381 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef int3
# 381
int3;
#endif
# 382 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef uint3
# 382
uint3;
#endif
# 383 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef int4
# 383
int4;
#endif
# 384 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef uint4
# 384
uint4;
#endif
# 385 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef long1
# 385
long1;
#endif
# 386 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef ulong1
# 386
ulong1;
#endif
# 387 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef long2
# 387
long2;
#endif
# 388 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef ulong2
# 388
ulong2;
#endif
# 389 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef long3
# 389
long3;
#endif
# 390 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef ulong3
# 390
ulong3;
#endif
# 391 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef long4
# 391
long4;
#endif
# 392 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef ulong4
# 392
ulong4;
#endif
# 393 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef float1
# 393
float1;
#endif
# 394 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef float2
# 394
float2;
#endif
# 395 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef float3
# 395
float3;
#endif
# 396 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef float4
# 396
float4;
#endif
# 397 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef longlong1
# 397
longlong1;
#endif
# 398 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef ulonglong1
# 398
ulonglong1;
#endif
# 399 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef longlong2
# 399
longlong2;
#endif
# 400 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef ulonglong2
# 400
ulonglong2;
#endif
# 401 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef longlong3
# 401
longlong3;
#endif
# 402 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef ulonglong3
# 402
ulonglong3;
#endif
# 403 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef longlong4
# 403
longlong4;
#endif
# 404 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef ulonglong4
# 404
ulonglong4;
#endif
# 405 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef double1
# 405
double1;
#endif
# 406 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef double2
# 406
double2;
#endif
# 407 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef double3
# 407
double3;
#endif
# 408 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
typedef double4
# 408
double4;
#endif
# 416 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#if 0
# 416
struct dim3 {
# 418
unsigned x, y, z;
# 428
};
#endif
# 430 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/vector_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
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/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorAddressOfConstant,
# 331 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorTextureFetchFailed,
# 340 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorTextureNotBound,
# 349 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorSynchronizationError,
# 355
cudaErrorInvalidFilterSetting,
# 361
cudaErrorInvalidNormSetting,
# 369
cudaErrorMixedDeviceExecution,
# 377
cudaErrorNotYetImplemented = 31,
# 386 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorMemoryValueTooLarge,
# 393
cudaErrorInsufficientDriver = 35,
# 399
cudaErrorInvalidSurface = 37,
# 405
cudaErrorDuplicateVariableName = 43,
# 411
cudaErrorDuplicateTextureName,
# 417
cudaErrorDuplicateSurfaceName,
# 427 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorDevicesUnavailable,
# 440 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorIncompatibleDriverContext = 49,
# 446
cudaErrorMissingConfiguration = 52,
# 455 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorPriorLaunchFailure,
# 462
cudaErrorLaunchMaxDepthExceeded = 65,
# 470
cudaErrorLaunchFileScopedTex,
# 478
cudaErrorLaunchFileScopedSurf,
# 493 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorSyncDepthExceeded,
# 505 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorLaunchPendingCountExceeded,
# 511
cudaErrorInvalidDeviceFunction = 98,
# 517
cudaErrorNoDevice = 100,
# 523
cudaErrorInvalidDevice,
# 528
cudaErrorStartupFailure = 127,
# 533
cudaErrorInvalidKernelImage = 200,
# 543 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
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/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorLaunchOutOfResources,
# 722 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorLaunchTimeout,
# 728
cudaErrorLaunchIncompatibleTexturing,
# 735
cudaErrorPeerAccessAlreadyEnabled,
# 742
cudaErrorPeerAccessNotEnabled,
# 755 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorSetOnActiveProcess = 708,
# 762
cudaErrorContextIsDestroyed,
# 769
cudaErrorAssert,
# 776
cudaErrorTooManyPeers,
# 782
cudaErrorHostMemoryAlreadyRegistered,
# 788
cudaErrorHostMemoryNotRegistered,
# 797 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorHardwareStackError,
# 805
cudaErrorIllegalInstruction,
# 814 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorMisalignedAddress,
# 825 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorInvalidAddressSpace,
# 833
cudaErrorInvalidPc,
# 844 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorLaunchFailure,
# 853 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorCooperativeLaunchTooLarge,
# 858
cudaErrorNotPermitted = 800,
# 864
cudaErrorNotSupported,
# 873 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
cudaErrorSystemNotReady,
# 880
cudaErrorSystemDriverMismatch,
# 889 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
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/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 962
enum cudaChannelFormatKind {
# 964
cudaChannelFormatKindSigned,
# 965
cudaChannelFormatKindUnsigned,
# 966
cudaChannelFormatKindFloat,
# 967
cudaChannelFormatKindNone
# 968
};
#endif
# 973 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
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/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1020
enum cudaMemcpyKind {
# 1022
cudaMemcpyHostToHost,
# 1023
cudaMemcpyHostToDevice,
# 1024
cudaMemcpyDeviceToHost,
# 1025
cudaMemcpyDeviceToDevice,
# 1026
cudaMemcpyDefault
# 1027
};
#endif
# 1034 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
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/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1136
enum cudaStreamCaptureStatus {
# 1137
cudaStreamCaptureStatusNone,
# 1138
cudaStreamCaptureStatusActive,
# 1139
cudaStreamCaptureStatusInvalidated
# 1141
};
#endif
# 1147 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1147
enum cudaStreamCaptureMode {
# 1148
cudaStreamCaptureModeGlobal,
# 1149
cudaStreamCaptureModeThreadLocal,
# 1150
cudaStreamCaptureModeRelaxed
# 1151
};
#endif
# 1156 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
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/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1173
enum cudaGraphicsMapFlags {
# 1175
cudaGraphicsMapFlagsNone,
# 1176
cudaGraphicsMapFlagsReadOnly,
# 1177
cudaGraphicsMapFlagsWriteDiscard
# 1178
};
#endif
# 1183 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1196
enum cudaResourceType {
# 1198
cudaResourceTypeArray,
# 1199
cudaResourceTypeMipmappedArray,
# 1200
cudaResourceTypeLinear,
# 1201
cudaResourceTypePitch2D
# 1202
};
#endif
# 1207 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1292
struct cudaPointerAttributes {
# 1302 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
__attribute((deprecated)) cudaMemoryType memoryType;
# 1308
cudaMemoryType type;
# 1319 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
int device;
# 1325
void *devicePointer;
# 1334 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
int preferredShmemCarveout;
# 1414
};
#endif
# 1419 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1419
enum cudaFuncAttribute {
# 1421
cudaFuncAttributeMaxDynamicSharedMemorySize = 8,
# 1422
cudaFuncAttributePreferredSharedMemoryCarveout,
# 1423
cudaFuncAttributeMax
# 1424
};
#endif
# 1429 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1429
enum cudaFuncCache {
# 1431
cudaFuncCachePreferNone,
# 1432
cudaFuncCachePreferShared,
# 1433
cudaFuncCachePreferL1,
# 1434
cudaFuncCachePreferEqual
# 1435
};
#endif
# 1441 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1441
enum cudaSharedMemConfig {
# 1443
cudaSharedMemBankSizeDefault,
# 1444
cudaSharedMemBankSizeFourByte,
# 1445
cudaSharedMemBankSizeEightByte
# 1446
};
#endif
# 1451 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1451
enum cudaSharedCarveout {
# 1452
cudaSharedmemCarveoutDefault = (-1),
# 1453
cudaSharedmemCarveoutMaxShared = 100,
# 1454
cudaSharedmemCarveoutMaxL1 = 0
# 1455
};
#endif
# 1460 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1460
enum cudaComputeMode {
# 1462
cudaComputeModeDefault,
# 1463
cudaComputeModeExclusive,
# 1464
cudaComputeModeProhibited,
# 1465
cudaComputeModeExclusiveProcess
# 1466
};
#endif
# 1471 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1497
enum cudaMemRangeAttribute {
# 1499
cudaMemRangeAttributeReadMostly = 1,
# 1500
cudaMemRangeAttributePreferredLocation,
# 1501
cudaMemRangeAttributeAccessedBy,
# 1502
cudaMemRangeAttributeLastPrefetchLocation
# 1503
};
#endif
# 1508 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1508
enum cudaOutputMode {
# 1510
cudaKeyValuePair,
# 1511
cudaCSV
# 1512
};
#endif
# 1517 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1625
enum cudaDeviceP2PAttr {
# 1626
cudaDevP2PAttrPerformanceRank = 1,
# 1627
cudaDevP2PAttrAccessSupported,
# 1628
cudaDevP2PAttrNativeAtomicSupported,
# 1629
cudaDevP2PAttrCudaArrayAccessSupported
# 1630
};
#endif
# 1637 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1637
struct CUuuid_st {
# 1638
char bytes[16];
# 1639
};
#endif
# 1640 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
typedef CUuuid_st
# 1640
CUuuid;
#endif
# 1642 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
typedef CUuuid_st
# 1642
cudaUUID_t;
#endif
# 1647 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
typedef
# 1815
struct cudaIpcEventHandle_st {
# 1817
char reserved[64];
# 1818
} cudaIpcEventHandle_t;
#endif
# 1826 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
typedef
# 1823
struct cudaIpcMemHandle_st {
# 1825
char reserved[64];
# 1826
} cudaIpcMemHandle_t;
#endif
# 1831 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1831
enum cudaExternalMemoryHandleType {
# 1835
cudaExternalMemoryHandleTypeOpaqueFd = 1,
# 1839
cudaExternalMemoryHandleTypeOpaqueWin32,
# 1843
cudaExternalMemoryHandleTypeOpaqueWin32Kmt,
# 1847
cudaExternalMemoryHandleTypeD3D12Heap,
# 1851
cudaExternalMemoryHandleTypeD3D12Resource
# 1852
};
#endif
# 1862 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1862
struct cudaExternalMemoryHandleDesc {
# 1866
cudaExternalMemoryHandleType type;
# 1867
union {
# 1873
int fd;
# 1885 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1956
enum cudaExternalSemaphoreHandleType {
# 1960
cudaExternalSemaphoreHandleTypeOpaqueFd = 1,
# 1964
cudaExternalSemaphoreHandleTypeOpaqueWin32,
# 1968
cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt,
# 1972
cudaExternalSemaphoreHandleTypeD3D12Fence
# 1973
};
#endif
# 1978 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 1978
struct cudaExternalSemaphoreHandleDesc {
# 1982
cudaExternalSemaphoreHandleType type;
# 1983
union {
# 1988
int fd;
# 1999 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
typedef cudaError
# 2069
cudaError_t;
#endif
# 2074 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
typedef struct CUstream_st *
# 2074
cudaStream_t;
#endif
# 2079 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
typedef struct CUevent_st *
# 2079
cudaEvent_t;
#endif
# 2084 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
typedef cudaGraphicsResource *
# 2084
cudaGraphicsResource_t;
#endif
# 2089 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
typedef cudaOutputMode
# 2089
cudaOutputMode_t;
#endif
# 2094 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
typedef struct CUexternalMemory_st *
# 2094
cudaExternalMemory_t;
#endif
# 2099 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
typedef struct CUexternalSemaphore_st *
# 2099
cudaExternalSemaphore_t;
#endif
# 2104 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
typedef struct CUgraph_st *
# 2104
cudaGraph_t;
#endif
# 2109 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
typedef struct CUgraphNode_st *
# 2109
cudaGraphNode_t;
#endif
# 2114 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#if 0
# 2114
enum cudaCGScope {
# 2115
cudaCGScopeInvalid,
# 2116
cudaCGScopeGrid,
# 2117
cudaCGScopeMultiGrid
# 2118
};
#endif
# 2123 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
#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/bin/../targets/x86_64-linux/include/driver_types.h"
typedef struct CUgraphExec_st *cudaGraphExec_t;
# 84 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/surface_types.h"
#if 0
# 84
enum cudaSurfaceBoundaryMode {
# 86
cudaBoundaryModeZero,
# 87
cudaBoundaryModeClamp,
# 88
cudaBoundaryModeTrap
# 89
};
#endif
# 94 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/surface_types.h"
#if 0
# 94
enum cudaSurfaceFormatMode {
# 96
cudaFormatModeForced,
# 97
cudaFormatModeAuto
# 98
};
#endif
# 103 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/surface_types.h"
#if 0
# 103
struct surfaceReference {
# 108
cudaChannelFormatDesc channelDesc;
# 109
};
#endif
# 114 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/surface_types.h"
#if 0
typedef unsigned long long
# 114
cudaSurfaceObject_t;
#endif
# 84 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/texture_types.h"
#if 0
# 84
enum cudaTextureAddressMode {
# 86
cudaAddressModeWrap,
# 87
cudaAddressModeClamp,
# 88
cudaAddressModeMirror,
# 89
cudaAddressModeBorder
# 90
};
#endif
# 95 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/texture_types.h"
#if 0
# 95
enum cudaTextureFilterMode {
# 97
cudaFilterModePoint,
# 98
cudaFilterModeLinear
# 99
};
#endif
# 104 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/texture_types.h"
#if 0
# 104
enum cudaTextureReadMode {
# 106
cudaReadModeElementType,
# 107
cudaReadModeNormalizedFloat
# 108
};
#endif
# 113 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/texture_types.h"
#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/bin/../targets/x86_64-linux/include/texture_types.h"
#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/bin/../targets/x86_64-linux/include/texture_types.h"
#if 0
typedef unsigned long long
# 212
cudaTextureObject_t;
#endif
# 70 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/library_types.h"
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/bin/../targets/x86_64-linux/include/cuda_device_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_device_runtime_api.h"
__attribute__((unused)) extern void *cudaGetParameterBuffer(size_t alignment, size_t size);
# 206 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_device_runtime_api.h"
__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/bin/../targets/x86_64-linux/include/cuda_device_runtime_api.h"
__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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern "C" {
# 280 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceReset();
# 301 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceSynchronize();
# 386 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceSetLimit(cudaLimit limit, size_t value);
# 420 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceGetLimit(size_t * pValue, cudaLimit limit);
# 453 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceGetCacheConfig(cudaFuncCache * pCacheConfig);
# 490 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceGetStreamPriorityRange(int * leastPriority, int * greatestPriority);
# 534 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceSetCacheConfig(cudaFuncCache cacheConfig);
# 565 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceGetSharedMemConfig(cudaSharedMemConfig * pConfig);
# 609 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceSetSharedMemConfig(cudaSharedMemConfig config);
# 636 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceGetByPCIBusId(int * device, const char * pciBusId);
# 666 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceGetPCIBusId(char * pciBusId, int len, int device);
# 713 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t * handle, cudaEvent_t event);
# 753 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaIpcOpenEventHandle(cudaEvent_t * event, cudaIpcEventHandle_t handle);
# 796 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t * handle, void * devPtr);
# 854 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaIpcOpenMemHandle(void ** devPtr, cudaIpcMemHandle_t handle, unsigned flags);
# 889 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaIpcCloseMemHandle(void * devPtr);
# 931 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
__attribute((deprecated)) extern cudaError_t cudaThreadExit();
# 957 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
__attribute((deprecated)) extern cudaError_t cudaThreadSynchronize();
# 1006 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
__attribute((deprecated)) extern cudaError_t cudaThreadSetLimit(cudaLimit limit, size_t value);
# 1039 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
__attribute((deprecated)) extern cudaError_t cudaThreadGetLimit(size_t * pValue, cudaLimit limit);
# 1075 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
__attribute((deprecated)) extern cudaError_t cudaThreadGetCacheConfig(cudaFuncCache * pCacheConfig);
# 1122 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
__attribute((deprecated)) extern cudaError_t cudaThreadSetCacheConfig(cudaFuncCache cacheConfig);
# 1181 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetLastError();
# 1227 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaPeekAtLastError();
# 1243 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern const char *cudaGetErrorName(cudaError_t error);
# 1259 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern const char *cudaGetErrorString(cudaError_t error);
# 1288 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetDeviceCount(int * count);
# 1559 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetDeviceProperties(cudaDeviceProp * prop, int device);
# 1748 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceGetAttribute(int * value, cudaDeviceAttr attr, int device);
# 1788 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceGetP2PAttribute(int * value, cudaDeviceP2PAttr attr, int srcDevice, int dstDevice);
# 1809 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaChooseDevice(int * device, const cudaDeviceProp * prop);
# 1846 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaSetDevice(int device);
# 1867 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetDevice(int * device);
# 1898 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaSetValidDevices(int * device_arr, int len);
# 1967 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaSetDeviceFlags(unsigned flags);
# 2013 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetDeviceFlags(unsigned * flags);
# 2053 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamCreate(cudaStream_t * pStream);
# 2085 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamCreateWithFlags(cudaStream_t * pStream, unsigned flags);
# 2131 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamCreateWithPriority(cudaStream_t * pStream, unsigned flags, int priority);
# 2158 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int * priority);
# 2183 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned * flags);
# 2214 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamDestroy(cudaStream_t stream);
# 2240 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void * userData, unsigned flags);
# 2339 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamSynchronize(cudaStream_t stream);
# 2364 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamQuery(cudaStream_t stream);
# 2447 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void * devPtr, size_t length = 0, unsigned flags = 4);
# 2483 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode);
# 2534 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaThreadExchangeStreamCaptureMode(cudaStreamCaptureMode * mode);
# 2562 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t * pGraph);
# 2600 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamIsCapturing(cudaStream_t stream, cudaStreamCaptureStatus * pCaptureStatus);
# 2628 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaStreamGetCaptureInfo(cudaStream_t stream, cudaStreamCaptureStatus * pCaptureStatus, unsigned long long * pId);
# 2666 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaEventCreate(cudaEvent_t * event);
# 2703 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaEventCreateWithFlags(cudaEvent_t * event, unsigned flags);
# 2742 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream = 0);
# 2773 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaEventQuery(cudaEvent_t event);
# 2803 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaEventSynchronize(cudaEvent_t event);
# 2830 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaEventDestroy(cudaEvent_t event);
# 2873 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaEventElapsedTime(float * ms, cudaEvent_t start, cudaEvent_t end);
# 3012 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaImportExternalMemory(cudaExternalMemory_t * extMem_out, const cudaExternalMemoryHandleDesc * memHandleDesc);
# 3066 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaExternalMemoryGetMappedBuffer(void ** devPtr, cudaExternalMemory_t extMem, const cudaExternalMemoryBufferDesc * bufferDesc);
# 3121 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t * mipmap, cudaExternalMemory_t extMem, const cudaExternalMemoryMipmappedArrayDesc * mipmapDesc);
# 3144 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem);
# 3238 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t * extSem_out, const cudaExternalSemaphoreHandleDesc * semHandleDesc);
# 3277 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaSignalExternalSemaphoresAsync(const cudaExternalSemaphore_t * extSemArray, const cudaExternalSemaphoreSignalParams * paramsArray, unsigned numExtSems, cudaStream_t stream = 0);
# 3320 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaWaitExternalSemaphoresAsync(const cudaExternalSemaphore_t * extSemArray, const cudaExternalSemaphoreWaitParams * paramsArray, unsigned numExtSems, cudaStream_t stream = 0);
# 3342 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem);
# 3407 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaLaunchCooperativeKernelMultiDevice(cudaLaunchParams * launchParamsList, unsigned numDevices, unsigned flags = 0);
# 3612 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaFuncSetCacheConfig(const void * func, cudaFuncCache cacheConfig);
# 3667 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaFuncSetSharedMemConfig(const void * func, cudaSharedMemConfig config);
# 3702 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaFuncGetAttributes(cudaFuncAttributes * attr, const void * func);
# 3741 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaFuncSetAttribute(const void * func, cudaFuncAttribute attr, int value);
# 3765 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
__attribute((deprecated)) extern cudaError_t cudaSetDoubleForDevice(double * d);
# 3789 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
__attribute((deprecated)) extern cudaError_t cudaSetDoubleForHost(double * d);
# 3855 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void * userData);
# 3910 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int * numBlocks, const void * func, int blockSize, size_t dynamicSMemSize);
# 3954 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int * numBlocks, const void * func, int blockSize, size_t dynamicSMemSize, unsigned flags);
# 4074 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMallocManaged(void ** devPtr, size_t size, unsigned flags = 1);
# 4105 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMalloc(void ** devPtr, size_t size);
# 4138 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMallocHost(void ** ptr, size_t size);
# 4181 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMallocPitch(void ** devPtr, size_t * pitch, size_t width, size_t height);
# 4227 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaFree(void * devPtr);
# 4279 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaFreeHost(void * ptr);
# 4302 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaFreeArray(cudaArray_t array);
# 4325 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray);
# 4391 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaHostAlloc(void ** pHost, size_t size, unsigned flags);
# 4475 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaHostRegister(void * ptr, size_t size, unsigned flags);
# 4498 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaHostUnregister(void * ptr);
# 4543 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaHostGetDevicePointer(void ** pDevice, void * pHost, unsigned flags);
# 4565 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaHostGetFlags(unsigned * pFlags, void * pHost);
# 4604 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMalloc3D(cudaPitchedPtr * pitchedDevPtr, cudaExtent extent);
# 4743 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMalloc3DArray(cudaArray_t * array, const cudaChannelFormatDesc * desc, cudaExtent extent, unsigned flags = 0);
# 4882 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t * mipmappedArray, const cudaChannelFormatDesc * desc, cudaExtent extent, unsigned numLevels, unsigned flags = 0);
# 4911 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t * levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned level);
# 5016 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemcpy3D(const cudaMemcpy3DParms * p);
# 5047 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemcpy3DPeer(const cudaMemcpy3DPeerParms * p);
# 5165 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemcpy3DAsync(const cudaMemcpy3DParms * p, cudaStream_t stream = 0);
# 5191 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemcpy3DPeerAsync(const cudaMemcpy3DPeerParms * p, cudaStream_t stream = 0);
# 5213 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemGetInfo(size_t * free, size_t * total);
# 5239 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaArrayGetInfo(cudaChannelFormatDesc * desc, cudaExtent * extent, unsigned * flags, cudaArray_t array);
# 5282 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemcpy(void * dst, const void * src, size_t count, cudaMemcpyKind kind);
# 5317 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemcpyPeer(void * dst, int dstDevice, const void * src, int srcDevice, size_t count);
# 5365 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemcpyAsync(void * dst, const void * src, size_t count, cudaMemcpyKind kind, cudaStream_t stream = 0);
# 5687 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemset(void * devPtr, int value, size_t count);
# 6027 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemset2D(void * devPtr, size_t pitch, int value, size_t width, size_t height);
# 6071 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemset3D(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent);
# 6107 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemsetAsync(void * devPtr, int value, size_t count, cudaStream_t stream = 0);
# 6148 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemset3DAsync(cudaPitchedPtr pitchedDevPtr, int value, cudaExtent extent, cudaStream_t stream = 0);
# 6227 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetSymbolAddress(void ** devPtr, const void * symbol);
# 6254 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetSymbolSize(size_t * size, const void * symbol);
# 6324 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemPrefetchAsync(const void * devPtr, size_t count, int dstDevice, cudaStream_t stream = 0);
# 6440 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemAdvise(const void * devPtr, size_t count, cudaMemoryAdvise advice, int device);
# 6499 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaMemRangeGetAttribute(void * data, size_t dataSize, cudaMemRangeAttribute attribute, const void * devPtr, size_t count);
# 6538 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
__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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
__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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
__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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
__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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
__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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaPointerGetAttributes(cudaPointerAttributes * attributes, const void * ptr);
# 6991 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceCanAccessPeer(int * canAccessPeer, int device, int peerDevice);
# 7033 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned flags);
# 7055 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDeviceDisablePeerAccess(int peerDevice);
# 7118 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource);
# 7153 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned flags);
# 7192 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t * resources, cudaStream_t stream = 0);
# 7227 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t * resources, cudaStream_t stream = 0);
# 7259 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphicsResourceGetMappedPointer(void ** devPtr, size_t * size, cudaGraphicsResource_t resource);
# 7297 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t * array, cudaGraphicsResource_t resource, unsigned arrayIndex, unsigned mipLevel);
# 7326 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t * mipmappedArray, cudaGraphicsResource_t resource);
# 7397 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaBindTextureToArray(const textureReference * texref, cudaArray_const_t array, const cudaChannelFormatDesc * desc);
# 7534 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaBindTextureToMipmappedArray(const textureReference * texref, cudaMipmappedArray_const_t mipmappedArray, const cudaChannelFormatDesc * desc);
# 7560 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaUnbindTexture(const textureReference * texref);
# 7589 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetTextureAlignmentOffset(size_t * offset, const textureReference * texref);
# 7619 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetTextureReference(const textureReference ** texref, const void * symbol);
# 7664 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaBindSurfaceToArray(const surfaceReference * surfref, cudaArray_const_t array, const cudaChannelFormatDesc * desc);
# 7689 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetSurfaceReference(const surfaceReference ** surfref, const void * symbol);
# 7724 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetChannelDesc(cudaChannelFormatDesc * desc, cudaArray_const_t array);
# 7754 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, cudaChannelFormatKind f);
# 7969 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaCreateTextureObject(cudaTextureObject_t * pTexObject, const cudaResourceDesc * pResDesc, const cudaTextureDesc * pTexDesc, const cudaResourceViewDesc * pResViewDesc);
# 7988 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject);
# 8008 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetTextureObjectResourceDesc(cudaResourceDesc * pResDesc, cudaTextureObject_t texObject);
# 8028 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetTextureObjectTextureDesc(cudaTextureDesc * pTexDesc, cudaTextureObject_t texObject);
# 8049 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetTextureObjectResourceViewDesc(cudaResourceViewDesc * pResViewDesc, cudaTextureObject_t texObject);
# 8094 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t * pSurfObject, const cudaResourceDesc * pResDesc);
# 8113 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject);
# 8132 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGetSurfaceObjectResourceDesc(cudaResourceDesc * pResDesc, cudaSurfaceObject_t surfObject);
# 8166 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaDriverGetVersion(int * driverVersion);
# 8191 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaRuntimeGetVersion(int * runtimeVersion);
# 8238 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphCreate(cudaGraph_t * pGraph, unsigned flags);
# 8335 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, cudaKernelNodeParams * pNodeParams);
# 8393 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const cudaKernelNodeParams * pNodeParams);
# 8437 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, cudaMemcpy3DParms * pNodeParams);
# 8483 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const cudaMemcpy3DParms * pNodeParams);
# 8525 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, cudaMemsetParams * pNodeParams);
# 8571 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const cudaMemsetParams * pNodeParams);
# 8612 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, cudaHostNodeParams * pNodeParams);
# 8658 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const cudaHostNodeParams * pNodeParams);
# 8696 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t * pGraph);
# 8757 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t * pGraphNode, cudaGraph_t graph, const cudaGraphNode_t * pDependencies, size_t numDependencies);
# 8784 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphClone(cudaGraph_t * pGraphClone, cudaGraph_t originalGraph);
# 8812 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t * pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph);
# 8843 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, cudaGraphNodeType * pType);
# 8874 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t * nodes, size_t * numNodes);
# 8905 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t * pRootNodes, size_t * pNumRootNodes);
# 8939 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t * from, cudaGraphNode_t * to, size_t * numEdges);
# 8970 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t * pDependencies, size_t * pNumDependencies);
# 9002 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t * pDependentNodes, size_t * pNumDependentNodes);
# 9033 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t * from, const cudaGraphNode_t * to, size_t numDependencies);
# 9064 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t * from, const cudaGraphNode_t * to, size_t numDependencies);
# 9090 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node);
# 9126 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphInstantiate(cudaGraphExec_t * pGraphExec, cudaGraph_t graph, cudaGraphNode_t * pErrorNode, char * pLogBuffer, size_t bufferSize);
# 9160 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const cudaKernelNodeParams * pNodeParams);
# 9185 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream);
# 9206 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
extern cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec);
# 9226 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime_api.h"
}
# 104 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/channel_descriptor.h"
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/bin/../targets/x86_64-linux/include/channel_descriptor.h"
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/bin/../targets/x86_64-linux/include/driver_functions.h"
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/bin/../targets/x86_64-linux/include/driver_functions.h"
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/bin/../targets/x86_64-linux/include/driver_functions.h"
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/bin/../targets/x86_64-linux/include/vector_functions.h"
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/bin/../targets/x86_64-linux/include/vector_functions.hpp"
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/bin/../targets/x86_64-linux/include/crt/common_functions.h"
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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern "C" {
# 192 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double fabs(double x) throw();
# 285 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float fminf(float x, float y) throw();
# 334 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float fmaxf(float x, float y) throw();
# 386 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double fmax(double, double) throw();
# 430 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double sin(double x) throw();
# 463 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double cos(double x) throw();
# 482 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern void sincos(double x, double * sptr, double * cptr) throw();
# 498 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern void sincosf(float x, float * sptr, float * cptr) throw();
# 543 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double tan(double x) throw();
# 612 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double sqrt(double x) throw();
# 684 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double rsqrt(double x);
# 754 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float rsqrtf(float x);
# 810 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double log2(double x) throw();
# 835 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double exp2(double x) throw();
# 860 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float exp2f(float x) throw();
# 887 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double exp10(double x) throw();
# 910 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float exp10f(float x) throw();
# 956 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double expm1(double x) throw();
# 1001 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float expm1f(float x) throw();
# 1056 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float log2f(float x) throw();
# 1110 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double log10(double x) throw();
# 1181 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double log(double x) throw();
# 1275 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double log1p(double x) throw();
# 1372 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float log1pf(float x) throw();
# 1447 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double floor(double x) throw();
# 1486 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double exp(double x) throw();
# 1517 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double cosh(double x) throw();
# 1547 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double sinh(double x) throw();
# 1577 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double tanh(double x) throw();
# 1612 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double acosh(double x) throw();
# 1650 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float acoshf(float x) throw();
# 1666 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double asinh(double x) throw();
# 1682 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float asinhf(float x) throw();
# 1736 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double atanh(double x) throw();
# 1790 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float atanhf(float x) throw();
# 1849 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double ldexp(double x, int exp) throw();
# 1905 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float ldexpf(float x, int exp) throw();
# 1957 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double logb(double x) throw();
# 2012 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float logbf(float x) throw();
# 2042 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern int ilogb(double x) throw();
# 2072 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern int ilogbf(float x) throw();
# 2148 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double scalbn(double x, int n) throw();
# 2224 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float scalbnf(float x, int n) throw();
# 2300 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double scalbln(double x, long n) throw();
# 2376 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float scalblnf(float x, long n) throw();
# 2454 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double frexp(double x, int * nptr) throw();
# 2529 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float frexpf(float x, int * nptr) throw();
# 2543 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double round(double x) throw();
# 2560 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float roundf(float x) throw();
# 2578 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern long lround(double x) throw();
# 2596 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern long lroundf(float x) throw();
# 2614 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern long long llround(double x) throw();
# 2632 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern long long llroundf(float x) throw();
# 2684 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float rintf(float x) throw();
# 2701 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern long lrint(double x) throw();
# 2718 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern long lrintf(float x) throw();
# 2735 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern long long llrint(double x) throw();
# 2752 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern long long llrintf(float x) throw();
# 2805 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double nearbyint(double x) throw();
# 2858 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float nearbyintf(float x) throw();
# 2920 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double ceil(double x) throw();
# 2932 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double trunc(double x) throw();
# 2947 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float truncf(float x) throw();
# 2973 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double fdim(double x, double y) throw();
# 2999 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float fdimf(float x, float y) throw();
# 3035 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double atan2(double y, double x) throw();
# 3066 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double atan(double x) throw();
# 3089 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double acos(double x) throw();
# 3121 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double asin(double x) throw();
# 3167 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double hypot(double x, double y) throw();
# 3219 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double rhypot(double x, double y) throw();
# 3265 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float hypotf(float x, float y) throw();
# 3317 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float rhypotf(float x, float y) throw();
# 3361 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double norm3d(double a, double b, double c) throw();
# 3412 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double rnorm3d(double a, double b, double c) throw();
# 3461 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double norm4d(double a, double b, double c, double d) throw();
# 3517 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double rnorm4d(double a, double b, double c, double d) throw();
# 3562 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double norm(int dim, const double * t) throw();
# 3613 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double rnorm(int dim, const double * t) throw();
# 3665 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float rnormf(int dim, const float * a) throw();
# 3709 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float normf(int dim, const float * a) throw();
# 3754 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float norm3df(float a, float b, float c) throw();
# 3805 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float rnorm3df(float a, float b, float c) throw();
# 3854 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float norm4df(float a, float b, float c, float d) throw();
# 3910 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float rnorm4df(float a, float b, float c, float d) throw();
# 3997 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double cbrt(double x) throw();
# 4083 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float cbrtf(float x) throw();
# 4138 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double rcbrt(double x);
# 4188 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float rcbrtf(float x);
# 4248 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double sinpi(double x);
# 4308 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float sinpif(float x);
# 4360 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double cospi(double x);
# 4412 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float cospif(float x);
# 4442 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern void sincospi(double x, double * sptr, double * cptr);
# 4472 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern void sincospif(float x, float * sptr, float * cptr);
# 4784 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double pow(double x, double y) throw();
# 4840 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double modf(double x, double * iptr) throw();
# 4899 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double fmod(double x, double y) throw();
# 4985 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double remainder(double x, double y) throw();
# 5075 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float remainderf(float x, float y) throw();
# 5129 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double remquo(double x, double y, int * quo) throw();
# 5183 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float remquof(float x, float y, int * quo) throw();
# 5224 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double j0(double x) throw();
# 5266 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float j0f(float x) throw();
# 5327 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double j1(double x) throw();
# 5388 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float j1f(float x) throw();
# 5431 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double jn(int n, double x) throw();
# 5474 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float jnf(int n, float x) throw();
# 5526 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double y0(double x) throw();
# 5578 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float y0f(float x) throw();
# 5630 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double y1(double x) throw();
# 5682 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float y1f(float x) throw();
# 5735 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double yn(int n, double x) throw();
# 5788 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float ynf(int n, float x) throw();
# 5815 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double cyl_bessel_i0(double x) throw();
# 5841 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float cyl_bessel_i0f(float x) throw();
# 5868 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double cyl_bessel_i1(double x) throw();
# 5894 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float cyl_bessel_i1f(float x) throw();
# 5977 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double erf(double x) throw();
# 6059 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float erff(float x) throw();
# 6123 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double erfinv(double y);
# 6180 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float erfinvf(float y);
# 6219 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double erfc(double x) throw();
# 6257 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float erfcf(float x) throw();
# 6385 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double lgamma(double x) throw();
# 6448 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double erfcinv(double y);
# 6504 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float erfcinvf(float y);
# 6562 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double normcdfinv(double y);
# 6620 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float normcdfinvf(float y);
# 6663 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double normcdf(double y);
# 6706 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float normcdff(float y);
# 6781 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double erfcx(double x);
# 6856 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float erfcxf(float x);
# 6990 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float lgammaf(float x) throw();
# 7099 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double tgamma(double x) throw();
# 7208 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float tgammaf(float x) throw();
# 7221 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double copysign(double x, double y) throw();
# 7234 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float copysignf(float x, float y) throw();
# 7271 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double nextafter(double x, double y) throw();
# 7308 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float nextafterf(float x, float y) throw();
# 7324 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double nan(const char * tagp) throw();
# 7340 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern double fma(double x, double y, double z) throw();
# 7682 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float fmaf(float x, float y, float z) throw();
# 7693 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float acosf(float x) throw();
# 7791 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float asinf(float x) throw();
# 7831 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float atanf(float x) throw();
# 7864 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float atan2f(float y, float x) throw();
# 7888 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float cosf(float x) throw();
# 7930 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float sinf(float x) throw();
# 7972 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float tanf(float x) throw();
# 7996 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float coshf(float x) throw();
# 8037 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float sinhf(float x) throw();
# 8067 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float tanhf(float x) throw();
# 8118 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float logf(float x) throw();
# 8168 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float expf(float x) throw();
# 8219 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float log10f(float x) throw();
# 8274 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float modff(float x, float * iptr) throw();
# 8582 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float powf(float x, float y) throw();
# 8651 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float sqrtf(float x) throw();
# 8710 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float ceilf(float x) throw();
# 8782 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float floorf(float x) throw();
# 8841 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern float fmodf(float x, float y) throw();
# 8856 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
}
# 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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
__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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
namespace std {
# 9502 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
extern inline long long abs(long long);
# 9512 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
}
# 9761 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.h"
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/bin/../targets/x86_64-linux/include/crt/math_functions.h"
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/bin/../targets/x86_64-linux/include/crt/math_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/math_functions.hpp"
__attribute((always_inline)) inline int isfinite(float x) { return __finitef(x); }
# 359 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.hpp"
__attribute((always_inline)) inline int isfinite(double x) { return __finite(x); }
# 372 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/math_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/math_functions.hpp"
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/bin/../targets/x86_64-linux/include/crt/math_functions.hpp"
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/bin/../targets/x86_64-linux/include/cuda_surface_types.h"
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/bin/../targets/x86_64-linux/include/cuda_texture_types.h"
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/bin/../targets/x86_64-linux/include/crt/device_functions.h"
extern "C" {
# 3217 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/device_functions.h"
}
# 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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_functions.hpp"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
extern "C" {
# 180
}
# 189 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/device_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/crt/device_double_functions.h"
extern "C" {
# 1139 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/device_double_functions.h"
}
# 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/bin/../targets/x86_64-linux/include/crt/device_double_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_double_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_double_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_double_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_double_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_double_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_double_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_double_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_double_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_double_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_double_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_double_functions.hpp"
__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/bin/../targets/x86_64-linux/include/crt/device_double_functions.hpp"
__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/bin/../targets/x86_64-linux/include/sm_20_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_32_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_32_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_32_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_32_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_32_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_32_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_32_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_32_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_32_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_32_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_60_atomic_functions.h"
__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/bin/../targets/x86_64-linux/include/sm_20_intrinsics.h"
extern "C" {
# 1475 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/sm_20_intrinsics.h"
}
# 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/bin/../targets/x86_64-linux/include/sm_20_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_20_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_20_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_20_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_20_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_20_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_20_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__attribute__((unused)) static inline unsigned __activemask() {int volatile ___ = 1;::exit(___);}
#if 0
# 110
{ }
#endif
# 119 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_30_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_32_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_61_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_61_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_61_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_61_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_61_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_61_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_61_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_61_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_61_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_61_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_61_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/sm_61_intrinsics.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__attribute__((unused)) static inline void __nanosleep(unsigned ns) {int volatile ___ = 1;(void)ns;::exit(___);}
#if 0
# 111
{ }
#endif
# 113 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/crt/sm_70_rt.h"
__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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/surface_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_fetch_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/texture_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/surface_indirect_functions.h"
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/bin/../targets/x86_64-linux/include/crt/device_functions.h"
extern "C" unsigned __cudaPushCallConfiguration(dim3 gridDim, dim3 blockDim, size_t sharedMem = 0, CUstream_st * stream = 0);
# 68 "/usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/device_launch_parameters.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
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/bin/../targets/x86_64-linux/include/cuda_runtime.h"
#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
}
# 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
}
# 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;
# 40 "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/stdarg.h" 3
typedef __builtin_va_list __gnuc_va_list;
# 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
}
# 79 "/usr/include/stdio.h" 3
typedef __gnuc_va_list va_list;
# 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
}
# 21 "../.././target/target_cuda.h"
typedef cudaFuncCache tdpFuncCache;
# 28
typedef cudaMemcpyKind tdpMemcpyKind;
# 29
typedef cudaDeviceAttr tdpDeviceAttr;
# 46 "../.././target/target_cuda.h"
typedef cudaStream_t tdpStream_t;
# 47
typedef cudaError_t tdpError_t;
# 36 "../.././target/target.h"
tdpError_t tdpDeviceSetCacheConfig(tdpFuncCache cacheConfig);
# 37
tdpError_t tdpGetDeviceProperties(cudaDeviceProp * prop, int);
# 38
tdpError_t tdpSetDevice(int device);
# 40
tdpError_t tdpDeviceGetAttribute(int * value, tdpDeviceAttr attr, int device);
# 43
tdpError_t tdpDeviceGetCacheConfig(tdpFuncCache * cache);
# 44
tdpError_t tdpDeviceSynchronize();
# 45
tdpError_t tdpGetDevice(int * device);
# 46
tdpError_t tdpGetDeviceCount(int * count);
# 50
const char *tdpGetErrorName(tdpError_t error);
# 51
const char *tdpGetErrorString(tdpError_t error);
# 52
tdpError_t tdpGetLastError();
# 53
tdpError_t tdpPeekAtLastError();
# 57
tdpError_t tdpStreamCreate(tdpStream_t * stream);
# 58
tdpError_t tdpStreamDestroy(tdpStream_t stream);
# 59
tdpError_t tdpStreamSynchronize(tdpStream_t stream);
# 67
tdpError_t tdpFreeHost(void * phost);
# 68
tdpError_t tdpHostAlloc(void ** phost, size_t size, unsigned flags);
# 70
tdpError_t tdpMallocManaged(void ** devptr, size_t size, unsigned flag);
# 72
tdpError_t tdpMemcpy(void * dst, const void * src, size_t count, tdpMemcpyKind kind);
# 74
tdpError_t tdpMemcpyAsync(void * dst, const void * src, size_t count, tdpMemcpyKind kind, tdpStream_t stream);
# 76
tdpError_t tdpMemset(void * devPtr, int value, size_t count);
# 79
tdpError_t tdpFree(void * devPtr);
# 80
tdpError_t tdpMalloc(void ** devRtr, size_t size);
# 99 "../.././target/target.h"
tdpError_t tdpThreadModelInfo(FILE * fp);
# 103
__attribute__((unused)) int tdpAtomicAddInt(int * sum, int val);
# 104
__attribute__((unused)) int tdpAtomicMaxInt(int * maxval, int val);
# 105
__attribute__((unused)) int tdpAtomicMinInt(int * minval, int val);
# 106
__attribute__((unused)) double tdpAtomicAddDouble(double * sum, double val);
# 107
__attribute__((unused)) double tdpAtomicMaxDouble(double * maxval, double val);
# 108
__attribute__((unused)) double tdpAtomicMinDouble(double * minval, double val);
# 112
__attribute__((unused)) int tdpAtomicBlockAddInt(int * partsum);
# 113
__attribute__((unused)) double tdpAtomicBlockAddDouble(double * partsum);
# 117
void tdpErrorHandler(tdpError_t ifail, const char * file, int line, int fatal);
# 22 "../.././src/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 "../.././src/runtime.h"
typedef struct rt_s rt_t;
# 24
int rt_create(pe_t * pe, rt_t ** prt);
# 25
int rt_free(rt_t * rt);
# 26
int rt_read_input_file(rt_t * rt, const char * filename);
# 27
int rt_info(rt_t * rt);
# 28
int rt_int_parameter(rt_t * rt, const char * key, int * ivalue);
# 29
int rt_int_parameter_vector(rt_t * rt, const char * key, int ivalue[3]);
# 30
int rt_double_parameter(rt_t * rt, const char * key, double * value);
# 31
int rt_double_parameter_vector(rt_t * rt, const char * key, double value[3]);
# 32
int rt_string_parameter(rt_t * rt, const char * key, char * s, unsigned len);
# 33
int rt_switch(rt_t * rt, const char * key);
# 34
int rt_active_keys(rt_t * rt, int * nactive);
# 35
int rt_add_key_value(rt_t * rt, const char * key, const char * value);
# 32 "../.././src/io_options.h"
enum io_mode_enum { IO_MODE_INVALID, IO_MODE_SINGLE, IO_MODE_MULTIPLE};
# 36
enum io_record_format_enum { IO_RECORD_INVALID,
# 37
IO_RECORD_ASCII,
# 38
IO_RECORD_BINARY};
# 42
enum io_metadata_version_enum { IO_METADATA_INVALID,
# 43
IO_METADATA_SINGLE_V1,
# 44
IO_METADATA_MULTI_V1};
# 48
typedef io_mode_enum io_mode_enum_t;
# 49
typedef io_record_format_enum io_record_format_enum_t;
# 50
typedef io_metadata_version_enum io_metadata_version_enum_t;
# 52
struct io_options_s {
# 53
io_mode_enum_t mode;
# 54
io_record_format_enum_t iorformat;
# 55
io_metadata_version_enum_t metadata_version;
# 56
int report;
# 57
int asynchronous;
# 58
};
# 60
typedef io_options_s io_options_t;
# 62
io_mode_enum_t io_mode_default();
# 63
io_record_format_enum_t io_record_format_default();
# 64
io_metadata_version_enum_t io_metadata_version_default();
# 65
io_options_t io_options_default();
# 67
int io_options_valid(const io_options_t * options);
# 68
int io_options_mode_valid(io_mode_enum_t mode);
# 69
int io_options_record_format_valid(io_record_format_enum_t iorformat);
# 70
int io_options_metadata_version_valid(const io_options_t * options);
# 25 "../.././src/io_options_rt.h"
int io_options_rt(pe_t * pe, rt_t * rt, const char * keystub, io_options_t * opts);
# 27
int io_options_rt_mode(pe_t * pe, rt_t * rt, const char * key, io_mode_enum_t * mode);
# 29
int io_options_rt_record_format(pe_t * pe, rt_t * rt, const char * key, io_record_format_enum_t * options);
# 22 "test_io_options_rt.c"
int test_io_options_rt_mode(pe_t * pe);
# 23
int test_io_options_rt_rformat(pe_t * pe);
# 24
int test_io_options_rt_default(pe_t * pe);
# 25
int test_io_options_rt(pe_t * pe);
# 33
int test_io_options_rt_suite() {
# 35
pe_t *pe = (__null);
# 37
pe_create(MPI_COMM_WORLD, PE_QUIET, &pe);
# 39
test_io_options_rt_mode(pe);
# 40
test_io_options_rt_rformat(pe);
# 41
test_io_options_rt_default(pe);
# 42
test_io_options_rt(pe);
# 44
pe_info(pe, "PASS ./unit/test_io_options_rt\n");
# 46
pe_free(pe);
# 48
return 0;
# 49
}
# 57
int test_io_options_rt_mode(pe_t *pe) {
# 59
rt_t *rt = (__null);
# 60
io_mode_enum_t mode = io_mode_default();
# 62
(pe) ? static_cast< void>(0) : __assert_fail("pe", "test_io_options_rt.c", 62, __PRETTY_FUNCTION__);
# 64
rt_create(pe, &rt);
# 65
rt_add_key_value(rt, "example_input_io_mode", "SINGLE");
# 66
rt_add_key_value(rt, "example_output_io_mode", "MULTIPLE");
# 68
io_options_rt_mode(pe, rt, "example_input_io_mode", &mode);
# 69
(mode == (IO_MODE_SINGLE)) ? static_cast< void>(0) : __assert_fail("mode == IO_MODE_SINGLE", "test_io_options_rt.c", 69, __PRETTY_FUNCTION__);
# 71
io_options_rt_mode(pe, rt, "example_output_io_mode", &mode);
# 72
(mode == (IO_MODE_MULTIPLE)) ? static_cast< void>(0) : __assert_fail("mode == IO_MODE_MULTIPLE", "test_io_options_rt.c", 72, __PRETTY_FUNCTION__);
# 74
rt_free(rt);
# 76
return 0;
# 77
}
# 85
int test_io_options_rt_rformat(pe_t *pe) {
# 87
rt_t *rt = (__null);
# 88
io_record_format_enum_t iorformat = io_record_format_default();
# 90
(pe) ? static_cast< void>(0) : __assert_fail("pe", "test_io_options_rt.c", 90, __PRETTY_FUNCTION__);
# 92
rt_create(pe, &rt);
# 94
rt_add_key_value(rt, "lb_input_io_format", "ASCII");
# 95
rt_add_key_value(rt, "lb_output_io_format", "BINARY");
# 97
io_options_rt_record_format(pe, rt, "lb_input_io_format", &iorformat);
# 98
(iorformat == (IO_RECORD_ASCII)) ? static_cast< void>(0) : __assert_fail("iorformat == IO_RECORD_ASCII", "test_io_options_rt.c", 98, __PRETTY_FUNCTION__);
# 100
io_options_rt_record_format(pe, rt, "lb_output_io_format", &iorformat);
# 101
(iorformat == (IO_RECORD_BINARY)) ? static_cast< void>(0) : __assert_fail("iorformat == IO_RECORD_BINARY", "test_io_options_rt.c", 101, __PRETTY_FUNCTION__);
# 103
rt_free(rt);
# 105
return 0;
# 106
}
# 116 "test_io_options_rt.c"
int test_io_options_rt_default(pe_t *pe) {
# 118
rt_t *rt = (__null);
# 119
io_options_t opts = {};
# 120
io_options_t defs = io_options_default();
# 122
(pe) ? static_cast< void>(0) : __assert_fail("pe", "test_io_options_rt.c", 122, __PRETTY_FUNCTION__);
# 124
rt_create(pe, &rt);
# 126
io_options_rt(pe, rt, "default", &opts);
# 128
((opts.mode) == (defs.mode)) ? static_cast< void>(0) : __assert_fail("opts.mode == defs.mode", "test_io_options_rt.c", 128, __PRETTY_FUNCTION__);
# 129
((opts.iorformat) == (defs.iorformat)) ? static_cast< void>(0) : __assert_fail("opts.iorformat == defs.iorformat", "test_io_options_rt.c", 129, __PRETTY_FUNCTION__);
# 130
((opts.metadata_version) == (defs.metadata_version)) ? static_cast< void>(0) : __assert_fail("opts.metadata_version == defs.metadata_version", "test_io_options_rt.c", 130, __PRETTY_FUNCTION__);
# 131
((opts.report) == (defs.report)) ? static_cast< void>(0) : __assert_fail("opts.report == defs.report", "test_io_options_rt.c", 131, __PRETTY_FUNCTION__);
# 132
((opts.asynchronous) == (defs.asynchronous)) ? static_cast< void>(0) : __assert_fail("opts.asynchronous == defs.asynchronous", "test_io_options_rt.c", 132, __PRETTY_FUNCTION__);
# 134
rt_free(rt);
# 136
return 0;
# 137
}
# 148 "test_io_options_rt.c"
int test_io_options_rt(pe_t *pe) {
# 150
rt_t *rt = (__null);
# 151
io_options_t opts = {};
# 153
(pe) ? static_cast< void>(0) : __assert_fail("pe", "test_io_options_rt.c", 153, __PRETTY_FUNCTION__);
# 155
rt_create(pe, &rt);
# 157
rt_add_key_value(rt, "default_io_mode", "multiple");
# 158
rt_add_key_value(rt, "default_io_format", "ascii");
# 159
rt_add_key_value(rt, "default_io_report", "yes");
# 161
io_options_rt(pe, rt, "default", &opts);
# 163
((opts.mode) == (IO_MODE_MULTIPLE)) ? static_cast< void>(0) : __assert_fail("opts.mode == IO_MODE_MULTIPLE", "test_io_options_rt.c", 163, __PRETTY_FUNCTION__);
# 164
((opts.iorformat) == (IO_RECORD_ASCII)) ? static_cast< void>(0) : __assert_fail("opts.iorformat == IO_RECORD_ASCII", "test_io_options_rt.c", 164, __PRETTY_FUNCTION__);
# 165
((opts.metadata_version) == (IO_METADATA_MULTI_V1)) ? static_cast< void>(0) : __assert_fail("opts.metadata_version == IO_METADATA_MULTI_V1", "test_io_options_rt.c", 165, __PRETTY_FUNCTION__);
# 166
((opts.report) == 1) ? static_cast< void>(0) : __assert_fail("opts.report == 1", "test_io_options_rt.c", 166, __PRETTY_FUNCTION__);
# 167
((opts.asynchronous) == 0) ? static_cast< void>(0) : __assert_fail("opts.asynchronous == 0", "test_io_options_rt.c", 167, __PRETTY_FUNCTION__);
# 168
rt_free(rt);
# 170
return 0;
# 171
}
# 1 "test_io_options_rt.cudafe1.stub.c"
#define _NV_ANON_NAMESPACE _GLOBAL__N__26_test_io_options_rt_cpp1_ii_f649cb17
# 1 "test_io_options_rt.cudafe1.stub.c"
#include "test_io_options_rt.cudafe1.stub.c"
# 1 "test_io_options_rt.cudafe1.stub.c"
#undef _NV_ANON_NAMESPACE
| [
"[email protected]"
] | |
78a5a20f18ffc21e4e650570e443140f0acc7617 | 9c8715f9d5c4f9ef2fa0262b4d9b15221a6bca26 | /src/util/database/sqlite/src/csqliteoutputvectormgr.cc | d841a81ffbb5e8b93dc13c231062813e254473ef | [] | no_license | kyeongsoo/inet-hnrl | 8f424d4b077a855a24a2ba682ea1109b78902f41 | 857ae37cd233914fd7271584afc4be10bcf75a61 | refs/heads/master | 2020-04-05T22:43:00.771178 | 2017-02-27T08:59:31 | 2017-02-27T08:59:31 | 193,740 | 5 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 9,797 | cc | ///
/// @file csqliteoutputvectormgr.h
/// @author Kyeong Soo (Joseph) Kim <[email protected]>
/// @date 2012-12-05
///
/// @brief Implements cSQLiteOutputVectorManager class that writes output vectors
/// into SQLite databases.
///
/// @remarks Copyright (C) 2012 Kyeong Soo (Joseph) Kim. All rights reserved.
///
/// @remarks This software is written and distributed under the GNU General
/// Public License Version 2 (http://www.gnu.org/licenses/gpl-2.0.html).
/// You must not remove this notice, or any other, from this software.
///
#include <assert.h>
#include "csqliteoutputvectormgr.h"
#include "fileoutvectormgr.h"
//#include "oppsqliteutils.h"
// define prepared SQL statements
#define SQL_INSERT_VRUN "INSERT INTO vrun(runnumber,network) VALUES(?,?)"
#define SQL_INSERT_VECTOR "INSERT INTO vector(runid,module,name) VALUES(?,?,?)"
#define SQL_INSERT_VECATTR "INSERT INTO vecattr(vectorid,name,value) VALUES(?,?,?)"
#define SQL_INSERT_VECDATA "INSERT INTO vecdata(vectorid,time,value) VALUES(?,?,?)"
Register_Class(cSQLiteOutputVectorManager);
Register_GlobalConfigOption(CFGID_SQLITEOUTVECTORMGR_CONNECTIONNAME, "sqliteoutputvectormanager-connectionname", CFG_STRING, "\"sqlite\"", "Object name of database connection parameters, default='sqlite'");
Register_GlobalConfigOption(CFGID_SQLITEOUTVECTORMGR_COMMIT_FREQ, "sqliteoutputvectormanager-commit-freq", CFG_INT, "50", "COMMIT every n INSERTs, default=50");
Register_PerObjectConfigOption(CFGID_SQLITE_VECTOR_DB, "sqlite-vector-database", KIND_NONE, CFG_STRING, "\"\"", "Output vector database name");
//Register_PerObjectConfigOption(CFGID_SQLITE_OPT_FILE, "sqlite-options-file", KIND_NONE, CFG_FILENAME, "", "Options file for sqlite server");
cSQLiteOutputVectorManager::cSQLiteOutputVectorManager()
{
db = NULL;
insertVectorStmt = insertVecdataStmt = NULL;
}
cSQLiteOutputVectorManager::~cSQLiteOutputVectorManager()
{
if (db)
closeDB();
}
void cSQLiteOutputVectorManager::openDB()
{
EV << getClassName() << " connecting to an SQLite database ...";
std::string cfgobj = ev.getConfig()->getAsString(CFGID_SQLITEOUTVECTORMGR_CONNECTIONNAME);
if (cfgobj.empty())
cfgobj = "sqlite";
std::string db_name = (ev.getConfig())->getAsString(cfgobj.c_str(), CFGID_SQLITE_VECTOR_DB, NULL);
// TODO: Implement option processing
// unsigned int clientflag = (unsigned int) cfg->getAsInt(cfgobj, CFGID_SQLITE_CLIENTFLAG, 0);
// bool usepipe = cfg->getAsBool(cfgobj, CFGID_SQLITE_USE_PIPE, false);
// std::string optionsfile = cfg->getAsFilename(cfgobj, CFGID_SQLITE_OPT_FILE);
// // set options, then connect
// if (!optionsfile.empty())
// sqlite_options(db, SQLITE_READ_DEFAULT_FILE, optionsfile.c_str());
// if (usepipe)
// sqlite_options(db, SQLITE_OPT_NAMED_PIPE, 0);
if (sqlite3_open(db_name.c_str(), &db) != SQLITE_OK)
throw cRuntimeError("Sqlite error: Failed to connect to database: %s", sqlite3_errmsg(db));
EV << " OK\n";
commitFreq = ev.getConfig()->getAsInt(CFGID_SQLITEOUTVECTORMGR_COMMIT_FREQ);
insertCount = 0;
// prepare SQL statements; note that SQLite doesn't support 'binding variables'
if (sqlite3_prepare_v2(db, SQL_INSERT_VECTOR, strlen(SQL_INSERT_VECTOR)+1, &insertVectorStmt, NULL) != SQLITE_OK)
throw cRuntimeError("SQLite error: prepare statement for 'insertVectorStmt' failed: %s", sqlite3_errmsg(db));
if (sqlite3_prepare_v2(db, SQL_INSERT_VECATTR, strlen(SQL_INSERT_VECATTR)+1, &insertVecAttrStmt, NULL) != SQLITE_OK)
throw cRuntimeError("SQLite error: prepare statement for 'insertVecAttrStmt' failed: %s", sqlite3_errmsg(db));
if (sqlite3_prepare_v2(db, SQL_INSERT_VECDATA, strlen(SQL_INSERT_VECDATA)+1, &insertVecdataStmt, NULL) != SQLITE_OK)
throw cRuntimeError("SQLite error: prepare statement for 'insertVecdataStmt' failed: %s", sqlite3_errmsg(db));
// optimize the DB performance
char *errMsg;
sqlite3_exec(db, "PRAGMA synchronous = OFF", NULL, NULL, &errMsg);
}
void cSQLiteOutputVectorManager::closeDB()
{
if (insertVectorStmt) sqlite3_finalize(insertVectorStmt);
if (insertVecAttrStmt) sqlite3_finalize(insertVecAttrStmt);
if (insertVecdataStmt) sqlite3_finalize(insertVecdataStmt);
insertVectorStmt = insertVecdataStmt = insertVecAttrStmt = NULL;
if (db) sqlite3_close(db);
db = NULL;
}
void cSQLiteOutputVectorManager::beginTransaction()
{
char *errMsg = NULL;
if (sqlite3_exec(db, "BEGIN", NULL, NULL, &errMsg) != SQLITE_OK)
throw cRuntimeError("SQLite error: BEGIN failed: %s", errMsg);
}
void cSQLiteOutputVectorManager::endTransaction()
{
char *errMsg = NULL;
if (sqlite3_exec(db, "COMMIT", NULL, NULL, &errMsg) != SQLITE_OK)
throw cRuntimeError("SQLite error: COMMIT failed: %s", errMsg);
}
void cSQLiteOutputVectorManager::initVector(sVectorData *vp)
{
if (!initialized)
insertRunIntoDB();
// fill in prepared statement parameters, and fire off the statement
sqlite3_bind_int(insertVectorStmt, 1, runId);
sqlite3_bind_text(insertVectorStmt, 2, vp->modulename.c_str(), strlen(vp->modulename.c_str())+1, NULL);
sqlite3_bind_text(insertVectorStmt, 3, vp->vectorname.c_str(), strlen(vp->vectorname.c_str())+1, NULL);
if (sqlite3_step(insertVectorStmt) != SQLITE_DONE)
throw cRuntimeError("SQLite error: INSERT failed with 'insertVectorStmt': %s", sqlite3_errmsg(db));
sqlite3_reset(insertVectorStmt);
// query the automatic vectorid from the newly inserted row
// Note: this INSERT must not be DELAYED, otherwise we get zero here.
vp->id = long(sqlite3_last_insert_rowid(db));
// write attributes:
sqlite3_bind_int(insertVecAttrStmt, 1, vp->id);
for (opp_string_map::iterator it=vp->attributes.begin(); it != vp->attributes.end(); ++it)
{
sqlite3_bind_text(insertVecAttrStmt, 2, it->first.c_str(), strlen(it->first.c_str())+1, NULL);
sqlite3_bind_text(insertVecAttrStmt, 3, it->second.c_str(), strlen(it->second.c_str())+1, NULL);
if (sqlite3_step(insertVecAttrStmt) != SQLITE_DONE)
throw cRuntimeError("SQLite error: INSERT failed with 'insertVecAttrStmt': %s", sqlite3_errmsg(db));
sqlite3_reset(insertVecAttrStmt);
}
vp->initialised = true;
}
void cSQLiteOutputVectorManager::startRun()
{
// clean up file from previous runs
if (db)
closeDB();
openDB();
initialized = false;
}
void cSQLiteOutputVectorManager::endRun()
{
if (db)
{
endTransaction();
closeDB();
}
}
void cSQLiteOutputVectorManager::insertRunIntoDB()
{
if (!initialized)
{ // insert run into the database
sqlite3_stmt *stmt;
sqlite3_prepare_v2(db, SQL_INSERT_VRUN, strlen(SQL_INSERT_VRUN)+1, &stmt, NULL);
int runNumber = simulation.getActiveEnvir()->getConfigEx()->getActiveRunNumber();
sqlite3_bind_int(stmt, 1, runNumber);
std::string networkName = simulation.getNetworkType()->getName();
sqlite3_bind_text(stmt, 2, networkName.c_str(), networkName.length()+1, NULL);
if (sqlite3_step(stmt) != SQLITE_DONE)
throw cRuntimeError("SQLite error: INSERT failed for 'vrun' table: %s", sqlite3_errmsg(db));
sqlite3_reset(stmt);
// query the automatic runid from the newly inserted row
runId = long(sqlite3_last_insert_rowid(db));
// begin transaction for faster inserts
beginTransaction();
initialized = true;
}
}
void *cSQLiteOutputVectorManager::registerVector(const char *modulename, const char *vectorname)
{
// only create the data structure here -- we'll insert the entry into the
// DB lazily, when first data gets written
sVectorData *vp = createVectorData();
vp->id = -1; // we'll get it from the database
vp->initialised = false;
vp->modulename = modulename;
vp->vectorname = vectorname;
cFileOutputVectorManager::getOutVectorConfig(modulename, vectorname,
vp->enabled, vp->recordEventNumbers, vp->intervals); //FIXME...
return vp;
}
cSQLiteOutputVectorManager::sVectorData *cSQLiteOutputVectorManager::createVectorData()
{
return new sVectorData;
}
void cSQLiteOutputVectorManager::deregisterVector(void *vectorhandle)
{
sVectorData *vp = (sVectorData *)vectorhandle;
delete vp;
}
void cSQLiteOutputVectorManager::setVectorAttribute(void *vectorhandle, const char *name, const char *value)
{
ASSERT(vectorhandle != NULL);
sVectorData *vp = (sVectorData *)vectorhandle;
vp->attributes[name] = value;
}
bool cSQLiteOutputVectorManager::record(void *vectorhandle, simtime_t t, double value)
{
sVectorData *vp = (sVectorData *)vectorhandle;
if (!vp->enabled)
return false;
if (vp->intervals.contains(t))
{
if (!vp->initialised)
initVector(vp);
// fill in prepared statement parameters, and fire off the statement
sqlite3_bind_int(insertVecdataStmt, 1, vp->id);
sqlite3_bind_double(insertVecdataStmt, 2, SIMTIME_DBL(t));
sqlite3_bind_double(insertVecdataStmt, 3, value);
if (sqlite3_step(insertVecdataStmt) != SQLITE_DONE)
throw cRuntimeError("SQLite error: INSERT failed with 'insertVecdataStmt': %s", sqlite3_errmsg(db));
sqlite3_reset(insertVecdataStmt);
// commit every once in a while
if (++insertCount == commitFreq)
{
insertCount = 0;
endTransaction();
beginTransaction();
}
return true;
}
return false;
}
void cSQLiteOutputVectorManager::flush()
{
endTransaction();
}
| [
"[email protected]"
] | |
e821e01e9c3dde1bf90a11fc8d4d49aedb7bf309 | cccfb7be281ca89f8682c144eac0d5d5559b2deb | /components/services/storage/public/cpp/buckets/bucket_info.cc | 161a883a21989c5e3b7d2074908b71b1a31e421b | [
"BSD-3-Clause"
] | permissive | SREERAGI18/chromium | 172b23d07568a4e3873983bf49b37adc92453dd0 | fd8a8914ca0183f0add65ae55f04e287543c7d4a | refs/heads/master | 2023-08-27T17:45:48.928019 | 2021-11-11T22:24:28 | 2021-11-11T22:24:28 | 428,659,250 | 1 | 0 | BSD-3-Clause | 2021-11-16T13:08:14 | 2021-11-16T13:08:14 | null | UTF-8 | C++ | false | false | 1,341 | cc | // Copyright 2021 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 "components/services/storage/public/cpp/buckets/bucket_info.h"
namespace storage {
BucketInfo::BucketInfo(BucketId bucket_id,
blink::StorageKey storage_key,
blink::mojom::StorageType type,
std::string name,
base::Time expiration,
int64_t quota)
: id(std::move(bucket_id)),
storage_key(std::move(storage_key)),
type(type),
name(std::move(name)),
expiration(std::move(expiration)),
quota(quota) {}
BucketInfo::BucketInfo() = default;
BucketInfo::~BucketInfo() = default;
BucketInfo::BucketInfo(const BucketInfo&) = default;
BucketInfo::BucketInfo(BucketInfo&&) noexcept = default;
BucketInfo& BucketInfo::operator=(const BucketInfo&) = default;
BucketInfo& BucketInfo::operator=(BucketInfo&&) noexcept = default;
bool operator==(const BucketInfo& lhs, const BucketInfo& rhs) {
return lhs.id == rhs.id;
}
bool operator!=(const BucketInfo& lhs, const BucketInfo& rhs) {
return !(lhs == rhs);
}
bool operator<(const BucketInfo& lhs, const BucketInfo& rhs) {
return lhs.id < rhs.id;
}
} // namespace storage
| [
"[email protected]"
] | |
d2761058d7e533d121ba2a818a5a5f6b6ce03cb7 | b22588340d7925b614a735bbbde1b351ad657ffc | /athena/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatTool.h | 91eb211bd87ec19ecdc40b2c1b0ce6b28e8b3e33 | [] | no_license | rushioda/PIXELVALID_athena | 90befe12042c1249cbb3655dde1428bb9b9a42ce | 22df23187ef85e9c3120122c8375ea0e7d8ea440 | refs/heads/master | 2020-12-14T22:01:15.365949 | 2020-01-19T03:59:35 | 2020-01-19T03:59:35 | 234,836,993 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,290 | h | /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef INDETSERVMATGEOMODEL_INDETSERVMATTOOL_H
#define INDETSERVMATGEOMODEL_INDETSERVMATTOOL_H
#include "GeoModelUtilities/GeoModelTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "GaudiKernel/ServiceHandle.h"
#include <string>
class InDetServMatAthenaComps;
class IGeoModelSvc;
class IRDBAccessSvc;
class IGeometryDBSvc;
class IInDetServMatBuilderTool;
namespace InDetDD {
class InDetServMatManager;
}
class InDetServMatTool : public GeoModelTool {
public:
// Standard Constructor
InDetServMatTool( const std::string& type, const std::string& name, const IInterface* parent );
// Standard Destructor
virtual ~InDetServMatTool();
virtual StatusCode create( StoreGateSvc* detStore );
virtual StatusCode clear(StoreGateSvc* detStore);
private:
ServiceHandle< IGeoModelSvc > m_geoModelSvc;
ServiceHandle< IRDBAccessSvc > m_rdbAccessSvc;
ServiceHandle< IGeometryDBSvc > m_geometryDBSvc;
ToolHandle<IInDetServMatBuilderTool> m_builderTool;
bool m_devVersion;
bool m_forFrozenShowers;
std::string m_overrideVersionName;
const InDetDD::InDetServMatManager* m_manager;
InDetServMatAthenaComps * m_athenaComps;
};
#endif // INDETSERVMATGEOMODEL_INDETSERVMATTOOL_H
| [
"[email protected]"
] | |
73fd6aaffcb9a4bc5f0beef3f390f9530cc34478 | b7139acb3448d39dbeb8597c7f65d4a378ddc330 | /2015/chapter_14/examples/14_1.cpp | 588d19e477fb84f4791807c8a974002c920f1c75 | [] | no_license | linsallyzhao/earlyobjects-exercises | 3f88e2d48674fdd431ecfd7e57c0fe2fa30c93f8 | 746a2489eb135fee8c04c74e3e763b07853e6796 | refs/heads/master | 2021-08-24T13:27:43.256219 | 2017-12-10T00:38:56 | 2017-12-10T00:38:56 | 113,711,078 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 225 | cpp | #include <iostream>
void message(int);
int main()
{
message(3);
return 0;
}
void message(int times)
{
if (times > 0)
{
std::cout << "Message " << times << "\n";
message(times - 1);
}
}
| [
"[email protected]"
] | |
9c60ebe5f6dc6301d72ac35c4d265845ea4df5bd | 4e98fba7c994f89f8c12c9e5f68036e396d540fc | /src/Settings.cpp | d83d922e72209eb2c5b9a19e904d529f6c7806d1 | [] | no_license | sergburgoff/SpaceGameProject | 86b07ea60913830ab97bc22cdf07dd351b8c8e29 | 11abb28775b72940ed7338f66616f775720cf2df | refs/heads/master | 2022-12-29T21:39:27.299822 | 2020-10-07T11:52:00 | 2020-10-07T11:52:00 | 291,795,879 | 0 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 1,328 | cpp | #include "stdafx.h"
#include "Settings.h"
#include <iostream>
#include <fstream>
int Settings::WINDOW_WIDTH;
int Settings::WINDOW_HEIGHT;
int Settings::BOTTOM_BORDER;
int Settings::TOP_BORDER;
int Settings::RIGHT_BORDER;
int Settings::LEFT_BORDER;
int Settings::RELOADING_TIME;
float Settings::BULLET_SPEED;
float Settings::SIMPLE_ENEMIES_SPEED;
float Settings::ARMORED_ENEMIES_SPEED;
void Settings::setBorders()
{
//
// Выстраиваются размеры игрового поля на основе размеров окна
//
Settings::BOTTOM_BORDER = 20;
Settings::TOP_BORDER = Settings::WINDOW_HEIGHT - 10;
Settings::LEFT_BORDER = 20;
Settings::RIGHT_BORDER = Settings::WINDOW_WIDTH - 10;
}
bool Settings::LoadSettings()
{
//
// Загрузка настроек скоростей объектов и времени перезарядки
//
std::ifstream input;
input.open("base_p/settings.txt");
if (!input.is_open())
return false;
std::string inLine;
input >> inLine;
input >> inLine;
BULLET_SPEED = std::stof(inLine);
input >> inLine;
input >> inLine;
SIMPLE_ENEMIES_SPEED = std::stof(inLine);
input >> inLine;
input >> inLine;
ARMORED_ENEMIES_SPEED = std::stof(inLine);
input >> inLine;
input >> inLine;
RELOADING_TIME = std::stof(inLine);
input.close();
return true;
} | [
"[email protected]"
] | |
1d66a0be647504914d55cba8651bd7ffeec8d82d | 8829980190175b74cfeb78d929df73df6d9d740a | /src/googleinit.h | 21f417c586c935fbd54590e79eecbb028f81293b | [
"BSD-2-Clause"
] | permissive | chenbaihu/proxy | ae1e788f7325cdba24d91b11011ca4e7df42e572 | 972e6df37c9e31534f5f39760430f588c435eef8 | refs/heads/master | 2021-01-22T16:05:20.227137 | 2014-01-18T11:35:59 | 2014-01-18T11:35:59 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,741 | h | // Copyright (c) 2005, Google Inc.
// All rights reserved.
//
// 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.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// 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
// OWNER 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.
// ---
// Author: Jacob Hoffman-Andrews
#ifndef _GOOGLEINIT_H
#define _GOOGLEINIT_H
#include "logger.h"
namespace slib{
class GoogleInitializer {
public:
typedef void(*VoidFunction)(void);
GoogleInitializer(const char* name, VoidFunction ctor, VoidFunction dtor)
: name_(name), destructor_(dtor) {
MYDEBUG("<GoogleModuleObject> constructing: %s\n", name_);
if (ctor)
ctor();
}
~GoogleInitializer() {
MYDEBUG("<GoogleModuleObject> destroying: %s\n", name_);
if (destructor_)
destructor_();
}
private:
const char* const name_;
const VoidFunction destructor_;
};
}
#define REGISTER_MODULE_INITIALIZER(name, body) \
namespace { \
static void google_init_module_##name() { body; } \
slib::GoogleInitializer google_initializer_module_##name(#name, \
google_init_module_##name, NULL); \
}
#define REGISTER_MODULE_DESTRUCTOR(name, body) \
namespace { \
static void google_destruct_module_##name() { body; } \
slib::GoogleInitializer google_destructor_module_##name(#name, \
NULL, google_destruct_module_##name); \
}
#endif /* _GOOGLEINIT_H */ | [
"[email protected]"
] | |
b25378f3044e6f61a7f5b80ae7797d106926db82 | 43eaa407062107447e5703fe7f7447c2b9e6734b | /ejercicio1BIS2.cpp | 6a977f6b2f2dbd0054ab9d042ad0beac8b229884 | [] | no_license | Nabubabu99/ejercicioslaboratorio | ce34031a649528294f763258368a747543b9e26e | 438cef9e474e4f46f0a9e8143c9aeb856229cbb7 | refs/heads/main | 2023-06-14T07:58:36.910441 | 2021-06-29T13:52:51 | 2021-06-29T13:52:51 | 366,223,278 | 0 | 0 | null | 2021-06-29T13:52:51 | 2021-05-11T01:38:31 | C++ | UTF-8 | C++ | false | false | 1,471 | cpp | #include <stdio.h>
#include <iostream>
using namespace std;
void leer(string mensaje, int &valor){
cout << mensaje << endl;
cin >> valor;
}
bool seAbreCursoSemanal(int tiempoLlegada[], int alumnosTotal, int alumnosMinimosAbrir){
int cantAlumnosHorario = 0;
for (int i = 0; i < alumnosTotal; i++)
{
if(tiempoLlegada[i] <= 0){
cantAlumnosHorario++;
}
}
return cantAlumnosHorario >= alumnosMinimosAbrir;
}
int main()
{
int cantDias = 5;
int alumnosTotal = 4;
int alumnosMinimosAbrir = 0;
string diasSemana[5] = {"lunes", "martes", "miercoles", "jueves", "viernes"};
leer("Ingrese el minumo para abrir el curso", alumnosMinimosAbrir);
int tiempoLlegada[alumnosTotal];
bool tiempoLlegadaSemanal[cantDias];
for (size_t i = 0; i < cantDias; i++)
{
for (int j = 0; j < alumnosTotal; j++)
{
cout << "Ingrese el tiempo que llego el alumno en el dia " << diasSemana[i] << endl;
cin >> tiempoLlegada[j];
}
tiempoLlegadaSemanal[i] = seAbreCursoSemanal(tiempoLlegada, alumnosTotal, alumnosMinimosAbrir);
}
for (int i = 0; i < cantDias; i++)
{
if(tiempoLlegadaSemanal[i]){
cout << "El dia " << diasSemana[i] << " se abrio el curso" << endl;
}
else{
cout << "El dia " << diasSemana[i] << " no se abrio el curso" << endl;
}
}
return 0;
} | [
"[email protected]"
] | |
93a7cfc9f0957cadea6bfc7446a08ec01458dc90 | 2e6a65aa5065293e693eadd1f0e8918c0be69557 | /SLAM_Demo/OpenGL_Study/src/hello_two_triangles.cpp | cb4660a65d3ba4dbb91cb38a26528f6eed389c59 | [] | no_license | NLS-SP/SLAM_Basics | dece764f7a95862dab4747b0c6d2f3f89b1a959b | 23fb7417e75f955b640170a8cabeab4ed8d68b7a | refs/heads/master | 2022-11-17T00:34:37.168785 | 2021-03-21T13:55:08 | 2021-03-21T13:55:08 | 229,234,194 | 3 | 3 | null | 2022-11-04T07:42:26 | 2019-12-20T09:33:43 | C++ | UTF-8 | C++ | false | false | 5,913 | cpp | //
// Created by Robotics_qi on 2020/5/27.
//
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
void framebuffer_size_callback(GLFWwindow* window, int width, int height);
void processInput(GLFWwindow* window);
// setttings.
const unsigned int SCR_WIDTH = 800;
const unsigned int SCR_HEIGHT = 600;
const char *vertexShaderSource = "#version 330 core\n"
"layout (location = 0) in vec3 aPos;\n"
"void main()\n"
"{\n"
" gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n"
"}\0";
const char *fragmentShaderSource = "#version 330 core\n"
"out vec4 FragColor;\n"
"void main()\n"
"{\n"
" FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);\n"
"}\n\0";
int main() {
// glfw: initialize and configure.
// -------------------------------
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
#ifdef __APPLE__
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
#endif
// glfw window creation.
// --------------------
GLFWwindow *window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "LearnOpenGL", NULL, NULL);
if (window == NULL) {
std::cout << "Failed to create GLFW window" << std::endl;
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
// glad: load all OpenGL function pointers.
// ----------------------------------------
if (!gladLoadGLLoader((GLADloadproc) glfwGetProcAddress)) {
std::cout << "Failed to initialize GLAD" << std::endl;
return -1;
}
// build and compile our shader program.
// ------------------------------------
// vertex shader.
int vertexShader = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(vertexShader, 1, &vertexShaderSource, NULL);
glCompileShader(vertexShader);
// check for shader compile errors.
int success;
char infoLog[512];
glGetShaderiv(vertexShader, GL_COMPILE_STATUS, &success);
if (!success) {
glGetShaderInfoLog(vertexShader, 512, NULL, infoLog);
std::cout << "ERROR::SHADER::VERTEX::COMPILATION_FAILED\n" << infoLog << std::endl;
}
// fragment shader.
int fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(fragmentShader, 1, &fragmentShaderSource, NULL);
glCompileShader(fragmentShader);
glGetShaderiv(fragmentShader, GL_COMPILE_STATUS, &success);
if (!success) {
glGetShaderInfoLog(fragmentShader, 512, NULL, infoLog);
std::cout << "ERROR::SHADER::FRAGMENT::COMPILATION_FAILED\n" << infoLog << std::endl;
}
// link shaders.
int shaderProgram = glCreateProgram();
glAttachShader(shaderProgram, vertexShader);
glAttachShader(shaderProgram, fragmentShader);
glLinkProgram(shaderProgram);
// check for linking errors.
glGetProgramiv(shaderProgram, GL_LINK_STATUS, &success);
if (!success) {
glGetProgramInfoLog(shaderProgram, 512, NULL, infoLog);
std::cout << "ERROR::SHADER::PROGRAM::LINKING_FAILED\n" << infoLog << std::endl;
}
glDeleteShader(vertexShader);
glDeleteShader(fragmentShader);
// set up vertex data (and buffer(s)) and configure vertex attributes.
// ------------------------------------------------------------------
// add a new set of vertices to form a second triangle (a total of 6 vertices);
// the vertex attribute configuration remains the same(still one 3-float position vector per vertex)
float vertices[] = {
// first triangle.
-0.9f, -0.5f, 0.0f, // left
-0.0f, -0.5f, 0.0f, // right
-0.45f, 0.5f, 0.0f, // top.
// second triangle.
0.0f, -0.5f, 0.0f, // left
0.9f, -0.5f, 0.0f, // right
0.45f, 0.5f, 0.0f // top.
};
unsigned int VBO, VAO;
glGenVertexArrays(1, &VAO);
glGenBuffers(1, &VBO);
glBindVertexArray(VAO);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0);
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindVertexArray(0);
while(!glfwWindowShouldClose(window)){
// input
// ----
processInput(window);
// render
// -----
glClearColor(0.2, 0.3f, 0.3f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
// draw our first triangle.
glUseProgram(shaderProgram);
glBindVertexArray(VAO);
glDrawArrays(GL_TRIANGLES, 0, 6);
glfwSwapBuffers(window);
glfwPollEvents();
}
glDeleteVertexArrays(1, &VAO);
glDeleteBuffers(1, &VBO);
glDeleteProgram(shaderProgram);
glfwTerminate();
return 0;
}
void processInput(GLFWwindow *window)
{
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
glfwSetWindowShouldClose(window, true);
}
// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
glViewport(0, 0, width, height);
} | [
"[email protected]"
] | |
629a246ef527609c332d4ead7ce870e83e8b14e0 | b354c213be98e6cc8b06b26e30627e6a113919f7 | /Classes/StartGameScene.cpp | 12f14b990a5250292df57e4b90dcb106cf32ab3d | [] | no_license | dingxuejia/npmgame | ee5f7df33c0ab559bdfc68c57c3571ec8ced7e91 | bbd11fbe993e3c6dc86481ae5617986aeb7f678a | refs/heads/master | 2021-06-21T23:59:26.472889 | 2016-11-21T08:32:43 | 2016-11-21T08:32:43 | 32,839,723 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,024 | cpp | //
// StartGameScene.cpp
// pmgame
//
// Created by 丁学佳 on 15/3/13.
//
//
#include "StartGameScene.h"
#include "uiTools.h"
USING_NS_CC;
Scene* StartGameScene::createScene()
{
auto scene = Scene::create();
auto layer =StartGameScene::create();
scene->addChild(layer);
return scene;
}
bool StartGameScene::init()
{
Size visibleSize = Director::getInstance()->getVisibleSize();
auto btnMenuItm = MenuItemFont::create("开始");
btnMenuItm->setPosition(Vec2(50,50));
btnMenuItm->setCallback(CC_CALLBACK_1(StartGameScene::startBtnCallback,this));
auto menuItemEnd = MenuItemFont::create("结束");
menuItemEnd->setPosition(Vec2(visibleSize.width-50,50));
menuItemEnd->setCallback([](Ref* pSender){Director::getInstance()->end();});
auto btnMenu = Menu::create(btnMenuItm, menuItemEnd,NULL);
btnMenu->setPosition(0,0);
this->addChild(btnMenu);
return true;
}
void StartGameScene::startBtnCallback(Ref* pSender)
{
Director::getInstance()->end();
} | [
"[email protected]"
] | |
b76b3925731b0c999d1d4419d5ad13043d809bc2 | b00c54389a95d81a22e361fa9f8bdf5a2edc93e3 | /frameworks/native/services/inputflinger/InputReader.h | c5896d4591d4d8e040ae170274228ebd28ec1ae4 | [
"LicenseRef-scancode-unicode",
"Apache-2.0"
] | permissive | mirek190/x86-android-5.0 | 9d1756fa7ff2f423887aa22694bd737eb634ef23 | eb1029956682072bb7404192a80214189f0dc73b | refs/heads/master | 2020-05-27T01:09:51.830208 | 2015-10-07T22:47:36 | 2015-10-07T22:47:36 | 41,942,802 | 15 | 20 | null | 2020-03-09T00:21:03 | 2015-09-05T00:11:19 | null | UTF-8 | C++ | false | false | 62,392 | h | /*
* Copyright (C) 2010 The Android Open Source Project
*
* 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 _UI_INPUT_READER_H
#define _UI_INPUT_READER_H
#include "EventHub.h"
#include "PointerControllerInterface.h"
#include "InputListener.h"
#include <input/Input.h>
#include <input/VelocityControl.h>
#include <input/VelocityTracker.h>
#include <ui/DisplayInfo.h>
#include <utils/KeyedVector.h>
#include <utils/threads.h>
#include <utils/Timers.h>
#include <utils/RefBase.h>
#include <utils/String8.h>
#include <utils/BitSet.h>
#include <stddef.h>
#include <unistd.h>
// Maximum supported size of a vibration pattern.
// Must be at least 2.
#define MAX_VIBRATE_PATTERN_SIZE 100
// Maximum allowable delay value in a vibration pattern before
// which the delay will be truncated.
#define MAX_VIBRATE_PATTERN_DELAY_NSECS (1000000 * 1000000000LL)
namespace android {
class InputDevice;
class InputMapper;
/*
* Describes how coordinates are mapped on a physical display.
* See com.android.server.display.DisplayViewport.
*/
struct DisplayViewport {
int32_t displayId; // -1 if invalid
int32_t orientation;
int32_t logicalLeft;
int32_t logicalTop;
int32_t logicalRight;
int32_t logicalBottom;
int32_t physicalLeft;
int32_t physicalTop;
int32_t physicalRight;
int32_t physicalBottom;
int32_t deviceWidth;
int32_t deviceHeight;
DisplayViewport() :
displayId(ADISPLAY_ID_NONE), orientation(DISPLAY_ORIENTATION_0),
logicalLeft(0), logicalTop(0), logicalRight(0), logicalBottom(0),
physicalLeft(0), physicalTop(0), physicalRight(0), physicalBottom(0),
deviceWidth(0), deviceHeight(0) {
}
bool operator==(const DisplayViewport& other) const {
return displayId == other.displayId
&& orientation == other.orientation
&& logicalLeft == other.logicalLeft
&& logicalTop == other.logicalTop
&& logicalRight == other.logicalRight
&& logicalBottom == other.logicalBottom
&& physicalLeft == other.physicalLeft
&& physicalTop == other.physicalTop
&& physicalRight == other.physicalRight
&& physicalBottom == other.physicalBottom
&& deviceWidth == other.deviceWidth
&& deviceHeight == other.deviceHeight;
}
bool operator!=(const DisplayViewport& other) const {
return !(*this == other);
}
inline bool isValid() const {
return displayId >= 0;
}
void setNonDisplayViewport(int32_t width, int32_t height) {
displayId = ADISPLAY_ID_NONE;
orientation = DISPLAY_ORIENTATION_0;
logicalLeft = 0;
logicalTop = 0;
logicalRight = width;
logicalBottom = height;
physicalLeft = 0;
physicalTop = 0;
physicalRight = width;
physicalBottom = height;
deviceWidth = width;
deviceHeight = height;
}
};
/*
* Input reader configuration.
*
* Specifies various options that modify the behavior of the input reader.
*/
struct InputReaderConfiguration {
// Describes changes that have occurred.
enum {
// The pointer speed changed.
CHANGE_POINTER_SPEED = 1 << 0,
// The pointer gesture control changed.
CHANGE_POINTER_GESTURE_ENABLEMENT = 1 << 1,
// The display size or orientation changed.
CHANGE_DISPLAY_INFO = 1 << 2,
// The visible touches option changed.
CHANGE_SHOW_TOUCHES = 1 << 3,
// The keyboard layouts must be reloaded.
CHANGE_KEYBOARD_LAYOUTS = 1 << 4,
// The device name alias supplied by the may have changed for some devices.
CHANGE_DEVICE_ALIAS = 1 << 5,
// The location calibration matrix changed.
TOUCH_AFFINE_TRANSFORMATION = 1 << 6,
// All devices must be reopened.
CHANGE_MUST_REOPEN = 1 << 31,
};
// Gets the amount of time to disable virtual keys after the screen is touched
// in order to filter out accidental virtual key presses due to swiping gestures
// or taps near the edge of the display. May be 0 to disable the feature.
nsecs_t virtualKeyQuietTime;
// The excluded device names for the platform.
// Devices with these names will be ignored.
Vector<String8> excludedDeviceNames;
// Velocity control parameters for mouse pointer movements.
VelocityControlParameters pointerVelocityControlParameters;
// Velocity control parameters for mouse wheel movements.
VelocityControlParameters wheelVelocityControlParameters;
// True if pointer gestures are enabled.
bool pointerGesturesEnabled;
// Quiet time between certain pointer gesture transitions.
// Time to allow for all fingers or buttons to settle into a stable state before
// starting a new gesture.
nsecs_t pointerGestureQuietInterval;
// The minimum speed that a pointer must travel for us to consider switching the active
// touch pointer to it during a drag. This threshold is set to avoid switching due
// to noise from a finger resting on the touch pad (perhaps just pressing it down).
float pointerGestureDragMinSwitchSpeed; // in pixels per second
// Tap gesture delay time.
// The time between down and up must be less than this to be considered a tap.
nsecs_t pointerGestureTapInterval;
// Tap drag gesture delay time.
// The time between the previous tap's up and the next down must be less than
// this to be considered a drag. Otherwise, the previous tap is finished and a
// new tap begins.
//
// Note that the previous tap will be held down for this entire duration so this
// interval must be shorter than the long press timeout.
nsecs_t pointerGestureTapDragInterval;
// The distance in pixels that the pointer is allowed to move from initial down
// to up and still be called a tap.
float pointerGestureTapSlop; // in pixels
// Time after the first touch points go down to settle on an initial centroid.
// This is intended to be enough time to handle cases where the user puts down two
// fingers at almost but not quite exactly the same time.
nsecs_t pointerGestureMultitouchSettleInterval;
// The transition from PRESS to SWIPE or FREEFORM gesture mode is made when
// at least two pointers have moved at least this far from their starting place.
float pointerGestureMultitouchMinDistance; // in pixels
// The transition from PRESS to SWIPE gesture mode can only occur when the
// cosine of the angle between the two vectors is greater than or equal to than this value
// which indicates that the vectors are oriented in the same direction.
// When the vectors are oriented in the exactly same direction, the cosine is 1.0.
// (In exactly opposite directions, the cosine is -1.0.)
float pointerGestureSwipeTransitionAngleCosine;
// The transition from PRESS to SWIPE gesture mode can only occur when the
// fingers are no more than this far apart relative to the diagonal size of
// the touch pad. For example, a ratio of 0.5 means that the fingers must be
// no more than half the diagonal size of the touch pad apart.
float pointerGestureSwipeMaxWidthRatio;
// The gesture movement speed factor relative to the size of the display.
// Movement speed applies when the fingers are moving in the same direction.
// Without acceleration, a full swipe of the touch pad diagonal in movement mode
// will cover this portion of the display diagonal.
float pointerGestureMovementSpeedRatio;
// The gesture zoom speed factor relative to the size of the display.
// Zoom speed applies when the fingers are mostly moving relative to each other
// to execute a scale gesture or similar.
// Without acceleration, a full swipe of the touch pad diagonal in zoom mode
// will cover this portion of the display diagonal.
float pointerGestureZoomSpeedRatio;
// True to show the location of touches on the touch screen as spots.
bool showTouches;
InputReaderConfiguration() :
virtualKeyQuietTime(0),
pointerVelocityControlParameters(1.0f, 500.0f, 3000.0f, 3.0f),
wheelVelocityControlParameters(1.0f, 15.0f, 50.0f, 4.0f),
pointerGesturesEnabled(true),
pointerGestureQuietInterval(100 * 1000000LL), // 100 ms
pointerGestureDragMinSwitchSpeed(50), // 50 pixels per second
pointerGestureTapInterval(150 * 1000000LL), // 150 ms
pointerGestureTapDragInterval(150 * 1000000LL), // 150 ms
pointerGestureTapSlop(10.0f), // 10 pixels
pointerGestureMultitouchSettleInterval(100 * 1000000LL), // 100 ms
pointerGestureMultitouchMinDistance(15), // 15 pixels
pointerGestureSwipeTransitionAngleCosine(0.2588f), // cosine of 75 degrees
pointerGestureSwipeMaxWidthRatio(0.25f),
pointerGestureMovementSpeedRatio(0.8f),
pointerGestureZoomSpeedRatio(0.3f),
showTouches(false) { }
bool getDisplayInfo(bool external, DisplayViewport* outViewport) const;
void setDisplayInfo(bool external, const DisplayViewport& viewport);
private:
DisplayViewport mInternalDisplay;
DisplayViewport mExternalDisplay;
};
struct TouchAffineTransformation {
float x_scale;
float x_ymix;
float x_offset;
float y_xmix;
float y_scale;
float y_offset;
TouchAffineTransformation() :
x_scale(1.0f), x_ymix(0.0f), x_offset(0.0f),
y_xmix(0.0f), y_scale(1.0f), y_offset(0.0f) {
}
TouchAffineTransformation(float xscale, float xymix, float xoffset,
float yxmix, float yscale, float yoffset) :
x_scale(xscale), x_ymix(xymix), x_offset(xoffset),
y_xmix(yxmix), y_scale(yscale), y_offset(yoffset) {
}
void applyTo(float& x, float& y) const;
};
/*
* Input reader policy interface.
*
* The input reader policy is used by the input reader to interact with the Window Manager
* and other system components.
*
* The actual implementation is partially supported by callbacks into the DVM
* via JNI. This interface is also mocked in the unit tests.
*
* These methods must NOT re-enter the input reader since they may be called while
* holding the input reader lock.
*/
class InputReaderPolicyInterface : public virtual RefBase {
protected:
InputReaderPolicyInterface() { }
virtual ~InputReaderPolicyInterface() { }
public:
/* Gets the input reader configuration. */
virtual void getReaderConfiguration(InputReaderConfiguration* outConfig) = 0;
/* Gets a pointer controller associated with the specified cursor device (ie. a mouse). */
virtual sp<PointerControllerInterface> obtainPointerController(int32_t deviceId) = 0;
/* Notifies the input reader policy that some input devices have changed
* and provides information about all current input devices.
*/
virtual void notifyInputDevicesChanged(const Vector<InputDeviceInfo>& inputDevices) = 0;
/* Gets the keyboard layout for a particular input device. */
virtual sp<KeyCharacterMap> getKeyboardLayoutOverlay(
const InputDeviceIdentifier& identifier) = 0;
/* Gets a user-supplied alias for a particular input device, or an empty string if none. */
virtual String8 getDeviceAlias(const InputDeviceIdentifier& identifier) = 0;
/* Gets the affine calibration associated with the specified device. */
virtual TouchAffineTransformation getTouchAffineTransformation(
const String8& inputDeviceDescriptor, int32_t surfaceRotation) = 0;
};
/* Processes raw input events and sends cooked event data to an input listener. */
class InputReaderInterface : public virtual RefBase {
protected:
InputReaderInterface() { }
virtual ~InputReaderInterface() { }
public:
/* Dumps the state of the input reader.
*
* This method may be called on any thread (usually by the input manager). */
virtual void dump(String8& dump) = 0;
/* Called by the heatbeat to ensures that the reader has not deadlocked. */
virtual void monitor() = 0;
/* Runs a single iteration of the processing loop.
* Nominally reads and processes one incoming message from the EventHub.
*
* This method should be called on the input reader thread.
*/
virtual void loopOnce() = 0;
/* Gets information about all input devices.
*
* This method may be called on any thread (usually by the input manager).
*/
virtual void getInputDevices(Vector<InputDeviceInfo>& outInputDevices) = 0;
/* Query current input state. */
virtual int32_t getScanCodeState(int32_t deviceId, uint32_t sourceMask,
int32_t scanCode) = 0;
virtual int32_t getKeyCodeState(int32_t deviceId, uint32_t sourceMask,
int32_t keyCode) = 0;
virtual int32_t getSwitchState(int32_t deviceId, uint32_t sourceMask,
int32_t sw) = 0;
/* Determine whether physical keys exist for the given framework-domain key codes. */
virtual bool hasKeys(int32_t deviceId, uint32_t sourceMask,
size_t numCodes, const int32_t* keyCodes, uint8_t* outFlags) = 0;
/* Requests that a reconfiguration of all input devices.
* The changes flag is a bitfield that indicates what has changed and whether
* the input devices must all be reopened. */
virtual void requestRefreshConfiguration(uint32_t changes) = 0;
/* Controls the vibrator of a particular input device. */
virtual void vibrate(int32_t deviceId, const nsecs_t* pattern, size_t patternSize,
ssize_t repeat, int32_t token) = 0;
virtual void cancelVibrate(int32_t deviceId, int32_t token) = 0;
};
/* Internal interface used by individual input devices to access global input device state
* and parameters maintained by the input reader.
*/
class InputReaderContext {
public:
InputReaderContext() { }
virtual ~InputReaderContext() { }
virtual void updateGlobalMetaState() = 0;
virtual int32_t getGlobalMetaState() = 0;
virtual void disableVirtualKeysUntil(nsecs_t time) = 0;
virtual bool shouldDropVirtualKey(nsecs_t now,
InputDevice* device, int32_t keyCode, int32_t scanCode) = 0;
virtual void fadePointer() = 0;
virtual void requestTimeoutAtTime(nsecs_t when) = 0;
virtual int32_t bumpGeneration() = 0;
virtual InputReaderPolicyInterface* getPolicy() = 0;
virtual InputListenerInterface* getListener() = 0;
virtual EventHubInterface* getEventHub() = 0;
};
/* The input reader reads raw event data from the event hub and processes it into input events
* that it sends to the input listener. Some functions of the input reader, such as early
* event filtering in low power states, are controlled by a separate policy object.
*
* The InputReader owns a collection of InputMappers. Most of the work it does happens
* on the input reader thread but the InputReader can receive queries from other system
* components running on arbitrary threads. To keep things manageable, the InputReader
* uses a single Mutex to guard its state. The Mutex may be held while calling into the
* EventHub or the InputReaderPolicy but it is never held while calling into the
* InputListener.
*/
class InputReader : public InputReaderInterface {
public:
InputReader(const sp<EventHubInterface>& eventHub,
const sp<InputReaderPolicyInterface>& policy,
const sp<InputListenerInterface>& listener);
virtual ~InputReader();
virtual void dump(String8& dump);
virtual void monitor();
virtual void loopOnce();
virtual void getInputDevices(Vector<InputDeviceInfo>& outInputDevices);
virtual int32_t getScanCodeState(int32_t deviceId, uint32_t sourceMask,
int32_t scanCode);
virtual int32_t getKeyCodeState(int32_t deviceId, uint32_t sourceMask,
int32_t keyCode);
virtual int32_t getSwitchState(int32_t deviceId, uint32_t sourceMask,
int32_t sw);
virtual bool hasKeys(int32_t deviceId, uint32_t sourceMask,
size_t numCodes, const int32_t* keyCodes, uint8_t* outFlags);
virtual void requestRefreshConfiguration(uint32_t changes);
virtual void vibrate(int32_t deviceId, const nsecs_t* pattern, size_t patternSize,
ssize_t repeat, int32_t token);
virtual void cancelVibrate(int32_t deviceId, int32_t token);
protected:
// These members are protected so they can be instrumented by test cases.
virtual InputDevice* createDeviceLocked(int32_t deviceId, int32_t controllerNumber,
const InputDeviceIdentifier& identifier, uint32_t classes);
class ContextImpl : public InputReaderContext {
InputReader* mReader;
public:
ContextImpl(InputReader* reader);
virtual void updateGlobalMetaState();
virtual int32_t getGlobalMetaState();
virtual void disableVirtualKeysUntil(nsecs_t time);
virtual bool shouldDropVirtualKey(nsecs_t now,
InputDevice* device, int32_t keyCode, int32_t scanCode);
virtual void fadePointer();
virtual void requestTimeoutAtTime(nsecs_t when);
virtual int32_t bumpGeneration();
virtual InputReaderPolicyInterface* getPolicy();
virtual InputListenerInterface* getListener();
virtual EventHubInterface* getEventHub();
} mContext;
friend class ContextImpl;
private:
Mutex mLock;
Condition mReaderIsAliveCondition;
sp<EventHubInterface> mEventHub;
sp<InputReaderPolicyInterface> mPolicy;
sp<QueuedInputListener> mQueuedListener;
InputReaderConfiguration mConfig;
// The event queue.
static const int EVENT_BUFFER_SIZE = 256;
RawEvent mEventBuffer[EVENT_BUFFER_SIZE];
KeyedVector<int32_t, InputDevice*> mDevices;
// low-level input event decoding and device management
void processEventsLocked(const RawEvent* rawEvents, size_t count);
void addDeviceLocked(nsecs_t when, int32_t deviceId);
void removeDeviceLocked(nsecs_t when, int32_t deviceId);
void processEventsForDeviceLocked(int32_t deviceId, const RawEvent* rawEvents, size_t count);
void timeoutExpiredLocked(nsecs_t when);
void handleConfigurationChangedLocked(nsecs_t when);
int32_t mGlobalMetaState;
void updateGlobalMetaStateLocked();
int32_t getGlobalMetaStateLocked();
void fadePointerLocked();
int32_t mGeneration;
int32_t bumpGenerationLocked();
void getInputDevicesLocked(Vector<InputDeviceInfo>& outInputDevices);
nsecs_t mDisableVirtualKeysTimeout;
void disableVirtualKeysUntilLocked(nsecs_t time);
bool shouldDropVirtualKeyLocked(nsecs_t now,
InputDevice* device, int32_t keyCode, int32_t scanCode);
nsecs_t mNextTimeout;
void requestTimeoutAtTimeLocked(nsecs_t when);
uint32_t mConfigurationChangesToRefresh;
void refreshConfigurationLocked(uint32_t changes);
// state queries
typedef int32_t (InputDevice::*GetStateFunc)(uint32_t sourceMask, int32_t code);
int32_t getStateLocked(int32_t deviceId, uint32_t sourceMask, int32_t code,
GetStateFunc getStateFunc);
bool markSupportedKeyCodesLocked(int32_t deviceId, uint32_t sourceMask, size_t numCodes,
const int32_t* keyCodes, uint8_t* outFlags);
};
/* Reads raw events from the event hub and processes them, endlessly. */
class InputReaderThread : public Thread {
public:
InputReaderThread(const sp<InputReaderInterface>& reader);
virtual ~InputReaderThread();
private:
sp<InputReaderInterface> mReader;
virtual bool threadLoop();
};
/* Represents the state of a single input device. */
class InputDevice {
public:
InputDevice(InputReaderContext* context, int32_t id, int32_t generation, int32_t
controllerNumber, const InputDeviceIdentifier& identifier, uint32_t classes);
~InputDevice();
inline InputReaderContext* getContext() { return mContext; }
inline int32_t getId() const { return mId; }
inline int32_t getControllerNumber() const { return mControllerNumber; }
inline int32_t getGeneration() const { return mGeneration; }
inline const String8& getName() const { return mIdentifier.name; }
inline const String8& getDescriptor() { return mIdentifier.descriptor; }
inline uint32_t getClasses() const { return mClasses; }
inline uint32_t getSources() const { return mSources; }
inline bool isExternal() { return mIsExternal; }
inline void setExternal(bool external) { mIsExternal = external; }
inline bool isIgnored() { return mMappers.isEmpty(); }
void dump(String8& dump);
void addMapper(InputMapper* mapper);
void configure(nsecs_t when, const InputReaderConfiguration* config, uint32_t changes);
void reset(nsecs_t when);
void process(const RawEvent* rawEvents, size_t count);
void timeoutExpired(nsecs_t when);
void getDeviceInfo(InputDeviceInfo* outDeviceInfo);
int32_t getKeyCodeState(uint32_t sourceMask, int32_t keyCode);
int32_t getScanCodeState(uint32_t sourceMask, int32_t scanCode);
int32_t getSwitchState(uint32_t sourceMask, int32_t switchCode);
bool markSupportedKeyCodes(uint32_t sourceMask, size_t numCodes,
const int32_t* keyCodes, uint8_t* outFlags);
void vibrate(const nsecs_t* pattern, size_t patternSize, ssize_t repeat, int32_t token);
void cancelVibrate(int32_t token);
int32_t getMetaState();
void fadePointer();
void bumpGeneration();
void notifyReset(nsecs_t when);
inline const PropertyMap& getConfiguration() { return mConfiguration; }
inline EventHubInterface* getEventHub() { return mContext->getEventHub(); }
bool hasKey(int32_t code) {
return getEventHub()->hasScanCode(mId, code);
}
bool hasAbsoluteAxis(int32_t code) {
RawAbsoluteAxisInfo info;
getEventHub()->getAbsoluteAxisInfo(mId, code, &info);
return info.valid;
}
bool isKeyPressed(int32_t code) {
return getEventHub()->getScanCodeState(mId, code) == AKEY_STATE_DOWN;
}
int32_t getAbsoluteAxisValue(int32_t code) {
int32_t value;
getEventHub()->getAbsoluteAxisValue(mId, code, &value);
return value;
}
private:
InputReaderContext* mContext;
int32_t mId;
int32_t mGeneration;
int32_t mControllerNumber;
InputDeviceIdentifier mIdentifier;
String8 mAlias;
uint32_t mClasses;
Vector<InputMapper*> mMappers;
uint32_t mSources;
bool mIsExternal;
bool mDropUntilNextSync;
typedef int32_t (InputMapper::*GetStateFunc)(uint32_t sourceMask, int32_t code);
int32_t getState(uint32_t sourceMask, int32_t code, GetStateFunc getStateFunc);
PropertyMap mConfiguration;
};
/* Keeps track of the state of mouse or touch pad buttons. */
class CursorButtonAccumulator {
public:
CursorButtonAccumulator();
void reset(InputDevice* device);
void process(const RawEvent* rawEvent);
uint32_t getButtonState() const;
private:
bool mBtnLeft;
bool mBtnRight;
bool mBtnMiddle;
bool mBtnBack;
bool mBtnSide;
bool mBtnForward;
bool mBtnExtra;
bool mBtnTask;
void clearButtons();
};
/* Keeps track of cursor movements. */
class CursorMotionAccumulator {
public:
CursorMotionAccumulator();
void reset(InputDevice* device);
void process(const RawEvent* rawEvent);
void finishSync();
inline int32_t getRelativeX() const { return mRelX; }
inline int32_t getRelativeY() const { return mRelY; }
private:
int32_t mRelX;
int32_t mRelY;
void clearRelativeAxes();
};
/* Keeps track of cursor scrolling motions. */
class CursorScrollAccumulator {
public:
CursorScrollAccumulator();
void configure(InputDevice* device);
void reset(InputDevice* device);
void process(const RawEvent* rawEvent);
void finishSync();
inline bool haveRelativeVWheel() const { return mHaveRelWheel; }
inline bool haveRelativeHWheel() const { return mHaveRelHWheel; }
inline int32_t getRelativeX() const { return mRelX; }
inline int32_t getRelativeY() const { return mRelY; }
inline int32_t getRelativeVWheel() const { return mRelWheel; }
inline int32_t getRelativeHWheel() const { return mRelHWheel; }
private:
bool mHaveRelWheel;
bool mHaveRelHWheel;
int32_t mRelX;
int32_t mRelY;
int32_t mRelWheel;
int32_t mRelHWheel;
void clearRelativeAxes();
};
/* Keeps track of the state of touch, stylus and tool buttons. */
class TouchButtonAccumulator {
public:
TouchButtonAccumulator();
void configure(InputDevice* device);
void reset(InputDevice* device);
void process(const RawEvent* rawEvent);
uint32_t getButtonState() const;
int32_t getToolType() const;
bool isToolActive() const;
bool isHovering() const;
bool hasStylus() const;
private:
bool mHaveBtnTouch;
bool mHaveStylus;
bool mBtnTouch;
bool mBtnStylus;
bool mBtnStylus2;
bool mBtnToolFinger;
bool mBtnToolPen;
bool mBtnToolRubber;
bool mBtnToolBrush;
bool mBtnToolPencil;
bool mBtnToolAirbrush;
bool mBtnToolMouse;
bool mBtnToolLens;
bool mBtnToolDoubleTap;
bool mBtnToolTripleTap;
bool mBtnToolQuadTap;
void clearButtons();
};
/* Raw axis information from the driver. */
struct RawPointerAxes {
RawAbsoluteAxisInfo x;
RawAbsoluteAxisInfo y;
RawAbsoluteAxisInfo pressure;
RawAbsoluteAxisInfo touchMajor;
RawAbsoluteAxisInfo touchMinor;
RawAbsoluteAxisInfo toolMajor;
RawAbsoluteAxisInfo toolMinor;
RawAbsoluteAxisInfo orientation;
RawAbsoluteAxisInfo distance;
RawAbsoluteAxisInfo tiltX;
RawAbsoluteAxisInfo tiltY;
RawAbsoluteAxisInfo trackingId;
RawAbsoluteAxisInfo slot;
RawPointerAxes();
void clear();
};
/* Raw data for a collection of pointers including a pointer id mapping table. */
struct RawPointerData {
struct Pointer {
uint32_t id;
int32_t x;
int32_t y;
int32_t pressure;
int32_t touchMajor;
int32_t touchMinor;
int32_t toolMajor;
int32_t toolMinor;
int32_t orientation;
int32_t distance;
int32_t tiltX;
int32_t tiltY;
int32_t toolType; // a fully decoded AMOTION_EVENT_TOOL_TYPE constant
bool isHovering;
};
uint32_t pointerCount;
Pointer pointers[MAX_POINTERS];
BitSet32 hoveringIdBits, touchingIdBits;
uint32_t idToIndex[MAX_POINTER_ID + 1];
RawPointerData();
void clear();
void copyFrom(const RawPointerData& other);
void getCentroidOfTouchingPointers(float* outX, float* outY) const;
inline void markIdBit(uint32_t id, bool isHovering) {
if (isHovering) {
hoveringIdBits.markBit(id);
} else {
touchingIdBits.markBit(id);
}
}
inline void clearIdBits() {
hoveringIdBits.clear();
touchingIdBits.clear();
}
inline const Pointer& pointerForId(uint32_t id) const {
return pointers[idToIndex[id]];
}
inline bool isHovering(uint32_t pointerIndex) {
return pointers[pointerIndex].isHovering;
}
};
/* Cooked data for a collection of pointers including a pointer id mapping table. */
struct CookedPointerData {
uint32_t pointerCount;
PointerProperties pointerProperties[MAX_POINTERS];
PointerCoords pointerCoords[MAX_POINTERS];
BitSet32 hoveringIdBits, touchingIdBits;
uint32_t idToIndex[MAX_POINTER_ID + 1];
CookedPointerData();
void clear();
void copyFrom(const CookedPointerData& other);
inline const PointerCoords& pointerCoordsForId(uint32_t id) const {
return pointerCoords[idToIndex[id]];
}
inline bool isHovering(uint32_t pointerIndex) {
return hoveringIdBits.hasBit(pointerProperties[pointerIndex].id);
}
};
/* Keeps track of the state of single-touch protocol. */
class SingleTouchMotionAccumulator {
public:
SingleTouchMotionAccumulator();
void process(const RawEvent* rawEvent);
void reset(InputDevice* device);
inline int32_t getAbsoluteX() const { return mAbsX; }
inline int32_t getAbsoluteY() const { return mAbsY; }
inline int32_t getAbsolutePressure() const { return mAbsPressure; }
inline int32_t getAbsoluteToolWidth() const { return mAbsToolWidth; }
inline int32_t getAbsoluteDistance() const { return mAbsDistance; }
inline int32_t getAbsoluteTiltX() const { return mAbsTiltX; }
inline int32_t getAbsoluteTiltY() const { return mAbsTiltY; }
private:
int32_t mAbsX;
int32_t mAbsY;
int32_t mAbsPressure;
int32_t mAbsToolWidth;
int32_t mAbsDistance;
int32_t mAbsTiltX;
int32_t mAbsTiltY;
void clearAbsoluteAxes();
};
/* Keeps track of the state of multi-touch protocol. */
class MultiTouchMotionAccumulator {
public:
class Slot {
public:
inline bool isInUse() const { return mInUse; }
inline int32_t getX() const { return mAbsMTPositionX; }
inline int32_t getY() const { return mAbsMTPositionY; }
inline int32_t getTouchMajor() const { return mAbsMTTouchMajor; }
inline int32_t getTouchMinor() const {
return mHaveAbsMTTouchMinor ? mAbsMTTouchMinor : mAbsMTTouchMajor; }
inline int32_t getToolMajor() const { return mAbsMTWidthMajor; }
inline int32_t getToolMinor() const {
return mHaveAbsMTWidthMinor ? mAbsMTWidthMinor : mAbsMTWidthMajor; }
inline int32_t getOrientation() const { return mAbsMTOrientation; }
inline int32_t getTrackingId() const { return mAbsMTTrackingId; }
inline int32_t getPressure() const { return mAbsMTPressure; }
inline int32_t getDistance() const { return mAbsMTDistance; }
inline int32_t getToolType() const;
private:
friend class MultiTouchMotionAccumulator;
bool mInUse;
bool mHaveAbsMTTouchMinor;
bool mHaveAbsMTWidthMinor;
bool mHaveAbsMTToolType;
int32_t mAbsMTPositionX;
int32_t mAbsMTPositionY;
int32_t mAbsMTTouchMajor;
int32_t mAbsMTTouchMinor;
int32_t mAbsMTWidthMajor;
int32_t mAbsMTWidthMinor;
int32_t mAbsMTOrientation;
int32_t mAbsMTTrackingId;
int32_t mAbsMTPressure;
int32_t mAbsMTDistance;
int32_t mAbsMTToolType;
Slot();
void clear();
};
MultiTouchMotionAccumulator();
~MultiTouchMotionAccumulator();
void configure(InputDevice* device, size_t slotCount, bool usingSlotsProtocol);
void reset(InputDevice* device);
void process(const RawEvent* rawEvent);
void finishSync();
bool hasStylus() const;
inline size_t getSlotCount() const { return mSlotCount; }
inline const Slot* getSlot(size_t index) const { return &mSlots[index]; }
private:
int32_t mCurrentSlot;
Slot* mSlots;
size_t mSlotCount;
bool mUsingSlotsProtocol;
bool mHaveStylus;
void clearSlots(int32_t initialSlot);
};
/* An input mapper transforms raw input events into cooked event data.
* A single input device can have multiple associated input mappers in order to interpret
* different classes of events.
*
* InputMapper lifecycle:
* - create
* - configure with 0 changes
* - reset
* - process, process, process (may occasionally reconfigure with non-zero changes or reset)
* - reset
* - destroy
*/
class InputMapper {
public:
InputMapper(InputDevice* device);
virtual ~InputMapper();
inline InputDevice* getDevice() { return mDevice; }
inline int32_t getDeviceId() { return mDevice->getId(); }
inline const String8 getDeviceName() { return mDevice->getName(); }
inline InputReaderContext* getContext() { return mContext; }
inline InputReaderPolicyInterface* getPolicy() { return mContext->getPolicy(); }
inline InputListenerInterface* getListener() { return mContext->getListener(); }
inline EventHubInterface* getEventHub() { return mContext->getEventHub(); }
virtual uint32_t getSources() = 0;
virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
virtual void dump(String8& dump);
virtual void configure(nsecs_t when, const InputReaderConfiguration* config, uint32_t changes);
virtual void reset(nsecs_t when);
virtual void process(const RawEvent* rawEvent) = 0;
virtual void timeoutExpired(nsecs_t when);
virtual int32_t getKeyCodeState(uint32_t sourceMask, int32_t keyCode);
virtual int32_t getScanCodeState(uint32_t sourceMask, int32_t scanCode);
virtual int32_t getSwitchState(uint32_t sourceMask, int32_t switchCode);
virtual bool markSupportedKeyCodes(uint32_t sourceMask, size_t numCodes,
const int32_t* keyCodes, uint8_t* outFlags);
virtual void vibrate(const nsecs_t* pattern, size_t patternSize, ssize_t repeat,
int32_t token);
virtual void cancelVibrate(int32_t token);
virtual int32_t getMetaState();
virtual void fadePointer();
protected:
InputDevice* mDevice;
InputReaderContext* mContext;
status_t getAbsoluteAxisInfo(int32_t axis, RawAbsoluteAxisInfo* axisInfo);
void bumpGeneration();
static void dumpRawAbsoluteAxisInfo(String8& dump,
const RawAbsoluteAxisInfo& axis, const char* name);
};
class SwitchInputMapper : public InputMapper {
public:
SwitchInputMapper(InputDevice* device);
virtual ~SwitchInputMapper();
virtual uint32_t getSources();
virtual void process(const RawEvent* rawEvent);
virtual int32_t getSwitchState(uint32_t sourceMask, int32_t switchCode);
virtual void dump(String8& dump);
private:
uint32_t mSwitchValues;
uint32_t mUpdatedSwitchMask;
void processSwitch(int32_t switchCode, int32_t switchValue);
void sync(nsecs_t when);
};
class VibratorInputMapper : public InputMapper {
public:
VibratorInputMapper(InputDevice* device);
virtual ~VibratorInputMapper();
virtual uint32_t getSources();
virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
virtual void process(const RawEvent* rawEvent);
virtual void vibrate(const nsecs_t* pattern, size_t patternSize, ssize_t repeat,
int32_t token);
virtual void cancelVibrate(int32_t token);
virtual void timeoutExpired(nsecs_t when);
virtual void dump(String8& dump);
private:
bool mVibrating;
nsecs_t mPattern[MAX_VIBRATE_PATTERN_SIZE];
size_t mPatternSize;
ssize_t mRepeat;
int32_t mToken;
ssize_t mIndex;
nsecs_t mNextStepTime;
void nextStep();
void stopVibrating();
};
class KeyboardInputMapper : public InputMapper {
public:
KeyboardInputMapper(InputDevice* device, uint32_t source, int32_t keyboardType);
virtual ~KeyboardInputMapper();
virtual uint32_t getSources();
virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
virtual void dump(String8& dump);
virtual void configure(nsecs_t when, const InputReaderConfiguration* config, uint32_t changes);
virtual void reset(nsecs_t when);
virtual void process(const RawEvent* rawEvent);
virtual int32_t getKeyCodeState(uint32_t sourceMask, int32_t keyCode);
virtual int32_t getScanCodeState(uint32_t sourceMask, int32_t scanCode);
virtual bool markSupportedKeyCodes(uint32_t sourceMask, size_t numCodes,
const int32_t* keyCodes, uint8_t* outFlags);
virtual int32_t getMetaState();
private:
struct KeyDown {
int32_t keyCode;
int32_t scanCode;
};
uint32_t mSource;
int32_t mKeyboardType;
int32_t mOrientation; // orientation for dpad keys
Vector<KeyDown> mKeyDowns; // keys that are down
int32_t mMetaState;
nsecs_t mDownTime; // time of most recent key down
int32_t mCurrentHidUsage; // most recent HID usage seen this packet, or 0 if none
struct LedState {
bool avail; // led is available
bool on; // we think the led is currently on
};
LedState mCapsLockLedState;
LedState mNumLockLedState;
LedState mScrollLockLedState;
// Immutable configuration parameters.
struct Parameters {
bool hasAssociatedDisplay;
bool orientationAware;
bool handlesKeyRepeat;
} mParameters;
void configureParameters();
void dumpParameters(String8& dump);
bool isKeyboardOrGamepadKey(int32_t scanCode);
void processKey(nsecs_t when, bool down, int32_t keyCode, int32_t scanCode,
uint32_t policyFlags);
ssize_t findKeyDown(int32_t scanCode);
void resetLedState();
void initializeLedState(LedState& ledState, int32_t led);
void updateLedState(bool reset);
void updateLedStateForModifier(LedState& ledState, int32_t led,
int32_t modifier, bool reset);
};
class CursorInputMapper : public InputMapper {
public:
CursorInputMapper(InputDevice* device);
virtual ~CursorInputMapper();
virtual uint32_t getSources();
virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
virtual void dump(String8& dump);
virtual void configure(nsecs_t when, const InputReaderConfiguration* config, uint32_t changes);
virtual void reset(nsecs_t when);
virtual void process(const RawEvent* rawEvent);
virtual int32_t getScanCodeState(uint32_t sourceMask, int32_t scanCode);
virtual void fadePointer();
private:
// Amount that trackball needs to move in order to generate a key event.
static const int32_t TRACKBALL_MOVEMENT_THRESHOLD = 6;
// Immutable configuration parameters.
struct Parameters {
enum Mode {
MODE_POINTER,
MODE_NAVIGATION,
};
Mode mode;
bool hasAssociatedDisplay;
bool orientationAware;
} mParameters;
CursorButtonAccumulator mCursorButtonAccumulator;
CursorMotionAccumulator mCursorMotionAccumulator;
CursorScrollAccumulator mCursorScrollAccumulator;
int32_t mSource;
float mXScale;
float mYScale;
float mXPrecision;
float mYPrecision;
float mVWheelScale;
float mHWheelScale;
// Velocity controls for mouse pointer and wheel movements.
// The controls for X and Y wheel movements are separate to keep them decoupled.
VelocityControl mPointerVelocityControl;
VelocityControl mWheelXVelocityControl;
VelocityControl mWheelYVelocityControl;
int32_t mOrientation;
sp<PointerControllerInterface> mPointerController;
int32_t mButtonState;
nsecs_t mDownTime;
void configureParameters();
void dumpParameters(String8& dump);
void sync(nsecs_t when);
};
class TouchInputMapper : public InputMapper {
public:
TouchInputMapper(InputDevice* device);
virtual ~TouchInputMapper();
virtual uint32_t getSources();
virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
virtual void dump(String8& dump);
virtual void configure(nsecs_t when, const InputReaderConfiguration* config, uint32_t changes);
virtual void reset(nsecs_t when);
virtual void process(const RawEvent* rawEvent);
virtual int32_t getKeyCodeState(uint32_t sourceMask, int32_t keyCode);
virtual int32_t getScanCodeState(uint32_t sourceMask, int32_t scanCode);
virtual bool markSupportedKeyCodes(uint32_t sourceMask, size_t numCodes,
const int32_t* keyCodes, uint8_t* outFlags);
virtual void fadePointer();
virtual void timeoutExpired(nsecs_t when);
protected:
CursorButtonAccumulator mCursorButtonAccumulator;
CursorScrollAccumulator mCursorScrollAccumulator;
TouchButtonAccumulator mTouchButtonAccumulator;
struct VirtualKey {
int32_t keyCode;
int32_t scanCode;
uint32_t flags;
// computed hit box, specified in touch screen coords based on known display size
int32_t hitLeft;
int32_t hitTop;
int32_t hitRight;
int32_t hitBottom;
inline bool isHit(int32_t x, int32_t y) const {
return x >= hitLeft && x <= hitRight && y >= hitTop && y <= hitBottom;
}
};
// Input sources and device mode.
uint32_t mSource;
enum DeviceMode {
DEVICE_MODE_DISABLED, // input is disabled
DEVICE_MODE_DIRECT, // direct mapping (touchscreen)
DEVICE_MODE_UNSCALED, // unscaled mapping (touchpad)
DEVICE_MODE_NAVIGATION, // unscaled mapping with assist gesture (touch navigation)
DEVICE_MODE_POINTER, // pointer mapping (pointer)
};
DeviceMode mDeviceMode;
// The reader's configuration.
InputReaderConfiguration mConfig;
// Immutable configuration parameters.
struct Parameters {
enum DeviceType {
DEVICE_TYPE_TOUCH_SCREEN,
DEVICE_TYPE_TOUCH_PAD,
DEVICE_TYPE_TOUCH_NAVIGATION,
DEVICE_TYPE_POINTER,
};
DeviceType deviceType;
bool hasAssociatedDisplay;
bool associatedDisplayIsExternal;
bool orientationAware;
bool hasButtonUnderPad;
enum GestureMode {
GESTURE_MODE_POINTER,
GESTURE_MODE_SPOTS,
};
GestureMode gestureMode;
bool wake;
} mParameters;
// Immutable calibration parameters in parsed form.
struct Calibration {
// Size
enum SizeCalibration {
SIZE_CALIBRATION_DEFAULT,
SIZE_CALIBRATION_NONE,
SIZE_CALIBRATION_GEOMETRIC,
SIZE_CALIBRATION_DIAMETER,
SIZE_CALIBRATION_BOX,
SIZE_CALIBRATION_AREA,
};
SizeCalibration sizeCalibration;
bool haveSizeScale;
float sizeScale;
bool haveSizeBias;
float sizeBias;
bool haveSizeIsSummed;
bool sizeIsSummed;
// Pressure
enum PressureCalibration {
PRESSURE_CALIBRATION_DEFAULT,
PRESSURE_CALIBRATION_NONE,
PRESSURE_CALIBRATION_PHYSICAL,
PRESSURE_CALIBRATION_AMPLITUDE,
};
PressureCalibration pressureCalibration;
bool havePressureScale;
float pressureScale;
// Orientation
enum OrientationCalibration {
ORIENTATION_CALIBRATION_DEFAULT,
ORIENTATION_CALIBRATION_NONE,
ORIENTATION_CALIBRATION_INTERPOLATED,
ORIENTATION_CALIBRATION_VECTOR,
};
OrientationCalibration orientationCalibration;
// Distance
enum DistanceCalibration {
DISTANCE_CALIBRATION_DEFAULT,
DISTANCE_CALIBRATION_NONE,
DISTANCE_CALIBRATION_SCALED,
};
DistanceCalibration distanceCalibration;
bool haveDistanceScale;
float distanceScale;
enum CoverageCalibration {
COVERAGE_CALIBRATION_DEFAULT,
COVERAGE_CALIBRATION_NONE,
COVERAGE_CALIBRATION_BOX,
};
CoverageCalibration coverageCalibration;
inline void applySizeScaleAndBias(float* outSize) const {
if (haveSizeScale) {
*outSize *= sizeScale;
}
if (haveSizeBias) {
*outSize += sizeBias;
}
if (*outSize < 0) {
*outSize = 0;
}
}
} mCalibration;
// Affine location transformation/calibration
struct TouchAffineTransformation mAffineTransform;
// Raw pointer axis information from the driver.
RawPointerAxes mRawPointerAxes;
// Raw pointer sample data.
RawPointerData mCurrentRawPointerData;
RawPointerData mLastRawPointerData;
// Cooked pointer sample data.
CookedPointerData mCurrentCookedPointerData;
CookedPointerData mLastCookedPointerData;
// Button state.
int32_t mCurrentButtonState;
int32_t mLastButtonState;
// Scroll state.
int32_t mCurrentRawVScroll;
int32_t mCurrentRawHScroll;
// Id bits used to differentiate fingers, stylus and mouse tools.
BitSet32 mCurrentFingerIdBits; // finger or unknown
BitSet32 mLastFingerIdBits;
BitSet32 mCurrentStylusIdBits; // stylus or eraser
BitSet32 mLastStylusIdBits;
BitSet32 mCurrentMouseIdBits; // mouse or lens
BitSet32 mLastMouseIdBits;
// True if we sent a HOVER_ENTER event.
bool mSentHoverEnter;
// The time the primary pointer last went down.
nsecs_t mDownTime;
// The pointer controller, or null if the device is not a pointer.
sp<PointerControllerInterface> mPointerController;
Vector<VirtualKey> mVirtualKeys;
virtual void configureParameters();
virtual void dumpParameters(String8& dump);
virtual void configureRawPointerAxes();
virtual void dumpRawPointerAxes(String8& dump);
virtual void configureSurface(nsecs_t when, bool* outResetNeeded);
virtual void dumpSurface(String8& dump);
virtual void configureVirtualKeys();
virtual void dumpVirtualKeys(String8& dump);
virtual void parseCalibration();
virtual void resolveCalibration();
virtual void dumpCalibration(String8& dump);
virtual void dumpAffineTransformation(String8& dump);
virtual bool hasStylus() const = 0;
virtual void updateAffineTransformation();
virtual void syncTouch(nsecs_t when, bool* outHavePointerIds) = 0;
private:
// The current viewport.
// The components of the viewport are specified in the display's rotated orientation.
DisplayViewport mViewport;
// The surface orientation, width and height set by configureSurface().
// The width and height are derived from the viewport but are specified
// in the natural orientation.
// The surface origin specifies how the surface coordinates should be translated
// to align with the logical display coordinate space.
// The orientation may be different from the viewport orientation as it specifies
// the rotation of the surface coordinates required to produce the viewport's
// requested orientation, so it will depend on whether the device is orientation aware.
int32_t mSurfaceWidth;
int32_t mSurfaceHeight;
int32_t mSurfaceLeft;
int32_t mSurfaceTop;
int32_t mSurfaceOrientation;
// Translation and scaling factors, orientation-independent.
float mXTranslate;
float mXScale;
float mXPrecision;
float mYTranslate;
float mYScale;
float mYPrecision;
float mGeometricScale;
float mPressureScale;
float mSizeScale;
float mOrientationScale;
float mDistanceScale;
bool mHaveTilt;
float mTiltXCenter;
float mTiltXScale;
float mTiltYCenter;
float mTiltYScale;
// Oriented motion ranges for input device info.
struct OrientedRanges {
InputDeviceInfo::MotionRange x;
InputDeviceInfo::MotionRange y;
InputDeviceInfo::MotionRange pressure;
bool haveSize;
InputDeviceInfo::MotionRange size;
bool haveTouchSize;
InputDeviceInfo::MotionRange touchMajor;
InputDeviceInfo::MotionRange touchMinor;
bool haveToolSize;
InputDeviceInfo::MotionRange toolMajor;
InputDeviceInfo::MotionRange toolMinor;
bool haveOrientation;
InputDeviceInfo::MotionRange orientation;
bool haveDistance;
InputDeviceInfo::MotionRange distance;
bool haveTilt;
InputDeviceInfo::MotionRange tilt;
OrientedRanges() {
clear();
}
void clear() {
haveSize = false;
haveTouchSize = false;
haveToolSize = false;
haveOrientation = false;
haveDistance = false;
haveTilt = false;
}
} mOrientedRanges;
// Oriented dimensions and precision.
float mOrientedXPrecision;
float mOrientedYPrecision;
struct CurrentVirtualKeyState {
bool down;
bool ignored;
nsecs_t downTime;
int32_t keyCode;
int32_t scanCode;
} mCurrentVirtualKey;
// Scale factor for gesture or mouse based pointer movements.
float mPointerXMovementScale;
float mPointerYMovementScale;
// Scale factor for gesture based zooming and other freeform motions.
float mPointerXZoomScale;
float mPointerYZoomScale;
// The maximum swipe width.
float mPointerGestureMaxSwipeWidth;
struct PointerDistanceHeapElement {
uint32_t currentPointerIndex : 8;
uint32_t lastPointerIndex : 8;
uint64_t distance : 48; // squared distance
};
enum PointerUsage {
POINTER_USAGE_NONE,
POINTER_USAGE_GESTURES,
POINTER_USAGE_STYLUS,
POINTER_USAGE_MOUSE,
};
PointerUsage mPointerUsage;
struct PointerGesture {
enum Mode {
// No fingers, button is not pressed.
// Nothing happening.
NEUTRAL,
// No fingers, button is not pressed.
// Tap detected.
// Emits DOWN and UP events at the pointer location.
TAP,
// Exactly one finger dragging following a tap.
// Pointer follows the active finger.
// Emits DOWN, MOVE and UP events at the pointer location.
//
// Detect double-taps when the finger goes up while in TAP_DRAG mode.
TAP_DRAG,
// Button is pressed.
// Pointer follows the active finger if there is one. Other fingers are ignored.
// Emits DOWN, MOVE and UP events at the pointer location.
BUTTON_CLICK_OR_DRAG,
// Exactly one finger, button is not pressed.
// Pointer follows the active finger.
// Emits HOVER_MOVE events at the pointer location.
//
// Detect taps when the finger goes up while in HOVER mode.
HOVER,
// Exactly two fingers but neither have moved enough to clearly indicate
// whether a swipe or freeform gesture was intended. We consider the
// pointer to be pressed so this enables clicking or long-pressing on buttons.
// Pointer does not move.
// Emits DOWN, MOVE and UP events with a single stationary pointer coordinate.
PRESS,
// Exactly two fingers moving in the same direction, button is not pressed.
// Pointer does not move.
// Emits DOWN, MOVE and UP events with a single pointer coordinate that
// follows the midpoint between both fingers.
SWIPE,
// Two or more fingers moving in arbitrary directions, button is not pressed.
// Pointer does not move.
// Emits DOWN, POINTER_DOWN, MOVE, POINTER_UP and UP events that follow
// each finger individually relative to the initial centroid of the finger.
FREEFORM,
// Waiting for quiet time to end before starting the next gesture.
QUIET,
};
// Time the first finger went down.
nsecs_t firstTouchTime;
// The active pointer id from the raw touch data.
int32_t activeTouchId; // -1 if none
// The active pointer id from the gesture last delivered to the application.
int32_t activeGestureId; // -1 if none
// Pointer coords and ids for the current and previous pointer gesture.
Mode currentGestureMode;
BitSet32 currentGestureIdBits;
uint32_t currentGestureIdToIndex[MAX_POINTER_ID + 1];
PointerProperties currentGestureProperties[MAX_POINTERS];
PointerCoords currentGestureCoords[MAX_POINTERS];
Mode lastGestureMode;
BitSet32 lastGestureIdBits;
uint32_t lastGestureIdToIndex[MAX_POINTER_ID + 1];
PointerProperties lastGestureProperties[MAX_POINTERS];
PointerCoords lastGestureCoords[MAX_POINTERS];
// Time the pointer gesture last went down.
nsecs_t downTime;
// Time when the pointer went down for a TAP.
nsecs_t tapDownTime;
// Time when the pointer went up for a TAP.
nsecs_t tapUpTime;
// Location of initial tap.
float tapX, tapY;
// Time we started waiting for quiescence.
nsecs_t quietTime;
// Reference points for multitouch gestures.
float referenceTouchX; // reference touch X/Y coordinates in surface units
float referenceTouchY;
float referenceGestureX; // reference gesture X/Y coordinates in pixels
float referenceGestureY;
// Distance that each pointer has traveled which has not yet been
// subsumed into the reference gesture position.
BitSet32 referenceIdBits;
struct Delta {
float dx, dy;
};
Delta referenceDeltas[MAX_POINTER_ID + 1];
// Describes how touch ids are mapped to gesture ids for freeform gestures.
uint32_t freeformTouchToGestureIdMap[MAX_POINTER_ID + 1];
// A velocity tracker for determining whether to switch active pointers during drags.
VelocityTracker velocityTracker;
void reset() {
firstTouchTime = LLONG_MIN;
activeTouchId = -1;
activeGestureId = -1;
currentGestureMode = NEUTRAL;
currentGestureIdBits.clear();
lastGestureMode = NEUTRAL;
lastGestureIdBits.clear();
downTime = 0;
velocityTracker.clear();
resetTap();
resetQuietTime();
}
void resetTap() {
tapDownTime = LLONG_MIN;
tapUpTime = LLONG_MIN;
}
void resetQuietTime() {
quietTime = LLONG_MIN;
}
} mPointerGesture;
struct PointerSimple {
PointerCoords currentCoords;
PointerProperties currentProperties;
PointerCoords lastCoords;
PointerProperties lastProperties;
// True if the pointer is down.
bool down;
// True if the pointer is hovering.
bool hovering;
// Time the pointer last went down.
nsecs_t downTime;
void reset() {
currentCoords.clear();
currentProperties.clear();
lastCoords.clear();
lastProperties.clear();
down = false;
hovering = false;
downTime = 0;
}
} mPointerSimple;
// The pointer and scroll velocity controls.
VelocityControl mPointerVelocityControl;
VelocityControl mWheelXVelocityControl;
VelocityControl mWheelYVelocityControl;
void sync(nsecs_t when);
bool consumeRawTouches(nsecs_t when, uint32_t policyFlags);
void dispatchVirtualKey(nsecs_t when, uint32_t policyFlags,
int32_t keyEventAction, int32_t keyEventFlags);
void dispatchTouches(nsecs_t when, uint32_t policyFlags);
void dispatchHoverExit(nsecs_t when, uint32_t policyFlags);
void dispatchHoverEnterAndMove(nsecs_t when, uint32_t policyFlags);
void cookPointerData();
void dispatchPointerUsage(nsecs_t when, uint32_t policyFlags, PointerUsage pointerUsage);
void abortPointerUsage(nsecs_t when, uint32_t policyFlags);
void dispatchPointerGestures(nsecs_t when, uint32_t policyFlags, bool isTimeout);
void abortPointerGestures(nsecs_t when, uint32_t policyFlags);
bool preparePointerGestures(nsecs_t when,
bool* outCancelPreviousGesture, bool* outFinishPreviousGesture,
bool isTimeout);
void dispatchPointerStylus(nsecs_t when, uint32_t policyFlags);
void abortPointerStylus(nsecs_t when, uint32_t policyFlags);
void dispatchPointerMouse(nsecs_t when, uint32_t policyFlags);
void abortPointerMouse(nsecs_t when, uint32_t policyFlags);
void dispatchPointerSimple(nsecs_t when, uint32_t policyFlags,
bool down, bool hovering);
void abortPointerSimple(nsecs_t when, uint32_t policyFlags);
// Dispatches a motion event.
// If the changedId is >= 0 and the action is POINTER_DOWN or POINTER_UP, the
// method will take care of setting the index and transmuting the action to DOWN or UP
// it is the first / last pointer to go down / up.
void dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32_t source,
int32_t action, int32_t flags, int32_t metaState, int32_t buttonState,
int32_t edgeFlags,
const PointerProperties* properties, const PointerCoords* coords,
const uint32_t* idToIndex, BitSet32 idBits,
int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime);
// Updates pointer coords and properties for pointers with specified ids that have moved.
// Returns true if any of them changed.
bool updateMovedPointers(const PointerProperties* inProperties,
const PointerCoords* inCoords, const uint32_t* inIdToIndex,
PointerProperties* outProperties, PointerCoords* outCoords,
const uint32_t* outIdToIndex, BitSet32 idBits) const;
bool isPointInsideSurface(int32_t x, int32_t y);
const VirtualKey* findVirtualKeyHit(int32_t x, int32_t y);
void assignPointerIds();
};
class SingleTouchInputMapper : public TouchInputMapper {
public:
SingleTouchInputMapper(InputDevice* device);
virtual ~SingleTouchInputMapper();
virtual void reset(nsecs_t when);
virtual void process(const RawEvent* rawEvent);
protected:
virtual void syncTouch(nsecs_t when, bool* outHavePointerIds);
virtual void configureRawPointerAxes();
virtual bool hasStylus() const;
private:
SingleTouchMotionAccumulator mSingleTouchMotionAccumulator;
};
class MultiTouchInputMapper : public TouchInputMapper {
public:
MultiTouchInputMapper(InputDevice* device);
virtual ~MultiTouchInputMapper();
virtual void reset(nsecs_t when);
virtual void process(const RawEvent* rawEvent);
protected:
virtual void syncTouch(nsecs_t when, bool* outHavePointerIds);
virtual void configureRawPointerAxes();
virtual bool hasStylus() const;
private:
MultiTouchMotionAccumulator mMultiTouchMotionAccumulator;
// Specifies the pointer id bits that are in use, and their associated tracking id.
BitSet32 mPointerIdBits;
int32_t mPointerTrackingIdMap[MAX_POINTER_ID + 1];
};
class JoystickInputMapper : public InputMapper {
public:
JoystickInputMapper(InputDevice* device);
virtual ~JoystickInputMapper();
virtual uint32_t getSources();
virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
virtual void dump(String8& dump);
virtual void configure(nsecs_t when, const InputReaderConfiguration* config, uint32_t changes);
virtual void reset(nsecs_t when);
virtual void process(const RawEvent* rawEvent);
private:
struct Axis {
RawAbsoluteAxisInfo rawAxisInfo;
AxisInfo axisInfo;
bool explicitlyMapped; // true if the axis was explicitly assigned an axis id
float scale; // scale factor from raw to normalized values
float offset; // offset to add after scaling for normalization
float highScale; // scale factor from raw to normalized values of high split
float highOffset; // offset to add after scaling for normalization of high split
float min; // normalized inclusive minimum
float max; // normalized inclusive maximum
float flat; // normalized flat region size
float fuzz; // normalized error tolerance
float resolution; // normalized resolution in units/mm
float filter; // filter out small variations of this size
float currentValue; // current value
float newValue; // most recent value
float highCurrentValue; // current value of high split
float highNewValue; // most recent value of high split
void initialize(const RawAbsoluteAxisInfo& rawAxisInfo, const AxisInfo& axisInfo,
bool explicitlyMapped, float scale, float offset,
float highScale, float highOffset,
float min, float max, float flat, float fuzz, float resolution) {
this->rawAxisInfo = rawAxisInfo;
this->axisInfo = axisInfo;
this->explicitlyMapped = explicitlyMapped;
this->scale = scale;
this->offset = offset;
this->highScale = highScale;
this->highOffset = highOffset;
this->min = min;
this->max = max;
this->flat = flat;
this->fuzz = fuzz;
this->resolution = resolution;
this->filter = 0;
resetValue();
}
void resetValue() {
this->currentValue = 0;
this->newValue = 0;
this->highCurrentValue = 0;
this->highNewValue = 0;
}
};
// Axes indexed by raw ABS_* axis index.
KeyedVector<int32_t, Axis> mAxes;
void sync(nsecs_t when, bool force);
bool haveAxis(int32_t axisId);
void pruneAxes(bool ignoreExplicitlyMappedAxes);
bool filterAxes(bool force);
static bool hasValueChangedSignificantly(float filter,
float newValue, float currentValue, float min, float max);
static bool hasMovedNearerToValueWithinFilteredRange(float filter,
float newValue, float currentValue, float thresholdValue);
static bool isCenteredAxis(int32_t axis);
static int32_t getCompatAxis(int32_t axis);
static void addMotionRange(int32_t axisId, const Axis& axis, InputDeviceInfo* info);
static void setPointerCoordsAxisValue(PointerCoords* pointerCoords, int32_t axis,
float value);
};
} // namespace android
#endif // _UI_INPUT_READER_H
| [
"[email protected]"
] | |
2230b8fb60816b28c679d1f310c1005ebc475a52 | 8a5b5c26c8d195d983f528455702902ae9de843c | /cpp05/ex03/ShrubberyCreationForm.cpp | 527f4b8f6190f34db20dd5f1e077f5ae247ea59b | [] | no_license | memoregoing/subject | f35e46d8277a60ad1ba59bf16570fe5ca101a2b6 | 1d55e045b1fe36d757038c32a43ed1fe0db16240 | refs/heads/master | 2023-01-24T16:12:52.717773 | 2020-11-30T04:36:53 | 2020-11-30T04:36:53 | 315,865,372 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,566 | cpp | //
// Created by namhyung kim on 2020/11/03.
//
#include "ShrubberyCreationForm.hpp"
std::string const &ShrubberyCreationForm::name = std::string("Shrubbery Creation");
std::string const ShrubberyCreationForm::trees[3] = {
" /\\\n" \
" /\\*\\\n" \
" /\\O\\*\\\n" \
" /*/\\/\\/\\\n" \
" /\\O\\/\\*\\/\\\n" \
" /\\*\\/\\*\\/\\/\\\n" \
"/\\O\\/\\/*/\\/O/\\\n" \
" ||\n" \
" ||\n" \
" ||\n",
" v\n" \
" >X<\n" \
" A\n" \
" d$b\n" \
" .d\\$$b.\n" \
" .d$i$$\\$$b.\n" \
" d$$@b\n" \
" d\\$$$ib\n" \
" .d$$$\\$$$b\n" \
" .d$$@$$$$\\$$ib.\n" \
" d$$i$$b\n" \
" d\\$$$$@$b\n" \
" .d$@$$\\$$$$$@b.\n" \
".d$$$$i$$$\\$$$$$$b.\n" \
" ###\n" \
" ###\n" \
" ###\n",
" *\n" \
" /|\\\n" \
" /*|O\\\n" \
" /*/|\\*\\\n" \
" /X/O|*\\X\\\n" \
" /*/X/|\\X\\*\\\n" \
" /O/*/X|*\\O\\X\\\n" \
" /*/O/X/|\\X\\O\\*\\\n" \
" /X/O/*/X|O\\X\\*\\O\\\n" \
"/O/X/*/O/|\\X\\*\\O\\X\\\n" \
" |X|\n" \
" |X|\n"
};
ShrubberyCreationForm::ShrubberyCreationForm(std::string const &target):Form(ShrubberyCreationForm::name, 145, 137), target(target)
{
}
ShrubberyCreationForm::ShrubberyCreationForm(ShrubberyCreationForm const &other):Form(other), target(other.target)
{
}
ShrubberyCreationForm::~ShrubberyCreationForm()
{
}
const char* ShrubberyCreationForm::TargetFileOpenException::what() const throw()
{
return "ShrubberyCreationFormException: Cannot open file";
}
const char* ShrubberyCreationForm::WriteException::what() const throw()
{
return "ShrubberyCreationFormException: Error while writing to the file";
}
ShrubberyCreationForm &ShrubberyCreationForm::operator=(ShrubberyCreationForm const &other)
{
(void)other;
return (*this);
}
void ShrubberyCreationForm::execute(Bureaucrat const &executor) const
{
Form::execute(executor);
std::string const shrubName = (this->target + "_shrubbery");
// 파일을 여는데 없으면 생성한다.
std::ofstream outfile(shrubName, std::ios::out | std::ios::app);
if (!outfile.is_open() || outfile.bad())
throw TargetFileOpenException();
int treeCount = (rand() % 6) + 1;
for (int i = 0; i < treeCount; i++)
{
outfile << ShrubberyCreationForm::trees[rand() % 3];
if (outfile.bad())
{
outfile << std::endl;
outfile.close();
throw WriteException();
}
}
outfile << std::endl;
outfile.close();
}
Form *ShrubberyCreationForm::generate(std::string const &target)
{
return (new ShrubberyCreationForm(target));
}
| [
"[email protected]"
] | |
e3e0e3b30b94a35aa053ef289a756d6776d16a6a | 04230fbf25fdea36a2d473233e45df21b6ff6fff | /1374-C.cpp | aa7e3465c3e5e889b79551e29114c31dafb3c6bc | [
"MIT"
] | permissive | ankiiitraj/questionsSolved | 48074d674bd39fe67da1f1dc7c944b95a3ceac34 | 8452b120935a9c3d808b45f27dcdc05700d902fc | refs/heads/master | 2021-07-22T10:16:13.538256 | 2021-02-12T11:51:47 | 2021-02-12T11:51:47 | 241,689,398 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,267 | cpp | #include <bits/stdc++.h>
#include <time.h>
#define int long long int
#define pb push_back
#define all(a) a.begin(), a.end()
#define scnarr(a, n) for (int i = 0; i < n; ++i) cin >> a[i]
#define vi vector<int>
#define si set<int>
#define pii pair <int, int>
#define sii set<pii>
#define vii vector<pii>
#define mii map <int, int>
#define faster ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
using namespace chrono;
/* -------------------------------Solution Sarted--------------------------------------*/
//Constants
const int MOD = 1000000007; // 1e9 + 7
const int MAXN = 1000005; // 1e6 +5
void solve(){
int n;
string s;
cin >> n >> s;
int cur = s[0] == ')' ? -1 : 1;
int ans = 0;
for(int i = 1; i < n; ++i){
if(cur < 0){
ans++;
cur = 0;
}
if(s[i] == ')'){
cur--;
}else{
cur++;
}
}
cout << ans << endl;
}
signed main()
{
faster;
#ifndef ONLINE_JUDGE
freopen("ip.txt", "r", stdin);
freopen("op.txt", "w", stdout);
#endif
int t; cin >> t; while(t--)
solve();
return 0;
}
//Author : Ankit Raj
//Problem Link :
/*Snippets*/
/*
sieve - prime factorization using sieve and primes in range
zpower - pow with mod
plate - Initial template
bfs
dfs
fenwik - BIT
binary_search
segment_tree
*/
| [
"[email protected]"
] | |
4a9d0505a118482a9e11495a7790e690124211cc | 64e39e7de6447f7f44223e587381b79a3e0521a0 | /ludum_dare_23/Item.h | a52130e6c8cd090070d340db25fb9f8866e29ea6 | [] | no_license | beersbr/ludum_dare_23 | f2d809558a2ccacc51bdb65c7c3151afbfd2e408 | 37fe636e32cffa21d3610b238801ec2c092e8433 | refs/heads/master | 2021-01-25T12:30:36.959216 | 2012-04-23T04:36:29 | 2012-04-23T04:36:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 214 | h | #pragma once
#include "settings.h"
#include "Entity.h"
class Item :
public Entity
{
public:
Item(void);
Item(double x, double y);
~Item(void);
int Draw(sf::RenderTarget * rt) const;
int Update(void );
};
| [
"[email protected]"
] | |
c07a4014c468ccb301f0c899778a308ef77495f5 | e2b44d240cf2bdb12d780551d4f5c849693173dd | /cpp/cardgames/cards.cpp | db6fef34da2e8f0711c62af8567cecfa945d9426 | [
"MIT"
] | permissive | kfsone/tinker | 445678c6e38b7c6ab11e14295864ada886d44589 | 81ed372117bcad691176aac960302f497adf8d82 | refs/heads/master | 2022-06-12T18:36:09.225720 | 2021-02-21T20:38:10 | 2021-02-21T20:38:10 | 94,041,989 | 0 | 0 | MIT | 2022-06-06T18:27:44 | 2017-06-12T01:04:30 | Python | UTF-8 | C++ | false | false | 1,482 | cpp | #include "cards.h"
#include <algorithm>
#include <stdexcept>
namespace cards
{
// ----------------------------------------------------------------------------
// Strings
const std::string cColors[ColorCount] =
{
"Red", "Black"
};
const std::string cSuites[SuiteCount] =
{
"Hearts",
"Diamonds",
"Clubs",
"Spades",
};
const std::string cFaces[FaceCount] =
{
"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"
};
// ----------------------------------------------------------------------------
// Helper functions
Suite index_suite(std::string_view suite_)
{
for (size_t i = 0; i < SuiteCount; ++i)
{
if (cSuites[i][0] == suite_[0])
return static_cast<Suite>(i);
}
throw std::runtime_error("Unrecognized suite: " + std::string(suite_));
}
Face index_face(std::string_view face)
{
auto it = std::find(cbegin(cFaces), cend(cFaces), face);
if (it == cend(cFaces))
throw std::runtime_error("Unrecognized face: " + std::string(face));
// Faces are 1-based.
return static_cast<Face>(std::distance(cbegin(cFaces), it) + 1);
}
cardindex_t card_index(std::string_view label_)
{
if (label_.size() < 2 || label_.size() > 3)
throw std::invalid_argument("invalid card label: " + std::string(label_));
auto splitPoint = label_.size() - 1;
Face face = index_face(label_.substr(0, splitPoint));
Suite suite = index_suite(label_.substr(splitPoint, 1));
return card_index(suite, face);
}
} // namespace cards
| [
"[email protected]"
] | |
031135c82530f31c2b096aba3863e8517b718c89 | 955129b4b7bcb4264be57cedc0c8898aeccae1ca | /python/mof/cpp/req_buy_petelitetimes.h | dd1fbdfa45fded22e013e1010519d681ba74b8ab | [] | no_license | PenpenLi/Demos | cf270b92c7cbd1e5db204f5915a4365a08d65c44 | ec90ebea62861850c087f32944786657bd4bf3c2 | refs/heads/master | 2022-03-27T07:33:10.945741 | 2019-12-12T08:19:15 | 2019-12-12T08:19:15 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 289 | h | #ifndef MOF_REQ_BUY_PETELITETIMES_H
#define MOF_REQ_BUY_PETELITETIMES_H
class req_buy_petelitetimes{
public:
void req_buy_petelitetimes(void);
void decode(ByteArray &);
void PacketName(void);
void ~req_buy_petelitetimes();
void build(ByteArray &);
void encode(ByteArray &);
}
#endif | [
"[email protected]"
] | |
2e56d0566ce675780d7cfe9499599fcc0c98d7e0 | be72fe42c30c098c2e91e4db868f896d0c07652d | /简单光线追踪/Ray_Place/Equation.h | 01d010f08a21d056c803a4d94c134aa20f9f73d1 | [] | no_license | Cxaqing/Ray-tracing | 654bac25299a4bef777f823ee4fcb3cb174547d0 | f5bb0a199c9769ccec170f6547474c71359bf5bc | refs/heads/main | 2023-04-09T07:42:16.469421 | 2021-03-30T12:14:40 | 2021-03-30T12:14:40 | 352,978,348 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 311 | h | #pragma once
class CEquation//方程类
{
public:
CEquation(void);
virtual ~CEquation(void);
int SolveQuadric(double c[3], double s[2]);//求解一元二次方程
int SolveCubic(double c[4], double s[3]);//求解一元三次方程
int SolveQuartic(double c[5], double s[4]);//求解一元四次方程
};
| [
"[email protected]"
] | |
3559fe44eea3feb08801f1b8ddf5cbba964ef89c | fd7d1350eefac8a9bbd952568f074284663f2794 | /orbsvcs/Notify/Validate_Worker_T.cpp | a90ecfbc4106b9ce03220062598ba79ae4920341 | [
"MIT"
] | permissive | binary42/OCI | 4ceb7c4ed2150b4edd0496b2a06d80f623a71a53 | 08191bfe4899f535ff99637d019734ed044f479d | refs/heads/master | 2020-06-02T08:58:51.021571 | 2015-09-06T03:25:05 | 2015-09-06T03:25:05 | 41,980,019 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 879 | cpp | /* -*- C++ -*- $Id: Validate_Worker_T.cpp 2179 2013-05-28 22:16:51Z mesnierp $ */
#ifndef NOTIFY_VALIDATE_WORKER_CPP
#define NOTIFY_VALIDATE_WORKER_CPP
#include "Validate_Worker_T.h"
#include "tao/debug.h"
#include "orbsvcs/Log_Macros.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
namespace TAO_Notify
{
template<class TOPOOBJ>
Validate_Worker<TOPOOBJ>::Validate_Worker()
{
}
template<class TOPOOBJ>
void
Validate_Worker<TOPOOBJ>::work (TOPOOBJ* o)
{
if (o == 0)
{
if (TAO_debug_level > 0)
{
ORBSVCS_DEBUG ((LM_DEBUG,
ACE_TEXT("(%P|%t)Validate_Worker<TOPOOBJ>::work: obj is nil\n")));
}
}
else
{
o->validate ();
}
}
} // namespace TAO_Notify
TAO_END_VERSIONED_NAMESPACE_DECL
#endif /* VALIDATE_WORKER_CPP */
| [
"[email protected]"
] | |
c6f91a8933c5552f3492baa830b3bb7f423b1c25 | 86bb23fe04539ebbd7669a5a250fd263cf34dcb8 | /Source/AppLib/IApp.hpp | 4b93c4dce3998fa774f926a981f9a4ee1de410f7 | [
"MIT"
] | permissive | secretlyarobot/CyberpunkSaveEditor | b681e91fb914bb24def5665321eeeb4aa67324f1 | c2f79d35ce133a5dd8edb1724a3c1b4f32fce95f | refs/heads/main | 2023-02-06T20:34:03.940831 | 2021-01-01T04:57:02 | 2021-01-01T04:57:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,801 | hpp | #pragma once
#if __has_include("stdafx.h") && __has_include(<stdafx.h>)
#include "stdafx.h"
#endif
#include "pch.h"
#include "imgui/imgui/imgui.h"
#include "imgui/imgui/imgui_internal.h"
#include "imgui/imgui_impl_dx11.h"
#include "imgui/imgui_impl_win32.h"
static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x + rhs.x, lhs.y + rhs.y); }
static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x - rhs.x, lhs.y - rhs.y); }
static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; }
static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; }
template <typename T>
struct imgui_datatype_of { static constexpr ImGuiDataType value = -1; };
template <> struct imgui_datatype_of< uint8_t> { static constexpr ImGuiDataType value = ImGuiDataType_::ImGuiDataType_U8; };
template <> struct imgui_datatype_of<uint16_t> { static constexpr ImGuiDataType value = ImGuiDataType_::ImGuiDataType_U16; };
template <> struct imgui_datatype_of<uint32_t> { static constexpr ImGuiDataType value = ImGuiDataType_::ImGuiDataType_U32; };
template <> struct imgui_datatype_of<uint64_t> { static constexpr ImGuiDataType value = ImGuiDataType_::ImGuiDataType_U64; };
template <> struct imgui_datatype_of< int8_t> { static constexpr ImGuiDataType value = ImGuiDataType_::ImGuiDataType_S8; };
template <> struct imgui_datatype_of< int16_t> { static constexpr ImGuiDataType value = ImGuiDataType_::ImGuiDataType_S16; };
template <> struct imgui_datatype_of< int32_t> { static constexpr ImGuiDataType value = ImGuiDataType_::ImGuiDataType_S32; };
template <> struct imgui_datatype_of< int64_t> { static constexpr ImGuiDataType value = ImGuiDataType_::ImGuiDataType_S64; };
template <> struct imgui_datatype_of< float> { static constexpr ImGuiDataType value = ImGuiDataType_::ImGuiDataType_Float; };
template <> struct imgui_datatype_of< double> { static constexpr ImGuiDataType value = ImGuiDataType_::ImGuiDataType_Double; };
struct scoped_imgui_id {
scoped_imgui_id(const char* str_id) { ImGui::PushID(str_id); }
scoped_imgui_id(void* ptr_id) { ImGui::PushID(ptr_id); }
scoped_imgui_id(int int_id) { ImGui::PushID(int_id); }
~scoped_imgui_id() { ImGui::PopID(); }
};
struct scoped_imgui_style_color {
scoped_imgui_style_color(ImGuiCol idx, ImVec4 col) { ImGui::PushStyleColor(ImGuiCol_Text, col); }
~scoped_imgui_style_color() { ImGui::PopStyleColor(); }
};
struct scoped_imgui_button_hue {
scoped_imgui_button_hue(float hue) {
ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(hue, 0.6f, 0.6f));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(hue, 0.7f, 0.7f));
ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(hue, 0.8f, 0.8f)); }
~scoped_imgui_button_hue() { ImGui::PopStyleColor(3); }
};
#define WINDOW_STYLE WS_OVERLAPPEDWINDOW
class AppImage
{
private:
ComPtr<ID3D11ShaderResourceView> tex;
int w, h;
public:
AppImage(const ComPtr<ID3D11ShaderResourceView>& tex, int w, int h)
: tex(tex), w(w), h(h) {}
void draw(ImVec2 size = {0, 0}, bool rescale=true)
{
if (size.x <= 0)
{
size.x = (float)w;
if (rescale && size.y > 0)
size.x *= size.y / (float)h;
}
if (size.y <= 0)
{
size.y = (float)h;
if (rescale)
size.y *= size.x / (float)w;
}
ImGui::Image((void*)tex.Get(), size);
}
};
class IApp
{
public:
virtual ~IApp() {}
int run();
virtual LRESULT window_proc(UINT msg, WPARAM wParam, LPARAM lParam);
HWND get_hwnd() { return m_hwnd; }
protected:
virtual void startup() = 0;
virtual void cleanup() = 0;
virtual void update() = 0;
virtual void draw_imgui() = 0;
virtual void on_resized() {};
virtual bool quitting() { return false; }
public:
std::shared_ptr<AppImage> load_texture_from_file(const std::string& filename);
private:
bool d3d_init();
void d3d_fini();
void d3d_present();
void d3d_resize(uint32_t width, uint32_t height);
void d3d_create_rtv();
void d3d_cleanup_rtv();
private:
ComPtr<ID3D11Device> m_device;
ComPtr<ID3D11DeviceContext> m_devctx;
ComPtr<IDXGISwapChain> m_swapchain;
ComPtr<ID3D11RenderTargetView> m_rtv;
ComPtr<IDCompositionDevice> m_dcomp_device;
ComPtr<IDCompositionTarget> m_dcomp_target;
ComPtr<IDCompositionVisual> m_dcomp_visual;
HANDLE m_swapchain_waitable_object;
protected:
std::wstring m_wndname = L"IApp";
HWND m_hwnd = 0;
uint32_t m_display_width = 1280;
uint32_t m_display_height = 800;
ImVec4 m_bg_color = ImVec4(0.2f, 0.2f, 0.3f, 1.f);
};
#define CREATE_APPLICATION(app_class) \
int wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nShowCmd) \
{ \
auto app = std::make_unique<app_class>(); \
return app->run(); \
}
| [
"[email protected]"
] | |
1c68519f7567a4ff43318d6c1a247de211bc536e | 2f557f60fc609c03fbb42badf2c4f41ef2e60227 | /RecoTauTag/ImpactParameter/src/LorentzVectorParticle.cc | c9f2b6829db7c33f43d506ff2280b08cf26a3488 | [
"Apache-2.0"
] | permissive | CMS-TMTT/cmssw | 91d70fc40a7110832a2ceb2dc08c15b5a299bd3b | 80cb3a25c0d63594fe6455b837f7c3cbe3cf42d7 | refs/heads/TMTT_1060 | 2020-03-24T07:49:39.440996 | 2020-03-04T17:21:36 | 2020-03-04T17:21:36 | 142,576,342 | 3 | 5 | Apache-2.0 | 2019-12-05T21:16:34 | 2018-07-27T12:48:13 | C++ | UTF-8 | C++ | false | false | 709 | cc | #include "RecoTauTag/ImpactParameter/interface/LorentzVectorParticle.h"
using namespace tauImpactParameter;
LorentzVectorParticle::LorentzVectorParticle()
: Particle(TVectorT<double>(NLorentzandVertexPar),TMatrixTSym<double>(NLorentzandVertexPar),0,0,0)
{}
LorentzVectorParticle::LorentzVectorParticle(const TVectorT<double>& par, const TMatrixTSym<double>& cov, int pdgid ,double charge,double b)
: Particle(par, cov, pdgid, charge,b)
{}
TString LorentzVectorParticle::name(int i)
{
if (i == px) return "px";
if (i == py) return "py";
if (i == pz) return "pz";
if (i == m ) return "m";
if (i == vx) return "vx";
if (i == vy) return "vy";
if (i == vz) return "vz";
return "invalid";
}
| [
"[email protected]"
] | |
2bfdb33426d3d4915141e7b43a620b6a08bfd66f | 8fcb1c271da597ecc4aeb75855ff4b372b4bb05e | /Livearchive/Sales.cpp | 4ae453f6ede9e4069ca3d0c846dd28441478e6cc | [
"Apache-2.0"
] | permissive | MartinAparicioPons/Competitive-Programming | 9c67c6e15a2ea0e2aa8d0ef79de6b4d1f16d3223 | 58151df0ed08a5e4e605abefdd69fef1ecc10fa0 | refs/heads/master | 2020-12-15T21:33:39.504595 | 2016-10-08T20:40:10 | 2016-10-08T20:40:10 | 20,273,032 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,140 | cpp | #include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
#define DB(x)
#define DBL(x)
#define EL
#define endl "\n"
#else
#define DB(x) cerr << "#" << (#x) << ": " << (x) << " ";
#define DBL(x) cerr << "#" << (#x) << ": " << (x) << endl;
#define EL cerr << endl;
#endif
#define EPS 1e-11
#define X first
#define Y second
#define PB push_back
#define SQ(x) ((x)*(x))
#define GB(m, x) ((m) & (1<<(x)))
#define SB(m, x) ((m) | (1<<(x)))
#define CB(m, x) ((m) & (~(1<<(x))))
#define TB(m, x) ((m) ^ (1<<(x)))
using namespace std; typedef string string;
typedef long double ld; typedef unsigned long long ull;
typedef long long ll; typedef pair<ll, ll> ii;
typedef pair<int, ii> iii; typedef vector<int> vi;
typedef vector<ii> vii; typedef vector<vi> vvi;
typedef vector<ll> vll; typedef pair<string, string> ss;
const static ll MX = 1010;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
int t, n, i, j, A[MX];
ll r;
cin >> t;
while(t--){
cin >> n;
for(i = 0; i < n; i++) cin >> A[i];
r = 0ll;
for(i = 1; i < n; i++){
for(j = 0; j < i; j++){
if(A[i] >= A[j]) r++;
}
}
cout << r << endl;
}
}
| [
"[email protected]"
] | |
e749d6fd6b8b21d583597222c9e6e308785cab14 | 112a0cb577e1423278efa7685d195c956d5f2e30 | /not_sent/p758_same_game/acm.cpp | 0309d0d67ab72ca9b61d96ff8d0f9ef38750b647 | [] | no_license | sca1a/acm-valladolid | 8880f406545b29bbf790f74a2d5d73c5a1807119 | d539373779a8b4224160f45aa8d1c4272f48c281 | refs/heads/master | 2020-12-25T05:27:15.327812 | 2012-05-17T03:43:58 | 2012-05-17T03:43:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,054 | cpp | /* @JUDGE_ID: 40922FK 758 C++ */
/* @BEGIN_OF_SOURCE_CODE */
/**************************************************************************
Solution to Problem 758 - The Same Game
by: Francisco Dibar
date: Nov-05-2006
**************************************************************************/
//#define DEBUG
//#define ONLINE_JUDGE
#ifdef DEBUG
#define START_DEBUG "**************************** START DEBUG *****************************\n"
#define END_DEBUG "***************************** END DEBUG ******************************\n"
// g++-2.95 doesn't support asserts
#define ASSERT(x,y) if (!(x)) { std::cerr << "ASSERTION FAILED!: " << y << "\n"; exit(1); }
#endif
#include <iostream>
#ifndef ONLINE_JUDGE
#include <fstream>
#endif
#include <vector>
#include <queue>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::queue;
const int NROWS = 10;
const int NCOLS = 15;
const char RED = 'R';
const char GREEN = 'G';
const char BLUE = 'B';
const char CLEAR = '.';
////////////////////////////////////////////////////////////////////////////////
int floodfill(vector<vector<char> >& grid, int xi, int yi, char search, char replaceWith)
// returns the number of painted points
// xi: initial row, yi: initial column
{
if (grid[xi][yi] != search) return 0;
queue<pair<int, int> > qMissing;
qMissing.push(make_pair(xi, yi));
int npainted = 0;
while (!qMissing.empty()) {
pair<int, int> pos;
pos = qMissing.front();
qMissing.pop();
// it can ocurr that I push 2 times the same thing
if (grid[pos.first][pos.second] == search) {
grid[pos.first][pos.second] = replaceWith;
npainted++;
if (pos.first-1 >= 0) {
if (grid[pos.first-1][pos.second] == search)
qMissing.push(make_pair(pos.first-1, pos.second));
}
if (pos.first+1 < (int)grid.size()) {
if (grid[pos.first+1][pos.second] == search)
qMissing.push(make_pair(pos.first+1, pos.second));
}
if (pos.second-1 >= 0) {
if (grid[pos.first][pos.second-1] == search)
qMissing.push(make_pair(pos.first, pos.second-1));
}
if (pos.second+1 < (int)grid[0].size()) {
if (grid[pos.first][pos.second+1] == search)
qMissing.push(make_pair(pos.first, pos.second+1));
}
}
}
return npainted;
}
///////////////////////////////////////////////////////////////////////////
void shiftLeft(vector<vector<char> >& mBoard)
{
// TODO
}
///////////////////////////////////////////////////////////////////////////
void shiftDown(vector<vector<char> >& mBoard)
{
// TODO
for (int j = 0; j < NCOLS; ++j) {
for (int i = NROWS - 1; i >= 0; --i)
if (mBoard[i][j] == CLEAR) {
// find first cell above not clear
for (int k = i-1; k >= 0; --k)
if (mBoard[k][j] != CLEAR)
mBoard[i][j] = mBoard[k][j];
}
}
}
///////////////////////////////////////////////////////////////////////////
void applyMove(vector<vector<char> >& mBoard, int x, int y)
{
floodfill(mBoard, x, y, mBoard[x][y], CLEAR);
// shift balls
shiftDown(mBoard);
shiftLeft(mBoard);
}
///////////////////////////////////////////////////////////////////////////
bool checkForBigClusters(vector<vector<char> >& mBoard)
// returns true if there are any big clusters
{
// floodfill with the same color, just to count cluster size
for (int i = 0; i < NROWS; ++i)
for (int j = 0; j < NROWS; ++j)
if (floodfill(mBoard, i, j, mBoard[i][j], mBoard[i][j]) > 1)
return true;
return false;
}
///////////////////////////////////////////////////////////////////////////
// MAIN PROGRAM
///////////////////////////////////////////////////////////////////////////
int main(int argc, char *argv[])
{
#ifndef ONLINE_JUDGE
// redirect input and output
cin.rdbuf((new std::ifstream("input"))->rdbuf());
cout.rdbuf((new std::ofstream("output"))->rdbuf());
#endif
int ncases;
cin >> ncases;
vector<vector<char> > mBoard(NROWS);
for (vector<vector<char> >::iterator i = mBoard.begin(); i != mBoard.end(); ++i)
mBoard.resize(NCOLS);
for (int k = 0; k < ncases; ++k) {
// READ INPUT
for (int i = 0; i < NROWS; ++i)
for (int j = 0; j < NCOLS; ++j)
cin >> mBoard[i][j];
// PROCESS
int nballs = NROWS * NCOLS;
bool bigClusters = true;
int score = 0;
int nmoves = 0;
// game ends if no more balls are left, or no big cluster exists
while (nballs > 0 && bigClusters) {
// find next move
// for each row, col apply floodfill on mTemp, then apply move on mBoard
vector<vector<char> > mTemp(mBoard);
int maxCluster = 1;
int x = 0, y = 0;
for (int i = NROWS - 1; i >= 0; --i) {
for (int j = 0; j < NCOLS; ++j) {
int cluster = floodfill(mTemp, i, j, mTemp[i][j], CLEAR);
// choose leftmost, then bottommost
if ((cluster > maxCluster) ||
((cluster == maxCluster) && (j < i))) {
maxCluster = cluster;
x = i;
y = j;
}
}
}
// SHOW OUTPUT
char color = mBoard[x][y];
int points = (maxCluster-2) * (maxCluster-2);
cout << "Move " << nmoves << " at (" << x << "," << y << "): removed " << maxCluster << " balls of color " << color << ", got " << points << " points." << endl;
nballs -= maxCluster;
score += points;
applyMove(mBoard, x, y);
bigClusters = checkForBigClusters(mBoard);
}
// SHOW OUTPUT
cout << "Final score: " << score << ", with " << nballs << " balls remaining." << endl;
}
#ifdef DEBUG
cout << START_DEBUG;
cout << END_DEBUG;
#endif
return 0;
}
/* @END_OF_SOURCE_CODE */
| [
"[email protected]"
] | |
6426a30c92d07a3a6412d5c47ae16a0ac07458ba | adcd1a0efcd34150631bd4eb86f278240d9a1a9f | /serverplugin/AHTTransfer/util/base64.cpp | 34a8a5467e59005a1e75acf12a1b54e20074eeba | [
"BSD-3-Clause"
] | permissive | victorzjl/BPE | a91bf8d6781ba1ea7fb118fdc809f99423f9be14 | b919e655337df53fe45515b8d5aed831ffdb2a19 | refs/heads/master | 2020-02-26T14:16:00.513976 | 2016-06-28T09:20:52 | 2016-06-28T09:20:52 | 61,704,491 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 3,657 | cpp | /*
base64.cpp and base64.h
Copyright (C) 2004-2008 Rene' Nyffenegger
This source code is provided 'as-is', without any express or implied
warranty. In no event will the author 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 source code must not be misrepresented; you must not
claim that you wrote the original source code. If you use this source code
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 source code.
3. This notice may not be removed or altered from any source distribution.
Rene' Nyffenegger [email protected]
*/
#include "base64.h"
#include <iostream>
static const std::string base64_chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";
static inline bool is_base64(unsigned char c)
{
return (isalnum(c) || (c == '+') || (c == '/'));
}
std::string base64_encode(const unsigned char *bytes_to_encode, unsigned int in_len)
{
std::string ret;
int i = 0;
int j = 0;
unsigned char char_array_3[3];
unsigned char char_array_4[4];
while(in_len--)
{
char_array_3[i++] = *(bytes_to_encode++);
if(i == 3)
{
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
char_array_4[1] = ((char_array_3[0] & 0x03)<<4) + ((char_array_3[1] & 0xf0) >> 4);
char_array_4[2] = ((char_array_3[1] & 0x0f)<<2) + ((char_array_3[2] & 0xc0) >> 6);
char_array_4[3] = char_array_3[2] & 0x3f;
for(i = 0; i <4; i++)
{
ret += base64_chars[char_array_4[i]];
}
i = 0;
}
}
if(i)
{
for(j = i; j < 3; j++)
{
char_array_3[j] = '\0';
}
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
char_array_4[1] = ((char_array_3[0] & 0x03)<<4) + ((char_array_3[1] & 0xf0) >> 4);
char_array_4[2] = ((char_array_3[1] & 0x0f)<<2) + ((char_array_3[2] & 0xc0) >> 6);
char_array_4[3] = char_array_3[2] & 0x3f;
for(j = 0; j < i + 1; j++)
{
ret += base64_chars[char_array_4[j]];
}
while((i++ < 3))
{
ret += '=';
}
}
return ret;
}
std::string base64_decode(const std::string &encoded_string)
{
int in_len = (int)encoded_string.size();
int i = 0;
int j = 0;
int in_ = 0;
unsigned char char_array_4[4], char_array_3[3];
std::string ret;
while(in_len-- && (encoded_string[in_] != '=') && is_base64(encoded_string[in_]))
{
char_array_4[i++] = encoded_string[in_];
in_++;
if(i ==4)
{
for (i = 0; i <4; i++)
char_array_4[i] = (unsigned char)base64_chars.find(char_array_4[i]);
char_array_3[0] = (char_array_4[0]<<2) + ((char_array_4[1] & 0x30) >> 4);
char_array_3[1] = ((char_array_4[1] & 0xf)<<4) + ((char_array_4[2] & 0x3c) >> 2);
char_array_3[2] = ((char_array_4[2] & 0x3)<<6) + char_array_4[3];
for (i = 0; i < 3; i++)
{
ret += char_array_3[i];
}
i = 0;
}
}
if(i)
{
for(j = i; j <4; j++)
{
char_array_4[j] = 0;
}
for (j = 0; j <4; j++)
{
char_array_4[j] = (unsigned char)base64_chars.find(char_array_4[j]);
}
char_array_3[0] = (char_array_4[0]<<2) + ((char_array_4[1] & 0x30) >> 4);
char_array_3[1] = ((char_array_4[1] & 0xf)<<4) + ((char_array_4[2] & 0x3c) >> 2);
char_array_3[2] = ((char_array_4[2] & 0x3)<<6) + char_array_4[3];
for(j = 0; (j < i - 1); j++)
{
ret += char_array_3[j];
}
}
return ret;
}
| [
"[email protected]"
] | |
08dcdb2b1ca75a1e6eed25db0e3196b9e800a34c | 946367207720400f8c622aae35352b76766cf3ce | /template/primes.cpp | 791d102b7c2a65b017eef1ee40444026dfe6f7dd | [
"BSD-3-Clause"
] | permissive | kondra/CPP-Training | 52f11af51c4d08d140725c65e21c1e1d10fb288d | 08e0f6c78b2b59d1921d52f49bd46bfbbbc2e06e | refs/heads/master | 2016-09-10T08:16:12.933037 | 2013-09-23T19:05:41 | 2013-09-23T19:05:41 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 276 | cpp | #include <iostream>
using namespace std;
template<int n, int i>
struct is_prime {
enum { res = n % i && is_prime<n, i + 1>::res };
};
template<int n>
struct is_prime<n, n> {
enum { res = 1 };
};
int main()
{
cout << is_prime<7,2>::res << endl;
return 0;
}
| [
"[email protected]"
] | |
676f0d8471c70773dca4bc6c40af2d3f6f18a98c | a9c2299b54a544ca0a046675c344c43386083be6 | /Elemental/Main/source/Collision.cpp | 7f6262935ec3b5d5f2448d0d538e89bae6b946d6 | [] | no_license | DBurden1997/Elemental | 0943f6ddf7c7d8520c1903349180f69fddeb6ed8 | 49f45bdaebe0a74cf0155885e43ad4ecf6fb1dcc | refs/heads/master | 2020-04-15T05:22:12.941917 | 2019-01-07T10:44:44 | 2019-01-07T10:44:44 | 164,418,812 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,238 | cpp |
#include "Collision.hpp"
#include <stdio.h>
#include <cmath>
//Namespace holding various collision checking functions
namespace Collision {
//Check if there is a collision between two collider rects
bool isCollision( SDL_Rect* colliderOne, SDL_Rect* colliderTwo ) {
//Positions of the sides of the collision rects
//First collision rect
int left1 = colliderOne->x;
int right1 = colliderOne->x + colliderOne->w;
int top1 = colliderOne->y;
int bottom1 = colliderOne->y + colliderOne->h;
//Second collision rect
int left2 = colliderTwo->x;
int right2 = colliderTwo->x + colliderTwo->w;
int top2 = colliderTwo->y;
int bottom2 = colliderTwo->y+ colliderTwo->h;
//Collision flag
bool collided = true;
if( right1 <= left2 ) {
collided = false;
}
else if( left1 >= right2 ) {
collided = false;
}
else if( bottom1 <= top2 ) {
collided = false;
}
else if( top1 >= bottom2 ) {
collided = false;
}
return collided;
}
//Get the collision vector between two collider rects
std::vector< int > getCollisionVector( SDL_Rect* colliderOne, SDL_Rect* colliderTwo ) {
//Variables to hold the penetration depths
int xPenetration = 0;
int yPenetration = 0;
//Positions of the sides of the collision rects
//First collision rect
int left1 = colliderOne->x;
int right1 = colliderOne->x + colliderOne->w;
int top1 = colliderOne->y;
int bottom1 = colliderOne->y + colliderOne->h;
//Second collision rect
int left2 = colliderTwo->x;
int right2 = colliderTwo->x + colliderTwo->w;
int top2 = colliderTwo->y;
int bottom2 = colliderTwo->y+ colliderTwo->h;
//Get x penetration
//Collided from the left
xPenetration = left2 - right1;
//Collided from the right
if( abs( xPenetration ) > ( right2 - left1 ) ) {
xPenetration = right2 - left1;
}
//Get y penetration
//Collided from the top
yPenetration = top2 - bottom1;
//Collided from the bottom
if( abs( yPenetration ) > abs( bottom2 - top1 ) ) {
yPenetration = bottom2 - top1;
}
if( abs(xPenetration) <= abs(yPenetration) ) {
yPenetration = 0;
}
else if( abs(xPenetration) > abs(yPenetration) ) {
xPenetration = 0;
}
return {xPenetration, yPenetration};
}
//Get the normalized vector between two points
std::vector< float > getNormalizedVector( int x1, int y1, int x2, int y2 ) {
//Get the vector from point 1 to point 2
float x = x2 - x1;
float y = y2 - y1;
//Calculate the length of the vector
float length = sqrt( (x * x) + (y * y) );
//Get the normalized components
x /= length;
y /= length;
std::vector< float > normalVector = { x, y };
return normalVector;
}
}
| [
"[email protected]"
] | |
ccec312f82f0fcca47a9c66a86a9b45dc3f4d2d8 | b20633cef14a620eb8825291506f060b062ee77f | /src/plugins/opencv/nodes/capture/lytro_lightfield.cpp | ee16e29d253893dec7b91deb7a2b27e6a1e0191a | [
"MIT"
] | permissive | adam-urbanczyk/possumwood | aa0b46c2341e6f0864a1a12c78311b5396b4ae6e | ba6e941f21f3adaee0734a436a8034bbf96b6a9c | refs/heads/master | 2020-12-23T08:04:12.926107 | 2020-01-26T13:31:51 | 2020-01-26T13:31:51 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,494 | cpp | #include <possumwood_sdk/node_implementation.h>
#include <possumwood_sdk/datatypes/filename.h>
#include <sstream>
#include <fstream>
#include <boost/filesystem.hpp>
#include <actions/traits.h>
#include <actions/io/json.h>
#include <opencv2/opencv.hpp>
#include "frame.h"
#include "lightfield_pattern.h"
#include "lightfields/block.h"
#include "lightfields/raw.h"
#include "lightfields/pattern.h"
namespace {
dependency_graph::InAttr<possumwood::Filename> a_filename;
dependency_graph::OutAttr<possumwood::opencv::Frame> a_frame;
dependency_graph::OutAttr<lightfields::Pattern> a_pattern;
cv::Mat decodeData(const char* data, std::size_t width, std::size_t height, int black[4], int white[4]) {
cv::Mat result(width, height, CV_32F);
for(std::size_t i=0; i<width*height; ++i) {
const unsigned char c1 = data[i/2*3];
const unsigned char c2 = data[i/2*3+1];
const unsigned char c3 = data[i/2*3+2];
unsigned short val;
if(i%2 == 0)
val = ((unsigned short)c1 << 4) + (unsigned short)c2;
else
val = (((unsigned short)c2 & 0x0f) << 8) + (unsigned short)c3;
const unsigned patternId = (i%width) % 2 + ((i/width)%2)*2;
const float fval = ((float)val - (float)black[patternId]) / ((float)(white[patternId]-black[patternId]));
result.at<float>(i/width, i%width) = fval;
}
return result;
}
template<typename T>
std::string str(const T& val) {
return std::to_string(val);
}
template<>
std::string str<std::string>(const std::string& val) {
return val;
}
template<typename T>
void checkThrow(const T& value, const T& expected, const std::string& error) {
if(value != expected)
throw std::runtime_error("Expected " + error + " " + str(expected) + ", got " + str(value) + "!");
}
dependency_graph::State compute(dependency_graph::Values& data) {
const possumwood::Filename filename = data.get(a_filename);
cv::Mat result;
lightfields::Pattern pattern;
if(!filename.filename().empty() && boost::filesystem::exists(filename.filename())) {
int width = 0, height = 0;
std::string metadataRef, imageRef;
int black[4] = {0,0,0,0}, white[4] = {255,255,255,255};
std::ifstream file(filename.filename().string(), std::ios::binary);
lightfields::Raw raw;
file >> raw;
width = raw.metadata()["image"]["width"].asInt();
height = raw.metadata()["image"]["height"].asInt();
black[0] = raw.metadata()["image"]["rawDetails"]["pixelFormat"]["black"]["b"].asInt();
black[1] = raw.metadata()["image"]["rawDetails"]["pixelFormat"]["black"]["gb"].asInt();
black[2] = raw.metadata()["image"]["rawDetails"]["pixelFormat"]["black"]["gr"].asInt();
black[3] = raw.metadata()["image"]["rawDetails"]["pixelFormat"]["black"]["r"].asInt();
white[0] = raw.metadata()["image"]["rawDetails"]["pixelFormat"]["white"]["b"].asInt();
white[1] = raw.metadata()["image"]["rawDetails"]["pixelFormat"]["white"]["gb"].asInt();
white[2] = raw.metadata()["image"]["rawDetails"]["pixelFormat"]["white"]["gr"].asInt();
white[3] = raw.metadata()["image"]["rawDetails"]["pixelFormat"]["white"]["r"].asInt();
// assemble the lightfield pattern
pattern = lightfields::Pattern(
raw.metadata()["devices"]["mla"]["lensPitch"].asDouble(),
raw.metadata()["devices"]["sensor"]["pixelPitch"].asDouble(),
raw.metadata()["devices"]["mla"]["rotation"].asDouble(),
Imath::V2f(
raw.metadata()["devices"]["mla"]["scaleFactor"]["x"].asDouble(),
raw.metadata()["devices"]["mla"]["scaleFactor"]["y"].asDouble()
),
Imath::V3f(
raw.metadata()["devices"]["mla"]["sensorOffset"]["x"].asDouble(),
raw.metadata()["devices"]["mla"]["sensorOffset"]["y"].asDouble(),
raw.metadata()["devices"]["mla"]["sensorOffset"]["z"].asDouble()
),
Imath::V2i(width, height)
);
assert(!raw.image().empty());
result = decodeData(raw.image().data(), width, height, black, white);
}
data.set(a_frame, possumwood::opencv::Frame(result));
data.set(a_pattern, pattern);
return dependency_graph::State();
}
void init(possumwood::Metadata& meta) {
meta.addAttribute(a_filename, "filename", possumwood::Filename({
"Lytro files (*.lfr *.RAW)",
}));
meta.addAttribute(a_frame, "frame", possumwood::opencv::Frame(), possumwood::AttrFlags::kVertical);
meta.addAttribute(a_pattern, "pattern", lightfields::Pattern(), possumwood::AttrFlags::kVertical);
meta.addInfluence(a_filename, a_frame);
meta.addInfluence(a_filename, a_pattern);
meta.setCompute(compute);
}
possumwood::NodeImplementation s_impl("opencv/capture/lytro_lightfield", init);
}
| [
"[email protected]"
] | |
1c8f6174d8c9e46c79dd4b0820e559ca55d04c2d | a6b5b78fe6f83a92231337e1cdd9ac20bc10d478 | /cpp_inherit/virtual_method1.cc | 920a5bfcb408b788c7e9aa0d0824c61a59aad57a | [
"CC0-1.0"
] | permissive | guoxiaoyong/simple-useful | faf33b03f3772f78bbfd5e8050244ac365d90713 | 63f483250cc5e96ef112aac7499ab9e3a35572a8 | refs/heads/master | 2023-03-09T11:51:56.168743 | 2020-06-13T23:14:07 | 2020-06-13T23:14:07 | 43,603,113 | 0 | 0 | CC0-1.0 | 2023-03-01T12:30:26 | 2015-10-03T15:12:43 | Jupyter Notebook | UTF-8 | C++ | false | false | 712 | cc | #include <iostream>
#include <typeinfo>
namespace {
struct Parent {
Parent() {
std::cout << "Parent created.\n";
foo();
};
void say() {
foo();
}
virtual void foo() {
std::cout << "I'm parent." << std::endl;
}
};
struct Child: public Parent {
Child() {
std::cout << "Child created.\n";
foo();
};
virtual void foo() {
std::cout << "I'm child." << std::endl;
}
};
}
int main(void) {
auto p = Parent();
p.say();
auto c = Child();
c.say();
auto& ti = typeid(Child);
std::cout << &ti << std::endl;
std::cout << sizeof(&ti) << std::endl;
std::cout << ti.name() << std::endl;
std::cout << typeid(std::string).name() << std::endl;
return 0;
}
| [
"[email protected]"
] | |
276a3f7c8d3ea253bb32dc7977f44729818a3fbe | 33035c05aad9bca0b0cefd67529bdd70399a9e04 | /src/boost_mpl_aux__preprocessed_mwcw_not_equal_to.hpp | 5d927e646b9898c4fa3417dec4cffd56b9997791 | [
"LicenseRef-scancode-unknown-license-reference",
"BSL-1.0"
] | permissive | elvisbugs/BoostForArduino | 7e2427ded5fd030231918524f6a91554085a8e64 | b8c912bf671868e2182aa703ed34076c59acf474 | refs/heads/master | 2023-03-25T13:11:58.527671 | 2021-03-27T02:37:29 | 2021-03-27T02:37:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 61 | hpp | #include <boost/mpl/aux_/preprocessed/mwcw/not_equal_to.hpp>
| [
"[email protected]"
] | |
8ab09cbf085ceba1b55f83e0130e35261599c13b | a2cdee2002d22ab8812157e0c0513441976c7e2c | /algorithm/cpp/169.cpp | 9986d0785ced751eb05ad5dfdfe9ea7c7eb5292b | [] | no_license | authuir/leetcode | 065c205cbc6a2498aa4919a32b167ed64605a1ca | 9fe479fbcf0e64ed1a132bc0b6986a8f0c82581c | refs/heads/master | 2021-01-20T14:31:11.091259 | 2018-09-19T15:58:25 | 2018-09-19T15:58:25 | 90,624,148 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 758 | cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
int majorityElement(vector<int>& nums) {
int size = nums.size();
if (size == 1) return nums[0];
int cnt = size / 2;
sort(nums.begin(), nums.end());
vector<int>::iterator iter = nums.begin();
int now = *iter;
int now_cnt = 1;
iter++;
for (; iter != nums.end(); iter++)
{
if (*iter != now)
{
if (now_cnt > cnt)
{
return now;
}
else
{
now = *iter;
now_cnt = 1;
}
}
else
{
now_cnt++;
}
}
if (now_cnt > cnt)
{
return now;
}
return NULL;
}
};
int main(int argc, char * argv[])
{
Solution x;
cout << x.majorityElement(vector<int>{2,2});
return 0;
} | [
"[email protected]"
] | |
f0adc31add7edec30a940245551388ed6bcd744a | 4a634ad6eddcc372b7b02f0e0dfef93b74ac2879 | /acm/oj/codeforce/problems/ac/1023D.cpp | b9d404507fa3da4c44ceee844c6bef434c3d838c | [] | no_license | chilogen/workspace | 6e46d0724f7ce4f932a2c904e82d5cc6a6237e14 | 31f780d8e7c7020dbdece7f96a628ae8382c2703 | refs/heads/master | 2021-01-25T13:36:36.574867 | 2019-02-18T14:25:13 | 2019-02-18T14:25:13 | 123,596,604 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,420 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL n,q;
LL vis[200010]={0},a[200010];
struct SparseTable{
//array indentity from 0 to size-1
LL **ST;
LL num,slog;
SparseTable(){ST=NULL;}
SparseTable(LL size){init(size);}
void init(LL size){
LL i;
num=size;
//2^x<=size<2^(x+1)
slog=floor(log(size)/log(2));
ST=new LL*[size];
for(i=0;i<size;i++)ST[i]=new LL[slog];
}
void solve(LL *v){
LL i,j;
for(i=0;i<num;i++)ST[i][0]=v[i];
for(i=1;i<=slog;i++){
for(j=0;j<num;j++){
if(j+(1ll<<(i-1))>=num)break;
ST[j][i]=cmp(ST[j][i-1],ST[j+(1ll<<(i-1))][i-1]);
}
}
}
LL cmp(LL x,LL y){return min(x,y);}
LL RMQ(LL s,LL t){
if(s>t)return q;
LL qlog=floor(log(t-s+1)/log(2));
return cmp(ST[s][qlog],ST[t+1-(1ll<<qlog)][qlog]);
}
}ss;
bool check(){
LL i,k;
for(i=1;i<=n;i++){
if(vis[a[i]]!=-1){
k=ss.RMQ(vis[a[i]]+1,i-1);
if(k<a[i])return false;
}
vis[a[i]]=i;
}
return true;
}
void solve(){
LL i,j=-1,ma=0;
memset(vis,-1,sizeof(vis));
for(i=1,a[0]=1;i<=n;i++){
cin>>a[i];
ma=max(ma,a[i]);
if(a[i]==0){
j=i;
a[i]=a[i-1];
}
}
if(ma<q){
if(j==-1){
cout<<"NO\n";
return ;
}
a[j]=q;
}
ss.init(n+1);
ss.solve(a);
if(!check()){
cout<<"NO\n";
return ;
}
cout<<"YES\n";
for(i=1;i<=n;i++)cout<<a[i]<<" ";
}
int main(){
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
cin>>n>>q;
solve();
return 0;
} | [
"[email protected]"
] | |
6a7f957ee914c904c1cad41a3927994c3f4944d3 | ab68f19d88805c30618ecb6fdafa94a15ba876fe | /src/cleaning/interface/aberrant.cpp | 56451772c9398cfcbd188b4f907352bf7183b46c | [] | no_license | depixusgenome/trackanalysis | 3c7790907d646e94971b9756137fbc9d9eb118a3 | f9534e4fff9775ff45d08d401de61015d4a69e76 | refs/heads/master | 2022-11-13T11:17:46.161400 | 2019-12-16T14:49:23 | 2019-12-16T14:49:23 | 225,714,774 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,348 | cpp | #include "cleaning/interface/aberrant.h"
#include "cleaning/interface/rules_doc.h"
#include "cleaning/interface/datacleaning.h"
namespace cleaning::datacleaning::aberrant { namespace { // fromkwa specializations
using namespace cleaning::datacleaning;
template <typename T>
void _constant(py::object self, ndarray<T> pydata)
{
if(py::hasattr(self, "constants"))
self = self.attr("constants");
auto a = self.attr("mindeltarange").cast<size_t>();
auto b = self.attr("mindeltavalue").cast<T>();
ConstantValuesSuppressor<T> itm; itm.mindeltavalue = b; itm.mindeltarange = a;
itm.apply(pydata.size(), pydata.mutable_data());
}
template <typename T>
void _clip(py::object self, bool doclip, float azero, ndarray<T> pydata)
{
if(py::hasattr(self, "derivative"))
self = self.attr("constants");
auto a = self.attr("maxabsvalue").cast<T>();
auto b = self.attr("maxderivate").cast<T>();
DerivateSuppressor<T> itm; itm.maxabsvalue = a; itm.maxderivate = b;
itm.apply(pydata.size(), pydata.mutable_data(), doclip, azero);
}
}}
namespace cleaning::datacleaning::aberrant { namespace { // fromkwa specializations
using namespace py::literals;
using namespace cleaning::datacleaning;
void constants(py::module & mod)
{
using CLS = ConstantValuesSuppressor<float>;
auto doc = CONSTANT_DOC;
mod.def("constant", _constant<float>, "datacleaningobject"_a, "array"_a);
mod.def("constant", _constant<double>, "datacleaningobject"_a, "array"_a, doc);
py::class_<CLS> cls(mod, "ConstantValuesSuppressor", doc);
cls.def_readwrite("mindeltarange", &CLS::mindeltarange)
.def_readwrite("mindeltavalue", &CLS::mindeltavalue)
.def_static(
"zscaledattributes",
[]() { return py::make_tuple("mindeltavalue"); }
)
.def(
"rescale",
[](CLS const & self, float val)
{
auto cpy = self;
cpy.mindeltavalue *= val;
return cpy;
}
)
.def("apply",
[](CLS const & self, ndarray<float> arr)
{ self.apply(arr.size(), arr.mutable_data()); });
_defaults(cls);
}
void derivative(py::module & mod)
{
auto doc = DERIVATIVE_DOC;
mod.def("clip", _clip<float>,
"datacleaningobject"_a, "clip"_a, "zero"_a, "array"_a);
mod.def("clip", _clip<double>,
"datacleaningobject"_a, "clip"_a, "zero"_a, "array"_a, doc);
using CLS = DerivateSuppressor<float>;
py::class_<CLS> cls(mod, "DerivateSuppressor", doc);
cls.def_readwrite("maxderivate", &CLS::maxderivate)
.def_readwrite("maxabsvalue", &CLS::maxabsvalue)
.def_static(
"zscaledattributes",
[]() { return py::make_tuple("maxabsvalue", "maxderivate"); }
)
.def(
"rescale",
[](CLS const & self, float val)
{
auto cpy = self;
cpy.maxabsvalue *= val;
cpy.maxderivate *= val;
return cpy;
}
)
.def("apply",
[](CLS const & self, ndarray<float> arr, bool clip, float zero)
{ self.apply(arr.size(), arr.mutable_data(), clip, zero); });
_defaults(cls);
}
void localnans(py::module & mod)
{
using CLS = LocalNaNPopulation;
auto doc = R"_(Removes frames which have NaN values to their right and their left)_";
py::class_<CLS> cls(mod, "LocalNaNPopulation", doc);
cls.def_readwrite("window", &CLS::window)
.def_readwrite("ratio", &CLS::ratio)
.def("apply",
[](CLS const & self, ndarray<float> arr)
{ self.apply(arr.size(), arr.mutable_data()); });
_defaults(cls);
}
void nanislands(py::module & mod)
{
auto doc = NANISLANDS_DOC;
using CLS = NaNDerivateIslands;
py::class_<CLS> cls(mod, "NaNDerivateIslands", doc);
cls.def_readwrite("riverwidth", &CLS::riverwidth)
.def_readwrite("islandwidth", &CLS::islandwidth)
.def_readwrite("ratio", &CLS::ratio)
.def_readwrite("maxderivate", &CLS::maxderivate)
.def_static(
"zscaledattributes",
[]() { return py::make_tuple("maxderivate"); }
)
.def(
"rescale",
[](CLS const & self, float val)
{
auto cpy = self;
cpy.maxderivate *= val;
return cpy;
}
)
.def("apply", [](CLS const & self, ndarray<float> arr)
{ self.apply(arr.size(), arr.mutable_data()); });
_defaults(cls);
}
void abb(py::module & mod)
{
auto doc = ABB_DOC;
using CLS = AberrantValuesRule;
py::class_<CLS> cls(mod, "AberrantValuesRule", doc);
cls.def_readwrite("constants", &CLS::constants)
.def_readwrite("derivative", &CLS::derivative)
.def_readwrite("localnans", &CLS::localnans)
.def_readwrite("islands", &CLS::islands)
.def_static(
"zscaledattributes",
[]() {
return py::make_tuple(
"mindeltavalue", "maxabsvalue", "maxderivate", "cstmaxderivate"
);
}
)
.def(
"rescale",
[](CLS const & self, float val)
{
auto cpy = self;
cpy.constants.mindeltavalue *= val;
cpy.derivative.maxabsvalue *= val;
cpy.derivative.maxderivate *= val;
cpy.islands.maxderivate *= val;
return cpy;
}
)
.def("aberrant",
[](CLS const & self, ndarray<float> arr, bool clip, float ratio)
{
float * data = arr.mutable_data();
size_t sz = arr.size();
size_t cnt = sz;
{
py::gil_scoped_release _;
self.apply(sz, data, clip);
for(size_t i = 0u; i < sz; ++i)
if(!std::isfinite(data[i]))
--cnt;
}
return cnt < size_t(sz*ratio);
},
py::arg("beaddata"), py::arg("clip") = false, py::arg("ratio") = .8
);
_defaults(cls);
}
}}
namespace cleaning::datacleaning::aberrant {
void pymodule(py::module & mod)
{
constants(mod);
derivative(mod);
localnans(mod);
nanislands(mod);
abb(mod);
}
}
| [
"[email protected]"
] | |
18d180b84476844420fe6c15f5ee24a2655f749a | 9a79fabd36987c9c61dc75053ee4c16284f7511f | /cpp/153_find_minimum_in_rotated_sorted_array.cpp | c433ab111bf1fdd586c7a3ae71f40539727031cb | [] | no_license | longjianjiang/LeetOJ | 00485ef302c550f703ec4b08e0f402786e5abb54 | 8b6ccfc75fe24f9fea0e48008568e65f4a9e1c20 | refs/heads/master | 2023-09-01T16:44:21.134450 | 2023-08-27T09:15:34 | 2023-08-27T09:15:34 | 129,261,185 | 5 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,101 | cpp | #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
using namespace std;
// 给定被旋转的一个有序数组,也就是数组中存在两段有序,让我们找到最小值;PS:数组中的元素没有重复;
// 使用二分,每次找到mid后判断左右两边是否存在不是有序,如果存在,则去不是有序的一边,最小的值一定是在非有序这边。
// 直到只要两个元素,此时左右都有序,返回其中较小的即可。
// 如果nums只要一个元素,那么不会进行二分,直接返回nums[left]或者nums[right]
class Solution {
public:
int findMin(vector<int>& nums) {
if (nums.empty()) { return -1; }
int left = 0, right = nums.size() - 1;
while (left < right) {
int mid = left + (right - left) / 2;
if (nums[left] > nums[mid]) {
right = mid;
} else if (nums[mid+1] > nums[right]) {
left = mid+1;
} else {
return min(nums[left], nums[mid+1]);
}
}
return nums[right];
}
};
| [
"[email protected]"
] | |
d1a8de99e7c488c964ee64bedc889aaa1891acc1 | a4d35c899362a729c12f3c9a386865f4fdcad547 | /src/qt/askpassphrasedialog.cpp | 92293a02578ed44ffcaa50595bf55a2b90a35209 | [
"MIT"
] | permissive | nickpatel22/castorcoin---CAC | 08683376c1d287c6c0241e90384d1ea11581b35a | 0cba8b0d6a3f1799f18cde96122fb347f8d230e2 | refs/heads/main | 2023-08-11T20:15:35.156221 | 2021-09-17T10:37:37 | 2021-09-17T10:37:37 | 407,500,109 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,377 | cpp | // Copyright (c) 2011-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include "config/bitcoin-config.h"
#endif
#include "askpassphrasedialog.h"
#include "ui_askpassphrasedialog.h"
#include "guiconstants.h"
#include "walletmodel.h"
#include "support/allocators/secure.h"
#include <QKeyEvent>
#include <QMessageBox>
#include <QPushButton>
AskPassphraseDialog::AskPassphraseDialog(Mode _mode, QWidget *parent) :
QDialog(parent),
ui(new Ui::AskPassphraseDialog),
mode(_mode),
model(0),
fCapsLock(false)
{
ui->setupUi(this);
ui->passEdit1->setMinimumSize(ui->passEdit1->sizeHint());
ui->passEdit2->setMinimumSize(ui->passEdit2->sizeHint());
ui->passEdit3->setMinimumSize(ui->passEdit3->sizeHint());
ui->passEdit1->setMaxLength(MAX_PASSPHRASE_SIZE);
ui->passEdit2->setMaxLength(MAX_PASSPHRASE_SIZE);
ui->passEdit3->setMaxLength(MAX_PASSPHRASE_SIZE);
// Setup Caps Lock detection.
ui->passEdit1->installEventFilter(this);
ui->passEdit2->installEventFilter(this);
ui->passEdit3->installEventFilter(this);
switch(mode)
{
case Encrypt: // Ask passphrase x2
ui->warningLabel->setText(tr("Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>ten or more random characters</b>, or <b>eight or more words</b>."));
ui->passLabel1->hide();
ui->passEdit1->hide();
setWindowTitle(tr("Encrypt wallet"));
break;
case Unlock: // Ask passphrase
ui->warningLabel->setText(tr("This operation needs your wallet passphrase to unlock the wallet."));
ui->passLabel2->hide();
ui->passEdit2->hide();
ui->passLabel3->hide();
ui->passEdit3->hide();
setWindowTitle(tr("Unlock wallet"));
break;
case Decrypt: // Ask passphrase
ui->warningLabel->setText(tr("This operation needs your wallet passphrase to decrypt the wallet."));
ui->passLabel2->hide();
ui->passEdit2->hide();
ui->passLabel3->hide();
ui->passEdit3->hide();
setWindowTitle(tr("Decrypt wallet"));
break;
case ChangePass: // Ask old passphrase + new passphrase x2
setWindowTitle(tr("Change passphrase"));
ui->warningLabel->setText(tr("Enter the old passphrase and new passphrase to the wallet."));
break;
}
textChanged();
connect(ui->passEdit1, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
connect(ui->passEdit2, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
connect(ui->passEdit3, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
}
AskPassphraseDialog::~AskPassphraseDialog()
{
secureClearPassFields();
delete ui;
}
void AskPassphraseDialog::setModel(WalletModel *_model)
{
this->model = _model;
}
void AskPassphraseDialog::accept()
{
SecureString oldpass, newpass1, newpass2;
if(!model)
return;
oldpass.reserve(MAX_PASSPHRASE_SIZE);
newpass1.reserve(MAX_PASSPHRASE_SIZE);
newpass2.reserve(MAX_PASSPHRASE_SIZE);
// TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)
// Alternately, find a way to make this input mlock()'d to begin with.
oldpass.assign(ui->passEdit1->text().toStdString().c_str());
newpass1.assign(ui->passEdit2->text().toStdString().c_str());
newpass2.assign(ui->passEdit3->text().toStdString().c_str());
secureClearPassFields();
switch(mode)
{
case Encrypt: {
if(newpass1.empty() || newpass2.empty())
{
// Cannot encrypt with empty passphrase
break;
}
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm wallet encryption"),
tr("Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR LITECOINS</b>!") + "<br><br>" + tr("Are you sure you wish to encrypt your wallet?"),
QMessageBox::Yes|QMessageBox::Cancel,
QMessageBox::Cancel);
if(retval == QMessageBox::Yes)
{
if(newpass1 == newpass2)
{
if(model->setWalletEncrypted(true, newpass1))
{
QMessageBox::warning(this, tr("Wallet encrypted"),
"<qt>" +
tr("%1 will close now to finish the encryption process. "
"Remember that encrypting your wallet cannot fully protect "
"your castorcoins from being stolen by malware infecting your computer.").arg(tr(PACKAGE_NAME)) +
"<br><br><b>" +
tr("IMPORTANT: Any previous backups you have made of your wallet file "
"should be replaced with the newly generated, encrypted wallet file. "
"For security reasons, previous backups of the unencrypted wallet file "
"will become useless as soon as you start using the new, encrypted wallet.") +
"</b></qt>");
QApplication::quit();
}
else
{
QMessageBox::critical(this, tr("Wallet encryption failed"),
tr("Wallet encryption failed due to an internal error. Your wallet was not encrypted."));
}
QDialog::accept(); // Success
}
else
{
QMessageBox::critical(this, tr("Wallet encryption failed"),
tr("The supplied passphrases do not match."));
}
}
else
{
QDialog::reject(); // Cancelled
}
} break;
case Unlock:
if(!model->setWalletLocked(false, oldpass))
{
QMessageBox::critical(this, tr("Wallet unlock failed"),
tr("The passphrase entered for the wallet decryption was incorrect."));
}
else
{
QDialog::accept(); // Success
}
break;
case Decrypt:
if(!model->setWalletEncrypted(false, oldpass))
{
QMessageBox::critical(this, tr("Wallet decryption failed"),
tr("The passphrase entered for the wallet decryption was incorrect."));
}
else
{
QDialog::accept(); // Success
}
break;
case ChangePass:
if(newpass1 == newpass2)
{
if(model->changePassphrase(oldpass, newpass1))
{
QMessageBox::information(this, tr("Wallet encrypted"),
tr("Wallet passphrase was successfully changed."));
QDialog::accept(); // Success
}
else
{
QMessageBox::critical(this, tr("Wallet encryption failed"),
tr("The passphrase entered for the wallet decryption was incorrect."));
}
}
else
{
QMessageBox::critical(this, tr("Wallet encryption failed"),
tr("The supplied passphrases do not match."));
}
break;
}
}
void AskPassphraseDialog::textChanged()
{
// Validate input, set Ok button to enabled when acceptable
bool acceptable = false;
switch(mode)
{
case Encrypt: // New passphrase x2
acceptable = !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty();
break;
case Unlock: // Old passphrase x1
case Decrypt:
acceptable = !ui->passEdit1->text().isEmpty();
break;
case ChangePass: // Old passphrase x1, new passphrase x2
acceptable = !ui->passEdit1->text().isEmpty() && !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty();
break;
}
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(acceptable);
}
bool AskPassphraseDialog::event(QEvent *event)
{
// Detect Caps Lock key press.
if (event->type() == QEvent::KeyPress) {
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
if (ke->key() == Qt::Key_CapsLock) {
fCapsLock = !fCapsLock;
}
if (fCapsLock) {
ui->capsLabel->setText(tr("Warning: The Caps Lock key is on!"));
} else {
ui->capsLabel->clear();
}
}
return QWidget::event(event);
}
bool AskPassphraseDialog::eventFilter(QObject *object, QEvent *event)
{
/* Detect Caps Lock.
* There is no good OS-independent way to check a key state in Qt, but we
* can detect Caps Lock by checking for the following condition:
* Shift key is down and the result is a lower case character, or
* Shift key is not down and the result is an upper case character.
*/
if (event->type() == QEvent::KeyPress) {
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
QString str = ke->text();
if (str.length() != 0) {
const QChar *psz = str.unicode();
bool fShift = (ke->modifiers() & Qt::ShiftModifier) != 0;
if ((fShift && *psz >= 'a' && *psz <= 'z') || (!fShift && *psz >= 'A' && *psz <= 'Z')) {
fCapsLock = true;
ui->capsLabel->setText(tr("Warning: The Caps Lock key is on!"));
} else if (psz->isLetter()) {
fCapsLock = false;
ui->capsLabel->clear();
}
}
}
return QDialog::eventFilter(object, event);
}
static void SecureClearQLineEdit(QLineEdit* edit)
{
// Attempt to overwrite text so that they do not linger around in memory
edit->setText(QString(" ").repeated(edit->text().size()));
edit->clear();
}
void AskPassphraseDialog::secureClearPassFields()
{
SecureClearQLineEdit(ui->passEdit1);
SecureClearQLineEdit(ui->passEdit2);
SecureClearQLineEdit(ui->passEdit3);
}
| [
"[email protected]"
] | |
c045a658d930b83adba355b77dd6123d4c976bd6 | b27c21008763ac64591b091ca16dd938bf7fd5df | /src/vfdistributions.cpp | becbdbc505493556400cefcdacd1937e4af36aea | [] | no_license | nishbo/hem | b7bcc47991c4fa8c9d706617014565ef1dc6ef37 | 0c5e1e6b54a1feb5e394d59840725e9f77b40ffc | refs/heads/master | 2020-06-30T03:18:08.955970 | 2013-10-22T06:48:00 | 2013-10-22T06:48:00 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,471 | cpp | #include "vfdistributions.h"
int VFDistributions::buf0 = 0;
double VFDistributions::buf1 = 0;
double VFDistributions::buf2 = 0;
double VFDistributions::drand(){
return ((double) rand() / (RAND_MAX));
}
double VFDistributions::uniform(double min, double max){
return min + (max - min) * drand();
}
double VFDistributions::normal(double mean, double sd){
buf0 = 12; //accuracy
buf2 = 0.;
for (int i = 0; i < buf0; ++i)
buf2 += drand();
buf2 = buf2 - 6.;
buf2 = mean + sd * buf2;
return buf2;
}
double VFDistributions::normal(double mean, double sd, double from, double to){
if(to < from)
return 0;
if(to == from)
return from;
while(1){
buf2 = normal(mean, sd);
if(buf2 <= to && buf2 >= from)
break;
}
return buf2;
}
int VFDistributions::poisson(int lambda){
buf0 = 0;
buf1 = 0;
while(1){
buf1 -= log(drand());
if(buf1 >= lambda)
break;
buf0++;
}
return buf0;
}
double vf_distributions::uniform(double min, double max){
return VFDistributions::uniform(min, max);
}
double vf_distributions::normal(double mean, double sd){
return VFDistributions::normal(mean, sd);
}
double vf_distributions::normal(double mean, double sd, double from, double to){
return VFDistributions::normal(mean, sd, from, to);
}
int vf_distributions::poisson(int lambda){
return VFDistributions::poisson(lambda);
}
| [
"[email protected]"
] | |
5c442c6eb70304d1d5825605bf5873b5b13df3ff | c8bfd2dea152b5cd17e5a9753081c4fd08de9eda | /baekjoon-1149/baekjoon-1149/baekjoon-1149.cpp | 11e99a17b8f327cbd28c7ae1e5fe5f919ce43ec4 | [] | no_license | Quadroue4/Algorithm | c019c4105298fdbf63e2537d81fedc39271d3b3f | ca0a4ab88500386e60494fc2f07f8ac85d51aaa5 | refs/heads/main | 2023-08-19T10:12:46.969830 | 2021-10-13T13:57:04 | 2021-10-13T13:57:04 | 344,120,325 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 692 | cpp | // baekjoon-1149.cpp : 콘솔 응용 프로그램에 대한 진입점을 정의합니다.
//
#include "stdafx.h"
int main()
{
int N=0;
scanf_s("%d", &N);
int arr[1000][3];
int count = 0;
for (int i = 0; i < N; i++) {
for (int j = 0; j < 3; j++) {
int cost = 0;
scanf_s("%d", &cost);
arr[i][j] = cost;
}
count++;
}
for (int i = 0; i < N - 1; i++) {
for (int j = 0; j < 3; j++) {
int min = 9999999;
for (int k = 0; k < 3; k++) {
if (j != k) {
if (arr[i][k] < min)
min = arr[i][k];
}
}
arr[i+1][j] += min;
}
}
int min = 99999999;
for (int i = 0; i < 3; i++) {
if (arr[N - 1][i] < min)
min = arr[N - 1][i];
}
return min;
}
| [
"[email protected]"
] | |
adcc887d643765f771b9729f982c5695691bdb4b | 6baee502e5a169b06222e2f251f4d2b6c580a6ca | /Motor/Motor.cpp | 9682bcd6debfb291853fa3f7da6c9943a939deb5 | [] | no_license | MiloshHasCamo/Motor | 4fb4ff46d506bbfff426dc8db2ec96127a2e25a8 | 4a1f0bc9265ba0a1ccd197f9fac9c73163876954 | refs/heads/master | 2021-01-12T21:18:14.848361 | 2013-11-01T13:42:33 | 2013-11-01T13:42:33 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,146 | cpp | #include "Motor.h"
#include <gl\glut.h>
void ResetColor ( )
{
glColor3f ( 1.0f, 1.0f, 1.0f );
}
SDL_Surface* LoadImageFile ( const char* file )
{
SDL_Surface* loadedImage = NULL;
SDL_Surface* optimizedImage = NULL;
loadedImage = IMG_Load ( file );
if ( loadedImage != NULL )
{
optimizedImage = SDL_DisplayFormat ( loadedImage );
SDL_FreeSurface ( loadedImage );
}
return optimizedImage;
}
void RenderSurface ( int x, int y, SDL_Surface* src, SDL_Surface* dst )
{
SDL_Rect offset;
offset.x = x;
offset.y = y;
SDL_BlitSurface ( src, NULL, dst, &offset );
}
Window* Init ( int width, int height, char* ptitle, bool fullscreen )
{
SDL_Surface* pMainSurface = NULL;
Window* win = ( Window* ) malloc ( sizeof ( Window ) );
if ( fullscreen ) pMainSurface = SDL_SetVideoMode ( width, height, 32, SDL_OPENGL | SDL_FULLSCREEN );
else pMainSurface = SDL_SetVideoMode ( width, height, 32, SDL_OPENGL );
SDL_WM_SetCaption ( ptitle, NULL );
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
glEnable( GL_TEXTURE_2D );
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
glViewport( 0, 0, width, height );
glClear( GL_COLOR_BUFFER_BIT );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho ( 0.0f, width, height, 0.0f, -1.0f, 1000.0f );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glBlendFunc ( GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA );
glEnable ( GL_BLEND );
glewInit ( );
win->m_pMain = pMainSurface;
win->m_width = width;
win->m_height = height;
return win;
}
void RenderCube ( float size )
{
float difamb[] = { 1.0f, 0.5f, 0.3f, 1.0f };
glBegin(GL_QUADS);
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, difamb);
glNormal3f(0.0,0.0,1.0);
glVertex3f(size/2,size/2,size/2);
glVertex3f(-size/2,size/2,size/2);
glVertex3f(-size/2,-size/2,size/2);
glVertex3f(size/2,-size/2,size/2);
glNormal3f(-1.0,0.0,0.0);
glVertex3f(-size/2,size/2,size/2);
glVertex3f(-size/2,-size/2,size/2);
glVertex3f(-size/2,-size/2,-size/2);
glVertex3f(-size/2,size/2,-size/2);
glNormal3f(0.0,0.0,-1.0);
glVertex3f(size/2,size/2,-size/2);
glVertex3f(-size/2,size/2,-size/2);
glVertex3f(-size/2,-size/2,-size/2);
glVertex3f(size/2,-size/2,-size/2);
glNormal3f(1.0,0.0,0.0);
glVertex3f(size/2,size/2,size/2);
glVertex3f(size/2,-size/2,size/2);
glVertex3f(size/2,-size/2,-size/2);
glVertex3f(size/2,size/2,-size/2);
glNormal3f(0.0,1.0,0.0);
glVertex3f(size/2,size/2,size/2);
glVertex3f(-size/2,size/2,size/2);
glVertex3f(-size/2,size/2,-size/2);
glVertex3f(size/2,size/2,-size/2);
glNormal3f(0.0,-1.0,0.0);
glVertex3f(size/2,-size/2,size/2);
glVertex3f(-size/2,-size/2,size/2);
glVertex3f(-size/2,-size/2,-size/2);
glVertex3f(size/2,-size/2,-size/2);
glEnd();
}
void mtSwapBuffers ( void )
{
SDL_GL_SwapBuffers ( );
} | [
"Kremer"
] | Kremer |
bbe9fe23349c3f5a089de6202eb3f997cff5b9dc | 9f4d78761c9d187b8eb049530ce0ec4c2b9b2d78 | /Tools/ModelMigrate/FrontEnd/CMgaXslt.h | 6beddfd90d00aaa0fb971d407757daa788d051ad | [] | no_license | ksmyth/GME | d16c196632fbeab426df0857d068809a9b7c4ec9 | 873f0e394cf8f9a8178ffe406e3dd3b1093bf88b | refs/heads/master | 2023-01-25T03:33:59.342181 | 2023-01-23T19:22:37 | 2023-01-23T19:22:37 | 119,058,056 | 0 | 1 | null | 2019-11-26T20:54:31 | 2018-01-26T14:01:52 | C++ | UTF-8 | C++ | false | false | 151 | h |
#include <comdef.h>
class CXslt
{
public:
static void doNativeXslt(LPCTSTR stylesheet, LPCTSTR infile, LPCTSTR outfile, _bstr_t& error);
};
| [
"ksmyth@b35830b6-564f-0410-ac5f-b387e50cb686"
] | ksmyth@b35830b6-564f-0410-ac5f-b387e50cb686 |
e618fb7a0d228beb36c223dd5485fe7bcd506949 | b4405caa385b9807724de579906a6bb4844370fa | /src/content_widget/content_widget.h | 49562b44ab509cbc55dd0da6e00feb6c76056e1b | [] | no_license | eglrp/SatelliteDetectionSystem | 5c2533785f933ceded85bca85ba950de3ea239a0 | 874b8343497ab2a7f2eb2621ad8ae21de1f1e86c | refs/heads/master | 2020-04-07T04:23:16.289455 | 2017-09-02T07:55:52 | 2017-09-02T07:55:52 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 4,740 | h | #ifndef CONTENTWIDGET_H
#define CONTENTWIDGET_H
#include <QWidget>
#include <QDialog>
#include <QGridLayout>
#include <QVBoxLayout>
#include <QPushButton>
#include "datatype.h"
#include "qtpropertybrowser.h"
#include "qtpropertymanager.h"
#include "./DeviationInformation/DeviationInformation.h"
#include "./DOP/DopFrom.h"
#include "./sky/skyplot.h"
#include "./ReceiverLocationForm/ReceiverLocationForm.h"
#include "./FaultDetectionForm/FaultDetectionForm.h"
#include "./FaultDetectionResult/DetectionResultForm.h"
#include "./HPL/HPLForm.h"
class QLabel;
class QSplitter;
class QPushButton;
class QToolButton;
class QProgressBar;
struct TCMDParaHdrRec
{
unsigned int CMDID;
unsigned int MsgLEN;
unsigned int MsgNo;
unsigned int CMDPara;
};
//用户轨迹参数
struct TUserTrackRec
{
long long iTrackBDT;//轨迹时间 ms
unsigned int iTrackID; //轨迹数据序号
float fbeSimTime; //预推时间ms
double dUserPosX; //用户位置X
double dUserPosY; //用户位置Y
double dUserPosZ; //用户位置Z
double dUserVelX; //用户速度X
double dUserVelY; //用户速度Y
double dUserVelZ; //用户速度Z
double dUserAccX; //用户加速度X
double dUserAccY; //用户加速度Y
double dUserAccZ; //用户加速度Z
double dUserJekX; //用户加加速度X
double dUserJekY; //用户加加速度Y
double dUserJekZ; //用户加加速度Z
};
//用户轨迹参数传输--传输命令码0x0A5A5A05
struct TUserTrkTransRec
{
struct TCMDParaHdrRec sCmdHdr;
struct TUserTrackRec sUserTrk;
};
struct TUDPTrackTransRec
{
double dCMDID;
double dMsgLEN;
double dMsgNo;
double dCMDPara;
double dTrackBDT;//轨迹时间 ms
double dTrackID; //轨迹数据序号
double dbeSimTime; //预推时间ms
double dUserPosX; //用户位置X
double dUserPosY; //用户位置Y
double dUserPosZ; //用户位置Z
double dUserVelX; //用户速度X
double dUserVelY; //用户速度Y
double dUserVelZ; //用户速度Z
double dUserAccX; //用户加速度X
double dUserAccY; //用户加速度Y
double dUserAccZ; //用户加速度Z
double dUserJekX; //用户加加速度X
double dUserJekY; //用户加加速度Y
double dUserJekZ; //用户加加速度Z
};
class ContentWidget : public QWidget
{
Q_OBJECT
public:
explicit ContentWidget(QWidget *parent = 0);
void translateLanguage();
ContentWidget(FaultParametervalue &Value, QWidget *parent = 0);
/**
*私有函数
*/
private:
void initLeft();
void initRightTop();
void initRightCenter();
void initRightBottom();
void initRight();
void DrawSkyForm(); //绘制星空图
/**
*私有槽函数
*/
private slots:
void OkSlot();
void CloseSlot();
void startPause(); //开始-暂停槽函数
void stop(); //结束按钮
void openFile();
void constantFile();
private:
QSplitter *main_splitter;
QWidget *left_widget;
DeviationInformation *m_deviation;
DopFrom *m_dopfrom;
Skyplot *m_skyplot;
ReceiverLocationForm *m_receiverLocation;
FaultDetectionForm *m_faultDetectionForm;
DetectionResultForm *m_detetionResultForm;
HPLForm *m_HPLForm;
QSplitter *right_splitter;
QWidget *right_widget;
QWidget *right_top_widget;
QLabel *name_label;
QToolButton *menu_button;
QProgressBar *progress_bar;
QToolButton *grade_button;
QPushButton *open_file; //读取现有文件
QPushButton *constant_file; //实时文件
QWidget *right_center_widget;
QWidget *right_bottom_widget;
QToolButton *start_pause_btn; //运行+暂停
QToolButton *stop_btn; //结束
QtProperty *StarTime;
QtProperty *Length;
QtProperty *FaultType;
QtProperty *SatNo;
QtProperty *m_Value;
QtProperty *m_FalseAlarmRate;
QtProperty *m_MissedRate;
QtProperty *m_NoiseStandardDeviation;
QtIntPropertyManager *StarTimeManager;
QtIntPropertyManager *LengthManager;
QtEnumPropertyManager *FaultTypeManager;
QtIntPropertyManager *SatNoManager;
QtDoublePropertyManager *ValueManager;
QtDoublePropertyManager *FalseAlarmRateManager;
QtDoublePropertyManager *MissedRateManager;
QtDoublePropertyManager *NoiseStandardDeviationManager;
QPushButton *pushbuttonClose;
QPushButton *pushbuttonOk;
FaultParametervalue *m_data;
int glTrkDataID, glSndTimerLen, glOneTimeCnt, glDataIncCnt;
struct TUDPTrackTransRec lTrkTransAry[5000];//100ms一个点
QDateTime glCurrDTime;
int glSimStepCnt;
FILE *fpTrkLog;
char glTcpDatBuf[32768];
QString glsLogDatPathDir;
//TFileStream *pFileTrjWrPtr[RNSSMDLCNT];
int fGnssNewLogSimData(char * pData); //返回<0表示存储失败,=0表示不再转发,=1表示转发
void fGnssNewLogDatOver();//结束数据存储
bool glbIfRuning;
};
#endif // CONTENTWIDGET_H
| [
"[email protected]"
] | |
c665daabfc80ea7962b5b9b0c9ded6d12ad16ab0 | 8d5fe26b90cf4115cb6ba1c702502b507cf4f40b | /iPrintableDocumentDeal/MsOffice/Word2010/CCoAuthLock.h | 486e987e09b4ba7c363e454973aecd19d42e4e9e | [] | no_license | radtek/vs2015PackPrj | c6c6ec475014172c1dfffab98dd03bd7e257b273 | 605b49fab23cb3c4a427d48080ffa5e0807d79a7 | refs/heads/master | 2022-04-03T19:50:37.865876 | 2020-01-16T10:09:37 | 2020-01-16T10:09:37 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,656 | h | // 从类型库向导中用“添加类”创建的计算机生成的 IDispatch 包装类
#import "C:\\Program Files (x86)\\Microsoft Office\\Office14\\MSWORD.OLB" no_namespace
// CCoAuthLock 包装类
class CCoAuthLock : public COleDispatchDriver
{
public:
CCoAuthLock(){} // 调用 COleDispatchDriver 默认构造函数
CCoAuthLock(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
CCoAuthLock(const CCoAuthLock& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// 属性
public:
// 操作
public:
// CoAuthLock 方法
public:
LPDISPATCH get_Application()
{
LPDISPATCH result;
InvokeHelper(0x3e8, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
return result;
}
long get_Creator()
{
long result;
InvokeHelper(0x3e9, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
LPDISPATCH get_Parent()
{
LPDISPATCH result;
InvokeHelper(0x3ea, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
return result;
}
long get_Type()
{
long result;
InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
return result;
}
LPDISPATCH get_Owner()
{
LPDISPATCH result;
InvokeHelper(0x2, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
return result;
}
LPDISPATCH get_Range()
{
LPDISPATCH result;
InvokeHelper(0x3, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
return result;
}
BOOL get_HeaderFooter()
{
BOOL result;
InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
return result;
}
void Unlock()
{
InvokeHelper(0x6, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
// CoAuthLock 属性
public:
};
| [
"[email protected]"
] | |
4f3e0f8b6595c321600221d558c86101ff167779 | ec68c973b7cd3821dd70ed6787497a0f808e18e1 | /Cpp/SDK/BP_City_Pallet_B_Breakable_A_functions.cpp | 0601955c91de1123a3acffec7ae7f6b5b70c34d5 | [] | no_license | Hengle/zRemnant-SDK | 05be5801567a8cf67e8b03c50010f590d4e2599d | be2d99fb54f44a09ca52abc5f898e665964a24cb | refs/heads/main | 2023-07-16T04:44:43.113226 | 2021-08-27T14:26:40 | 2021-08-27T14:26:40 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,692 | cpp | // Name: Remnant, Version: 1.0
#include "../pch.h"
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Functions
//---------------------------------------------------------------------------
// Function BP_City_Pallet_B_Breakable_A.BP_City_Pallet_B_Breakable_A_C.BndEvt__Breakable_K2Node_ComponentBoundEvent_0_BreakableEvent__DelegateSignature
// ()
void ABP_City_Pallet_B_Breakable_A_C::BndEvt__Breakable_K2Node_ComponentBoundEvent_0_BreakableEvent__DelegateSignature()
{
static auto fn = UObject::FindObject<UFunction>("Function BP_City_Pallet_B_Breakable_A.BP_City_Pallet_B_Breakable_A_C.BndEvt__Breakable_K2Node_ComponentBoundEvent_0_BreakableEvent__DelegateSignature");
ABP_City_Pallet_B_Breakable_A_C_BndEvt__Breakable_K2Node_ComponentBoundEvent_0_BreakableEvent__DelegateSignature_Params params;
auto flags = fn->FunctionFlags;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
}
// Function BP_City_Pallet_B_Breakable_A.BP_City_Pallet_B_Breakable_A_C.ExecuteUbergraph_BP_City_Pallet_B_Breakable_A
// ()
void ABP_City_Pallet_B_Breakable_A_C::ExecuteUbergraph_BP_City_Pallet_B_Breakable_A()
{
static auto fn = UObject::FindObject<UFunction>("Function BP_City_Pallet_B_Breakable_A.BP_City_Pallet_B_Breakable_A_C.ExecuteUbergraph_BP_City_Pallet_B_Breakable_A");
ABP_City_Pallet_B_Breakable_A_C_ExecuteUbergraph_BP_City_Pallet_B_Breakable_A_Params params;
auto flags = fn->FunctionFlags;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
}
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"[email protected]"
] | |
c1810348881dd13d92a9a5de3099065b2833fac1 | aad6b08ee56c2760b207d562f16be0a5bb8e3e2a | /tags/Galegon1.0/BAL/Widgets/WebCore/SDL/BCContextMenuSDL.cpp | a0ba6a6531f999f7d58710d3dd5c1f7919b19eb9 | [] | no_license | Chengjian-Tang/owb-mirror | 5ffd127685d06f2c8e00832c63cd235bec63f753 | b48392a07a2f760bfc273d8d8b80e8d3f43b6b55 | refs/heads/master | 2021-05-27T02:09:03.654458 | 2010-06-23T11:10:12 | 2010-06-23T11:10:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,598 | cpp | /*
* Copyright (C) 2008 Pleyo. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
* 3. Neither the name of Pleyo nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY PLEYO AND ITS 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 PLEYO OR ITS 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.
*/
#include "config.h"
#include "ContextMenu.h"
#include "ContextMenuController.h"
#include <cstdio>
namespace WebCore {
// TODO: ref-counting correctness checking.
// See http://bugs.webkit.org/show_bug.cgi?id=16115
ContextMenu::ContextMenu(const HitTestResult& result)
: m_hitTestResult(result)
{
printf("ContextMenu::ContextMenu\n");
}
ContextMenu::~ContextMenu()
{
printf("ContextMenu::~ContextMenu\n");
}
void ContextMenu::appendItem(ContextMenuItem& item)
{
printf("ContextMenu::appendItem\n");
}
void ContextMenu::setPlatformDescription(PlatformMenuDescription menu)
{
printf("ContextMenu::setPlatformDescription\n");
}
PlatformMenuDescription ContextMenu::platformDescription() const
{
printf("ContextMenu::platformDescription\n");
return m_platformDescription;
}
PlatformMenuDescription ContextMenu::releasePlatformDescription()
{
printf("ContextMenu::releasePlatformDescriptio\n");
PlatformMenuDescription description = m_platformDescription;
m_platformDescription = 0;
return description;
}
}
| [
"mbensi@a3cd4a6d-042f-0410-9b26-d8d12826d3fb"
] | mbensi@a3cd4a6d-042f-0410-9b26-d8d12826d3fb |
5861e30371a38028834419bba6a08bed266aa71d | d19d3a43b1131d36565555ff56590a00b88209a8 | /projects/Project Dragon/src/ColorCorrection.cpp | 5975404a0130bf24db7148cc07e05b59ce684978 | [] | no_license | noah-glassford/Project-Dragon | 42c3f47598955503bef5fa21b3672df57a05848a | a0ba38854066801f723b6dbf30bd26f80d6cf86f | refs/heads/master | 2023-03-31T15:24:48.985790 | 2021-03-18T04:22:35 | 2021-03-18T04:22:35 | 335,527,237 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,017 | cpp | #include "ColorCorrection.h"
void ColorCorrectionEffect::Init(unsigned width, unsigned height)
{
int index = int(_buffers.size());
_buffers.push_back(new Framebuffer());
_buffers[index]->AddColorTarget(GL_RGBA8);
_buffers[index]->Init(width, height);
//loads the shaders
index = int(_shaders.size());
_shaders.push_back(Shader::Create());
_shaders[index]->LoadShaderPartFromFile("shader/passthrough_vert.glsl", GL_VERTEX_SHADER);
_shaders[index]->LoadShaderPartFromFile("shader/color_correction_frag.glsl", GL_FRAGMENT_SHADER);
_shaders[index]->Link();
PostEffect::Init(width, height);
}
void ColorCorrectionEffect::ApplyEffect(PostEffect* buffer)
{
BindShader(0);
buffer->BindColorAsTexture(0, 0, 0);
_LUT.bind(1);
_buffers[0]->RenderToFSQ();
_LUT.unbind(1);
UnbindShader();
}
void ColorCorrectionEffect::LoadLUT(std::string path)
{
LUT3D temp(path);
_LUT = temp;
}
void ColorCorrectionEffect::LoadLUT(std::string path, int index)
{
LUT3D temp(path);
_LUTS.push_back(temp);
}
| [
"[email protected]"
] | |
13b4d05fee1105f2d89f67c9f2dd091771649e9c | 95efaa256914926ac30acbb1a8c89c320c19bf40 | /HeGui/HAbstractGuiHandler.cpp | 4a192c517ed7a69a0b36416c14a8d3180a32cf87 | [] | no_license | mabo0001/QtCode | bc2d80446a160d97b4034fa1c068324ba939cb20 | 9038f05da33c870c1e9808791f03467dcc19a4ab | refs/heads/master | 2022-08-26T13:36:14.021944 | 2019-07-15T01:12:51 | 2019-07-15T01:12:51 | 266,298,758 | 1 | 0 | null | 2020-05-23T08:54:08 | 2020-05-23T08:54:07 | null | UTF-8 | C++ | false | false | 681 | cpp | #include "HAbstractGuiHandler_p.h"
#include "HeCore/HAppContext.h"
#include <QtCore/QDebug>
HE_GUI_BEGIN_NAMESPACE
HAbstractGuiHandlerPrivate::HAbstractGuiHandlerPrivate()
{
mainWindow = HAppContext::getContextPointer<IMainWindow>("IMainWindow");
model = HAppContext::getContextPointer<IModel>("IModel");
}
HAbstractGuiHandler::HAbstractGuiHandler(QObject *parent) :
IGuiHandler(parent),
d_ptr(new HAbstractGuiHandlerPrivate)
{
}
HAbstractGuiHandler::HAbstractGuiHandler(HAbstractGuiHandlerPrivate &p, QObject *parent) :
IGuiHandler(parent),
d_ptr(&p)
{
}
HAbstractGuiHandler::~HAbstractGuiHandler()
{
qDebug() << __func__;
}
HE_GUI_END_NAMESPACE
| [
"[email protected]"
] | |
03cefd9ca2d5c4c0ea78bd15f92bca09d842e48b | e1ea3cc99aec14af97be34246399e9dd789a12dc | /src/test/timedata_tests.cpp | 7b8e49e2d36d4aa8464d4a9377bb02679f4d4ad6 | [
"MIT"
] | permissive | wzpurdy/FYRE | c38b4206b3ff5d906a144070f874a7e561f967d2 | e10b1d6003ec26abb517cc7b8c3fd4e3cc85032d | refs/heads/master | 2020-04-29T04:57:12.280930 | 2019-03-12T04:33:12 | 2019-03-12T04:33:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,016 | cpp | // Copyright (c) 2011-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
//
#include "timedata.h"
#include "test/test_fyre.h"
#include <boost/test/unit_test.hpp>
using namespace std;
BOOST_FIXTURE_TEST_SUITE(timedata_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(util_MedianFilter)
{
CMedianFilter<int> filter(5, 15);
BOOST_CHECK_EQUAL(filter.median(), 15);
filter.input(20); // [15 20]
BOOST_CHECK_EQUAL(filter.median(), 17);
filter.input(30); // [15 20 30]
BOOST_CHECK_EQUAL(filter.median(), 20);
filter.input(3); // [3 15 20 30]
BOOST_CHECK_EQUAL(filter.median(), 17);
filter.input(7); // [3 7 15 20 30]
BOOST_CHECK_EQUAL(filter.median(), 15);
filter.input(18); // [3 7 18 20 30]
BOOST_CHECK_EQUAL(filter.median(), 18);
filter.input(0); // [0 3 7 18 30]
BOOST_CHECK_EQUAL(filter.median(), 7);
}
BOOST_AUTO_TEST_SUITE_END()
| [
"[email protected]"
] | |
cae113a82445282cb04a52d182b5cefaa5f93912 | 683a90831bb591526c6786e5f8c4a2b34852cf99 | /HackerRank/DP/2_TheLongestIncreasingSubsequence_n2.c++ | a80bed746e3489233c23880e308937579ef0f11c | [] | no_license | dbetm/cp-history | 32a3ee0b19236a759ce0a6b9ba1b72ceb56b194d | 0ceeba631525c4776c21d547e5ab101f10c4fe70 | refs/heads/main | 2023-04-29T19:36:31.180763 | 2023-04-15T18:03:19 | 2023-04-15T18:03:19 | 164,786,056 | 8 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 735 | #include <bits/stdc++.h>
// Pasa 6 casos
using namespace std;
typedef vector<int> vec;
int lis(vec &, int);
void myFunction(int);
int main(void) {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
int n;
cin >> n;
vec arr(n);
for(int i = 0; i < n; i++) cin >> arr[i];
cout << lis(arr, n) << endl;
return 0;
}
int lis(vec &arr, int n) {
int l[n];
l[0] = 1;
for (int i = 0; i < n; i++) {
l[i] = 1;
for (int j = 0; j < i; j++) {
if(arr[i] > arr[j] && l[i] < l[j] + 1) l[i] = l[j] + 1;
}
}
/*
for_each(l, l+n, myFunction);
cout << endl;
*/
return *max_element(l, l+n);
}
void myFunction(int element) {
cout << element << " ";
}
| [
"[email protected]"
] | ||
9c1f51030c3a41c5f6c38afd5b05d90bcc2b2e06 | 0643f2a82fac92e5e6932a04a60ec53af60463a8 | /src/qt/networkstyle.cpp | 548ca9debfe3cc32c77c21c10b02e23754c45059 | [
"MIT"
] | permissive | LusoDev/lusocoin | 39bd16b096e253884dcb34c4015ea8fba6ff1010 | 005e798dc5dd0ebc5cc8a84b2a2103594b36dbde | refs/heads/master | 2019-03-20T19:00:49.948867 | 2018-09-13T01:12:21 | 2018-09-13T01:12:21 | 125,776,476 | 1 | 0 | MIT | 2018-08-04T19:51:13 | 2018-03-18T23:16:36 | C++ | UTF-8 | C++ | false | false | 3,894 | cpp | // Copyright (c) 2014 The Bitcoin Core developers
// Copyright (c) 2014-2017 The Dash Core developers
// Copyright (c) 2018 The Luso Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "networkstyle.h"
#include "guiconstants.h"
#include "guiutil.h"
#include <QApplication>
static const struct {
const char *networkId;
const char *appName;
const int iconColorHueShift;
const int iconColorSaturationReduction;
const char *titleAddText;
} network_styles[] = {
{"main", QAPP_APP_NAME_DEFAULT, 0, 0, ""},
{"test", QAPP_APP_NAME_TESTNET, 190, 20, QT_TRANSLATE_NOOP("SplashScreen", "[testnet]")},
{"regtest", QAPP_APP_NAME_TESTNET, 160, 30, "[regtest]"}
};
static const unsigned network_styles_count = sizeof(network_styles)/sizeof(*network_styles);
void NetworkStyle::rotateColors(QImage& img, const int iconColorHueShift, const int iconColorSaturationReduction) {
int h,s,l,a;
// traverse though lines
for(int y=0;y<img.height();y++)
{
QRgb *scL = reinterpret_cast< QRgb *>( img.scanLine( y ) );
// loop through pixels
for(int x=0;x<img.width();x++)
{
// preserve alpha because QColor::getHsl doesen't return the alpha value
a = qAlpha(scL[x]);
QColor col(scL[x]);
// get hue value
col.getHsl(&h,&s,&l);
// rotate color on RGB color circle
// 70° should end up with the typical "testnet" green (in bitcoin)
h+=iconColorHueShift;
// change saturation value
s -= iconColorSaturationReduction;
s = std::max(s, 0);
col.setHsl(h,s,l,a);
// set the pixel
scL[x] = col.rgba();
}
}
}
// titleAddText needs to be const char* for tr()
NetworkStyle::NetworkStyle(const QString &appName, const int iconColorHueShift, const int iconColorSaturationReduction, const char *titleAddText):
appName(appName),
titleAddText(qApp->translate("SplashScreen", titleAddText))
{
// Allow for separate UI settings for testnets
QApplication::setApplicationName(appName);
// Make sure settings migrated properly
GUIUtil::migrateQtSettings();
// Grab theme from settings
QString theme = GUIUtil::getThemeName();
// load pixmap
QPixmap appIconPixmap(":/icons/bitcoin");
QPixmap splashImagePixmap(":/images/" + theme + "/splash");
if(iconColorHueShift != 0 && iconColorSaturationReduction != 0)
{
// generate QImage from QPixmap
QImage appIconImg = appIconPixmap.toImage();
QImage splashImageImg = splashImagePixmap.toImage();
rotateColors(appIconImg, iconColorHueShift, iconColorSaturationReduction);
rotateColors(splashImageImg, iconColorHueShift, iconColorSaturationReduction);
//convert back to QPixmap
#if QT_VERSION >= 0x040700
appIconPixmap.convertFromImage(appIconImg);
splashImagePixmap.convertFromImage(splashImageImg);
#else
appIconPixmap = QPixmap::fromImage(appIconImg);
splashImagePixmap = QPixmap::fromImage(splashImageImg);
#endif
}
appIcon = QIcon(appIconPixmap);
trayAndWindowIcon = QIcon(appIconPixmap.scaled(QSize(256,256)));
splashImage = splashImagePixmap;
}
const NetworkStyle *NetworkStyle::instantiate(const QString &networkId)
{
for (unsigned x=0; x<network_styles_count; ++x)
{
if (networkId == network_styles[x].networkId)
{
return new NetworkStyle(
network_styles[x].appName,
network_styles[x].iconColorHueShift,
network_styles[x].iconColorSaturationReduction,
network_styles[x].titleAddText);
}
}
return 0;
}
| [
"[email protected]"
] | |
6a11541f3190aa3cdf8ea1aa2aae10a9029ec58a | 4846aa9a3691eb057a9343666d742e14fa4230f8 | /nCurses/test.cpp | 870e5253cc311dac1169a97aaafed7312b25784f | [] | no_license | baileywickham/cProjects | b10432f315660843329c2ba04cf1655faa672d59 | 01680ba3d42aadf788481f2dc2714d395ac202f9 | refs/heads/master | 2018-12-21T20:01:56.039263 | 2018-09-29T23:43:35 | 2018-09-29T23:43:35 | 119,561,950 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,380 | cpp | #include <ncurses.h>
WINDOW *create_newwin(int height, int width, int starty, int startx);
void destroy_win(WINDOW *local_win);
int main(int argc, char *argv[])
{ WINDOW *my_win;
int startx, starty, width, height;
int ch;
initscr();
cbreak();
keypad(stdscr, TRUE); /* I need that nifty F1 */
height = 3;
width = 10;
starty = (LINES - height) / 2; /* Calculating for a center placement */
startx = (COLS - width) / 2; /* of the window */
printw("Press F1 to exit");
refresh();
my_win = create_newwin(height, width, starty, startx);
while((ch = getch()) != KEY_F(1))
{ switch(ch)
{ case KEY_LEFT:
destroy_win(my_win);
my_win = create_newwin(height, width, starty,--startx);
break;
case KEY_RIGHT:
destroy_win(my_win);
my_win = create_newwin(height, width, starty,++startx);
break;
case KEY_UP:
destroy_win(my_win);
my_win = create_newwin(height, width, --starty,startx);
break;
case KEY_DOWN:
destroy_win(my_win);
my_win = create_newwin(height, width, ++starty,startx);
break;
}
}
endwin(); /* End curses mode */
return 0;
}
WINDOW *create_newwin(int height, int width, int starty, int startx)
{ WINDOW *local_win;
local_win = newwin(height, width, starty, startx);
box(local_win, 0 , 0); /* 0, 0 gives default characters
* for the vertical and horizontal
* lines */
wrefresh(local_win); /* Show that box */
return local_win;
}
void destroy_win(WINDOW *local_win)
{
/* box(local_win, ' ', ' '); : This won't produce the desired
* result of erasing the window. It will leave it's four corners
* and so an ugly remnant of window.
*/
wborder(local_win, ' ', ' ', ' ',' ',' ',' ',' ',' ');
/* The parameters taken are
* 1. win: the window on which to operate
* 2. ls: character to be used for the left side of the window
* 3. rs: character to be used for the right side of the window
* 4. ts: character to be used for the top side of the window
* 5. bs: character to be used for the bottom side of the window
* 6. tl: character to be used for the top left corner of the window
* 7. tr: character to be used for the top right corner of the window
* 8. bl: character to be used for the bottom left corner of the window
* 9. br: character to be used for the bottom right corner of the window
*/
wrefresh(local_win);
delwin(local_win);
} | [
"[email protected]"
] | |
8a797113f03121cbf2bb2fc408711c2c59733faa | d34960c2d9a84ad0639005b86d79b3a0553292ab | /boost/boost/geometry/algorithms/detail/buffer/turn_in_original_visitor.hpp | 33fbb5a4c474d8705477d0c2405295d6be93424b | [
"BSL-1.0",
"Apache-2.0"
] | permissive | tonystone/geofeatures | 413c13ebd47ee6676196399d47f5e23ba5345287 | 25aca530a9140b3f259e9ee0833c93522e83a697 | refs/heads/master | 2020-04-09T12:44:36.472701 | 2019-03-17T01:37:55 | 2019-03-17T01:37:55 | 41,232,751 | 28 | 9 | NOASSERTION | 2019-03-17T01:37:56 | 2015-08-23T02:35:40 | C++ | UTF-8 | C++ | false | false | 7,773 | hpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2014 Barend Gehrels, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to 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)
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_TURN_IN_ORIGINAL_VISITOR
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_TURN_IN_ORIGINAL_VISITOR
#include <boost/core/ignore_unused.hpp>
#include <boost/geometry/algorithms/expand.hpp>
#include <boost/geometry/strategies/agnostic/point_in_poly_winding.hpp>
#include <boost/geometry/strategies/buffer.hpp>
namespace geofeatures_boost {} namespace boost = geofeatures_boost; namespace geofeatures_boost { namespace geometry
{
#ifndef DOXYGEN_NO_DETAIL
namespace detail { namespace buffer
{
struct original_get_box
{
template <typename Box, typename Original>
static inline void apply(Box& total, Original const& original)
{
geometry::expand(total, original.m_box);
}
};
struct original_ovelaps_box
{
template <typename Box, typename Original>
static inline bool apply(Box const& box, Original const& original)
{
return ! detail::disjoint::disjoint_box_box(box, original.m_box);
}
};
struct include_turn_policy
{
template <typename Turn>
static inline bool apply(Turn const& turn)
{
return turn.location == location_ok;
}
};
struct turn_in_original_ovelaps_box
{
template <typename Box, typename Turn>
static inline bool apply(Box const& box, Turn const& turn)
{
if (turn.location != location_ok || turn.within_original)
{
// Skip all points already processed
return false;
}
return ! geometry::detail::disjoint::disjoint_point_box(
turn.robust_point, box);
}
};
//! Check if specified is in range of specified iterators
//! Return value of strategy (true if we can bail out)
template
<
typename Strategy,
typename State,
typename Point,
typename Iterator
>
inline bool point_in_range(Strategy& strategy, State& state,
Point const& point, Iterator begin, Iterator end)
{
geofeatures_boost::ignore_unused(strategy);
Iterator it = begin;
for (Iterator previous = it++; it != end; ++previous, ++it)
{
if (! strategy.apply(point, *previous, *it, state))
{
// We're probably on the boundary
return false;
}
}
return true;
}
template
<
typename Strategy,
typename State,
typename Point,
typename CoordinateType,
typename Iterator
>
inline bool point_in_section(Strategy& strategy, State& state,
Point const& point, CoordinateType const& point_y,
Iterator begin, Iterator end,
int direction)
{
if (direction == 0)
{
// Not a monotonic section, or no change in Y-direction
return point_in_range(strategy, state, point, begin, end);
}
// We're in a monotonic section in y-direction
Iterator it = begin;
for (Iterator previous = it++; it != end; ++previous, ++it)
{
// Depending on sections.direction we can quit for this section
CoordinateType const previous_y = geometry::get<1>(*previous);
if (direction == 1 && point_y < previous_y)
{
// Section goes upwards, y increases, point is is below section
return true;
}
else if (direction == -1 && point_y > previous_y)
{
// Section goes downwards, y decreases, point is above section
return true;
}
if (! strategy.apply(point, *previous, *it, state))
{
// We're probably on the boundary
return false;
}
}
return true;
}
template <typename Point, typename Original>
inline int point_in_original(Point const& point, Original const& original)
{
typedef strategy::within::winding<Point> strategy_type;
typename strategy_type::state_type state;
strategy_type strategy;
if (geofeatures_boost::size(original.m_sections) == 0
|| geofeatures_boost::size(original.m_ring) - geofeatures_boost::size(original.m_sections) < 16)
{
// There are no sections, or it does not profit to walk over sections
// instead of over points. Boundary of 16 is arbitrary but can influence
// performance
point_in_range(strategy, state, point,
original.m_ring.begin(), original.m_ring.end());
return strategy.result(state);
}
typedef typename Original::sections_type sections_type;
typedef typename geofeatures_boost::range_iterator<sections_type const>::type iterator_type;
typedef typename geofeatures_boost::range_value<sections_type const>::type section_type;
typedef typename geometry::coordinate_type<Point>::type coordinate_type;
coordinate_type const point_y = geometry::get<1>(point);
// Walk through all monotonic sections of this original
for (iterator_type it = geofeatures_boost::begin(original.m_sections);
it != geofeatures_boost::end(original.m_sections);
++it)
{
section_type const& section = *it;
if (! section.duplicate
&& section.begin_index < section.end_index
&& point_y >= geometry::get<min_corner, 1>(section.bounding_box)
&& point_y <= geometry::get<max_corner, 1>(section.bounding_box))
{
// y-coordinate of point overlaps with section
if (! point_in_section(strategy, state, point, point_y,
geofeatures_boost::begin(original.m_ring) + section.begin_index,
geofeatures_boost::begin(original.m_ring) + section.end_index + 1,
section.directions[0]))
{
// We're probably on the boundary
break;
}
}
}
return strategy.result(state);
}
template <typename Turns>
class turn_in_original_visitor
{
public:
turn_in_original_visitor(Turns& turns)
: m_mutable_turns(turns)
{}
template <typename Turn, typename Original>
inline void apply(Turn const& turn, Original const& original, bool first = true)
{
geofeatures_boost::ignore_unused_variable_warning(first);
if (turn.location != location_ok || turn.within_original)
{
// Skip all points already processed
return;
}
if (geometry::disjoint(turn.robust_point, original.m_box))
{
// Skip all disjoint
return;
}
int const code = point_in_original(turn.robust_point, original);
if (code == -1)
{
return;
}
Turn& mutable_turn = m_mutable_turns[turn.turn_index];
if (code == 0)
{
// On border of original: always discard
mutable_turn.location = location_discard;
}
// Point is inside an original ring
if (original.m_is_interior)
{
mutable_turn.count_in_original--;
}
else if (original.m_has_interiors)
{
mutable_turn.count_in_original++;
}
else
{
// It is an exterior ring and there are no interior rings.
// Then we are completely ready with this turn
mutable_turn.within_original = true;
mutable_turn.count_in_original = 1;
}
}
private :
Turns& m_mutable_turns;
};
}} // namespace detail::buffer
#endif // DOXYGEN_NO_DETAIL
}} // namespace geofeatures_boost::geometry
#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_TURN_IN_ORIGINAL_VISITOR
| [
"[email protected]"
] | |
38e0c1249c6fe162a1dda535bc2000dccb5b9589 | 1f3d6ce8e975268ee3602bf6f561f06039bd9240 | /src/dawn/SeaweedModelDawn.cpp | e96a3119c9c7624d6fc7c25fe2f5a7286cd80741 | [
"BSD-3-Clause"
] | permissive | Jiawei-Shao/Aquarium_GN | 92c29017d87ae5b693f9d17dca0eb554399fcbe5 | 02b780b2306ade32366d27b22d73d9c96a3f5e4c | refs/heads/master | 2020-04-26T02:41:20.455393 | 2019-03-13T12:51:23 | 2019-03-13T12:51:23 | 173,242,130 | 0 | 0 | BSD-3-Clause | 2019-03-13T10:43:15 | 2019-03-01T05:46:59 | C++ | UTF-8 | C++ | false | false | 5,006 | cpp | //
// Copyright (c) 2019 The WebGLNativePorts Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// SeaweenModelDawn: Implements seaweed model of Dawn.
#include "SeaweedModelDawn.h"
SeaweedModelDawn::SeaweedModelDawn(const Context* context, Aquarium* aquarium, MODELGROUP type, MODELNAME name, bool blend)
: SeaweedModel(type, name, blend), instance(0)
{
contextDawn = static_cast<const ContextDawn*>(context);
mAquarium = aquarium;
lightFactorUniforms.shininess = 50.0f;
lightFactorUniforms.specularFactor = 1.0f;
}
void SeaweedModelDawn::init()
{
programDawn = static_cast<ProgramDawn *>(mProgram);
diffuseTexture = static_cast<TextureDawn*>(textureMap["diffuse"]);
normalTexture = static_cast<TextureDawn*>(textureMap["normalMap"]);
reflectionTexture = static_cast<TextureDawn*>(textureMap["reflectionMap"]);
skyboxTexture = static_cast<TextureDawn*>(textureMap["skybox"]);
positionBuffer = static_cast<BufferDawn*>(bufferMap["position"]);
normalBuffer = static_cast<BufferDawn*>(bufferMap["normal"]);
texCoordBuffer = static_cast<BufferDawn*>(bufferMap["texCoord"]);
indicesBuffer = static_cast<BufferDawn*>(bufferMap["indices"]);
inputState = contextDawn->createInputState({
{ 0, 0, dawn::VertexFormat::FloatR32G32B32, 0 },
{ 1, 1, dawn::VertexFormat::FloatR32G32B32, 0 },
{ 2, 2, dawn::VertexFormat::FloatR32G32, 0 },
}, {
{ 0, positionBuffer->getDataSize(), dawn::InputStepMode::Vertex },
{ 1, normalBuffer->getDataSize(), dawn::InputStepMode::Vertex },
{ 2, texCoordBuffer->getDataSize(), dawn::InputStepMode::Vertex },
});
groupLayoutModel = contextDawn->MakeBindGroupLayout({
{ 0, dawn::ShaderStageBit::Fragment, dawn::BindingType::UniformBuffer },
{ 1, dawn::ShaderStageBit::Fragment, dawn::BindingType::Sampler },
{ 2, dawn::ShaderStageBit::Fragment, dawn::BindingType::SampledTexture },
});
groupLayoutPer = contextDawn->MakeBindGroupLayout({
{ 0, dawn::ShaderStageBit::Vertex, dawn::BindingType::UniformBuffer},
{ 1, dawn::ShaderStageBit::Vertex, dawn::BindingType::UniformBuffer},
});
pipelineLayout = contextDawn->MakeBasicPipelineLayout({ contextDawn->groupLayoutGeneral,
contextDawn->groupLayoutWorld,
groupLayoutModel,
groupLayoutPer,
});
pipeline = contextDawn->createRenderPipeline(pipelineLayout, programDawn, inputState, mBlend);
lightFactorBuffer = contextDawn->createBufferFromData(
&lightFactorUniforms, sizeof(lightFactorUniforms),
dawn::BufferUsageBit::TransferDst | dawn::BufferUsageBit::Uniform);
timeBuffer = contextDawn->createBufferFromData(&seaweedPer, sizeof(seaweedPer), dawn::BufferUsageBit::TransferDst | dawn::BufferUsageBit::Uniform);
viewBuffer = contextDawn->createBufferFromData(
&viewUniformPer, sizeof(ViewUniformPer),
dawn::BufferUsageBit::TransferDst | dawn::BufferUsageBit::Uniform);
bindGroupModel = contextDawn->makeBindGroup(groupLayoutModel, {
{ 0, lightFactorBuffer, 0, sizeof(LightFactorUniforms) },
{ 1, diffuseTexture->getSampler() },
{ 2, diffuseTexture->getTextureView() },
});
bindGroupPer = contextDawn->makeBindGroup(groupLayoutPer, {
{ 0, viewBuffer, 0, sizeof(ViewUniformPer)},
{ 1, timeBuffer, 0, sizeof(SeaweedPer) },
});
contextDawn->setBufferData(lightFactorBuffer, 0, sizeof(lightFactorUniforms), &lightFactorUniforms);
}
void SeaweedModelDawn::preDraw() const
{
contextDawn->setBufferData(viewBuffer, 0, sizeof(ViewUniformPer), &viewUniformPer);
contextDawn->setBufferData(timeBuffer, 0, sizeof(SeaweedPer), &seaweedPer);
}
void SeaweedModelDawn::draw()
{
uint32_t vertexBufferOffsets[1] = { 0 };
dawn::RenderPassEncoder pass = contextDawn->pass;
pass.SetPipeline(pipeline);
pass.SetBindGroup(0, contextDawn->bindGroupGeneral);
pass.SetBindGroup(1, contextDawn->bindGroupWorld);
pass.SetBindGroup(2, bindGroupModel);
pass.SetBindGroup(3, bindGroupPer);
pass.SetVertexBuffers(0, 1, &positionBuffer->getBuffer(), vertexBufferOffsets);
pass.SetVertexBuffers(1, 1, &normalBuffer->getBuffer(), vertexBufferOffsets);
pass.SetVertexBuffers(2, 1, &texCoordBuffer->getBuffer(), vertexBufferOffsets);
pass.SetIndexBuffer(indicesBuffer->getBuffer(), 0);
pass.DrawIndexed(indicesBuffer->getTotalComponents(), instance, 0, 0, 0);
instance = 0;
}
void SeaweedModelDawn::updatePerInstanceUniforms(ViewUniforms *viewUniforms)
{
viewUniformPer.viewuniforms[instance] = *viewUniforms;
seaweedPer.time[instance] = mAquarium->g.mclock + instance;
instance++;
}
void SeaweedModelDawn::updateSeaweedModelTime(float time)
{
}
| [
"[email protected]"
] | |
0c1d3cf302ae1b96ad00ba657be923f6c6201505 | 8647138abceab67757e89d8f6332ac949946bc95 | /netTools/trunk/message_output/serverCplus/MailMessage.pb.h | 8b0ac970e6510ba63e81fcab766036a662bc23e7 | [] | no_license | skmioo/SkmiooStore | 18ef8f4e329cd82a4a73d75f641145f5faf95fd9 | 2928f75aece1df56235ade83e1b5705a665a8e67 | refs/heads/master | 2023-07-02T01:24:24.788657 | 2023-06-14T07:33:14 | 2023-06-14T07:33:14 | 156,471,699 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | true | 69,531 | h | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: MailMessage.proto
#ifndef PROTOBUF_MailMessage_2eproto__INCLUDED
#define PROTOBUF_MailMessage_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 2006000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 2006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/unknown_field_set.h>
#include "BackpackMessage.pb.h"
// @@protoc_insertion_point(includes)
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_MailMessage_2eproto();
void protobuf_AssignDesc_MailMessage_2eproto();
void protobuf_ShutdownFile_MailMessage_2eproto();
class MailInfo;
class GCSendMailStatus;
class CGSendMail2Player;
class GCSendMail2Player;
class GCSysSendMail2Player;
class CGGetMailList;
class GCGetMailList;
class CGReadMail;
class GCReadMail;
class CGGetItemInMail;
class GCGetItemInMail;
class CGDelMail;
class GCDelMail;
// ===================================================================
class MailInfo : public ::google::protobuf::Message {
public:
MailInfo();
virtual ~MailInfo();
MailInfo(const MailInfo& from);
inline MailInfo& operator=(const MailInfo& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const MailInfo& default_instance();
void Swap(MailInfo* other);
// implements Message ----------------------------------------------
MailInfo* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const MailInfo& from);
void MergeFrom(const MailInfo& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int64 mailID = 1;
inline bool has_mailid() const;
inline void clear_mailid();
static const int kMailIDFieldNumber = 1;
inline ::google::protobuf::int64 mailid() const;
inline void set_mailid(::google::protobuf::int64 value);
// optional int64 receivePlayerID = 2;
inline bool has_receiveplayerid() const;
inline void clear_receiveplayerid();
static const int kReceivePlayerIDFieldNumber = 2;
inline ::google::protobuf::int64 receiveplayerid() const;
inline void set_receiveplayerid(::google::protobuf::int64 value);
// optional int32 sendType = 3;
inline bool has_sendtype() const;
inline void clear_sendtype();
static const int kSendTypeFieldNumber = 3;
inline ::google::protobuf::int32 sendtype() const;
inline void set_sendtype(::google::protobuf::int32 value);
// optional int64 playerID = 4;
inline bool has_playerid() const;
inline void clear_playerid();
static const int kPlayerIDFieldNumber = 4;
inline ::google::protobuf::int64 playerid() const;
inline void set_playerid(::google::protobuf::int64 value);
// optional string sendName = 5;
inline bool has_sendname() const;
inline void clear_sendname();
static const int kSendNameFieldNumber = 5;
inline const ::std::string& sendname() const;
inline void set_sendname(const ::std::string& value);
inline void set_sendname(const char* value);
inline void set_sendname(const char* value, size_t size);
inline ::std::string* mutable_sendname();
inline ::std::string* release_sendname();
inline void set_allocated_sendname(::std::string* sendname);
// optional string content = 6;
inline bool has_content() const;
inline void clear_content();
static const int kContentFieldNumber = 6;
inline const ::std::string& content() const;
inline void set_content(const ::std::string& value);
inline void set_content(const char* value);
inline void set_content(const char* value, size_t size);
inline ::std::string* mutable_content();
inline ::std::string* release_content();
inline void set_allocated_content(::std::string* content);
// repeated .BackpackItem items = 7;
inline int items_size() const;
inline void clear_items();
static const int kItemsFieldNumber = 7;
inline const ::BackpackItem& items(int index) const;
inline ::BackpackItem* mutable_items(int index);
inline ::BackpackItem* add_items();
inline const ::google::protobuf::RepeatedPtrField< ::BackpackItem >&
items() const;
inline ::google::protobuf::RepeatedPtrField< ::BackpackItem >*
mutable_items();
// optional int64 sendTime = 8;
inline bool has_sendtime() const;
inline void clear_sendtime();
static const int kSendTimeFieldNumber = 8;
inline ::google::protobuf::int64 sendtime() const;
inline void set_sendtime(::google::protobuf::int64 value);
// optional int32 state = 9;
inline bool has_state() const;
inline void clear_state();
static const int kStateFieldNumber = 9;
inline ::google::protobuf::int32 state() const;
inline void set_state(::google::protobuf::int32 value);
// optional string title = 10;
inline bool has_title() const;
inline void clear_title();
static const int kTitleFieldNumber = 10;
inline const ::std::string& title() const;
inline void set_title(const ::std::string& value);
inline void set_title(const char* value);
inline void set_title(const char* value, size_t size);
inline ::std::string* mutable_title();
inline ::std::string* release_title();
inline void set_allocated_title(::std::string* title);
// @@protoc_insertion_point(class_scope:MailInfo)
private:
inline void set_has_mailid();
inline void clear_has_mailid();
inline void set_has_receiveplayerid();
inline void clear_has_receiveplayerid();
inline void set_has_sendtype();
inline void clear_has_sendtype();
inline void set_has_playerid();
inline void clear_has_playerid();
inline void set_has_sendname();
inline void clear_has_sendname();
inline void set_has_content();
inline void clear_has_content();
inline void set_has_sendtime();
inline void clear_has_sendtime();
inline void set_has_state();
inline void clear_has_state();
inline void set_has_title();
inline void clear_has_title();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int64 mailid_;
::google::protobuf::int64 receiveplayerid_;
::google::protobuf::int64 playerid_;
::std::string* sendname_;
::std::string* content_;
::google::protobuf::int32 sendtype_;
::google::protobuf::int32 state_;
::google::protobuf::RepeatedPtrField< ::BackpackItem > items_;
::google::protobuf::int64 sendtime_;
::std::string* title_;
friend void protobuf_AddDesc_MailMessage_2eproto();
friend void protobuf_AssignDesc_MailMessage_2eproto();
friend void protobuf_ShutdownFile_MailMessage_2eproto();
void InitAsDefaultInstance();
static MailInfo* default_instance_;
};
// -------------------------------------------------------------------
class GCSendMailStatus : public ::google::protobuf::Message {
public:
GCSendMailStatus();
virtual ~GCSendMailStatus();
GCSendMailStatus(const GCSendMailStatus& from);
inline GCSendMailStatus& operator=(const GCSendMailStatus& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const GCSendMailStatus& default_instance();
void Swap(GCSendMailStatus* other);
// implements Message ----------------------------------------------
GCSendMailStatus* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const GCSendMailStatus& from);
void MergeFrom(const GCSendMailStatus& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 offRead = 1;
inline bool has_offread() const;
inline void clear_offread();
static const int kOffReadFieldNumber = 1;
inline ::google::protobuf::int32 offread() const;
inline void set_offread(::google::protobuf::int32 value);
// optional int32 total = 2;
inline bool has_total() const;
inline void clear_total();
static const int kTotalFieldNumber = 2;
inline ::google::protobuf::int32 total() const;
inline void set_total(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:GCSendMailStatus)
private:
inline void set_has_offread();
inline void clear_has_offread();
inline void set_has_total();
inline void clear_has_total();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 offread_;
::google::protobuf::int32 total_;
friend void protobuf_AddDesc_MailMessage_2eproto();
friend void protobuf_AssignDesc_MailMessage_2eproto();
friend void protobuf_ShutdownFile_MailMessage_2eproto();
void InitAsDefaultInstance();
static GCSendMailStatus* default_instance_;
};
// -------------------------------------------------------------------
class CGSendMail2Player : public ::google::protobuf::Message {
public:
CGSendMail2Player();
virtual ~CGSendMail2Player();
CGSendMail2Player(const CGSendMail2Player& from);
inline CGSendMail2Player& operator=(const CGSendMail2Player& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const CGSendMail2Player& default_instance();
void Swap(CGSendMail2Player* other);
// implements Message ----------------------------------------------
CGSendMail2Player* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const CGSendMail2Player& from);
void MergeFrom(const CGSendMail2Player& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .MailInfo mail = 1;
inline bool has_mail() const;
inline void clear_mail();
static const int kMailFieldNumber = 1;
inline const ::MailInfo& mail() const;
inline ::MailInfo* mutable_mail();
inline ::MailInfo* release_mail();
inline void set_allocated_mail(::MailInfo* mail);
// @@protoc_insertion_point(class_scope:CGSendMail2Player)
private:
inline void set_has_mail();
inline void clear_has_mail();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::MailInfo* mail_;
friend void protobuf_AddDesc_MailMessage_2eproto();
friend void protobuf_AssignDesc_MailMessage_2eproto();
friend void protobuf_ShutdownFile_MailMessage_2eproto();
void InitAsDefaultInstance();
static CGSendMail2Player* default_instance_;
};
// -------------------------------------------------------------------
class GCSendMail2Player : public ::google::protobuf::Message {
public:
GCSendMail2Player();
virtual ~GCSendMail2Player();
GCSendMail2Player(const GCSendMail2Player& from);
inline GCSendMail2Player& operator=(const GCSendMail2Player& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const GCSendMail2Player& default_instance();
void Swap(GCSendMail2Player* other);
// implements Message ----------------------------------------------
GCSendMail2Player* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const GCSendMail2Player& from);
void MergeFrom(const GCSendMail2Player& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int32 result = 1;
inline bool has_result() const;
inline void clear_result();
static const int kResultFieldNumber = 1;
inline ::google::protobuf::int32 result() const;
inline void set_result(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:GCSendMail2Player)
private:
inline void set_has_result();
inline void clear_has_result();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int32 result_;
friend void protobuf_AddDesc_MailMessage_2eproto();
friend void protobuf_AssignDesc_MailMessage_2eproto();
friend void protobuf_ShutdownFile_MailMessage_2eproto();
void InitAsDefaultInstance();
static GCSendMail2Player* default_instance_;
};
// -------------------------------------------------------------------
class GCSysSendMail2Player : public ::google::protobuf::Message {
public:
GCSysSendMail2Player();
virtual ~GCSysSendMail2Player();
GCSysSendMail2Player(const GCSysSendMail2Player& from);
inline GCSysSendMail2Player& operator=(const GCSysSendMail2Player& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const GCSysSendMail2Player& default_instance();
void Swap(GCSysSendMail2Player* other);
// implements Message ----------------------------------------------
GCSysSendMail2Player* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const GCSysSendMail2Player& from);
void MergeFrom(const GCSysSendMail2Player& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional .MailInfo mail = 1;
inline bool has_mail() const;
inline void clear_mail();
static const int kMailFieldNumber = 1;
inline const ::MailInfo& mail() const;
inline ::MailInfo* mutable_mail();
inline ::MailInfo* release_mail();
inline void set_allocated_mail(::MailInfo* mail);
// @@protoc_insertion_point(class_scope:GCSysSendMail2Player)
private:
inline void set_has_mail();
inline void clear_has_mail();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::MailInfo* mail_;
friend void protobuf_AddDesc_MailMessage_2eproto();
friend void protobuf_AssignDesc_MailMessage_2eproto();
friend void protobuf_ShutdownFile_MailMessage_2eproto();
void InitAsDefaultInstance();
static GCSysSendMail2Player* default_instance_;
};
// -------------------------------------------------------------------
class CGGetMailList : public ::google::protobuf::Message {
public:
CGGetMailList();
virtual ~CGGetMailList();
CGGetMailList(const CGGetMailList& from);
inline CGGetMailList& operator=(const CGGetMailList& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const CGGetMailList& default_instance();
void Swap(CGGetMailList* other);
// implements Message ----------------------------------------------
CGGetMailList* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const CGGetMailList& from);
void MergeFrom(const CGGetMailList& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int64 playerID = 1;
inline bool has_playerid() const;
inline void clear_playerid();
static const int kPlayerIDFieldNumber = 1;
inline ::google::protobuf::int64 playerid() const;
inline void set_playerid(::google::protobuf::int64 value);
// @@protoc_insertion_point(class_scope:CGGetMailList)
private:
inline void set_has_playerid();
inline void clear_has_playerid();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int64 playerid_;
friend void protobuf_AddDesc_MailMessage_2eproto();
friend void protobuf_AssignDesc_MailMessage_2eproto();
friend void protobuf_ShutdownFile_MailMessage_2eproto();
void InitAsDefaultInstance();
static CGGetMailList* default_instance_;
};
// -------------------------------------------------------------------
class GCGetMailList : public ::google::protobuf::Message {
public:
GCGetMailList();
virtual ~GCGetMailList();
GCGetMailList(const GCGetMailList& from);
inline GCGetMailList& operator=(const GCGetMailList& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const GCGetMailList& default_instance();
void Swap(GCGetMailList* other);
// implements Message ----------------------------------------------
GCGetMailList* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const GCGetMailList& from);
void MergeFrom(const GCGetMailList& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// repeated .MailInfo mails = 1;
inline int mails_size() const;
inline void clear_mails();
static const int kMailsFieldNumber = 1;
inline const ::MailInfo& mails(int index) const;
inline ::MailInfo* mutable_mails(int index);
inline ::MailInfo* add_mails();
inline const ::google::protobuf::RepeatedPtrField< ::MailInfo >&
mails() const;
inline ::google::protobuf::RepeatedPtrField< ::MailInfo >*
mutable_mails();
// @@protoc_insertion_point(class_scope:GCGetMailList)
private:
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::RepeatedPtrField< ::MailInfo > mails_;
friend void protobuf_AddDesc_MailMessage_2eproto();
friend void protobuf_AssignDesc_MailMessage_2eproto();
friend void protobuf_ShutdownFile_MailMessage_2eproto();
void InitAsDefaultInstance();
static GCGetMailList* default_instance_;
};
// -------------------------------------------------------------------
class CGReadMail : public ::google::protobuf::Message {
public:
CGReadMail();
virtual ~CGReadMail();
CGReadMail(const CGReadMail& from);
inline CGReadMail& operator=(const CGReadMail& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const CGReadMail& default_instance();
void Swap(CGReadMail* other);
// implements Message ----------------------------------------------
CGReadMail* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const CGReadMail& from);
void MergeFrom(const CGReadMail& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int64 mailID = 1;
inline bool has_mailid() const;
inline void clear_mailid();
static const int kMailIDFieldNumber = 1;
inline ::google::protobuf::int64 mailid() const;
inline void set_mailid(::google::protobuf::int64 value);
// @@protoc_insertion_point(class_scope:CGReadMail)
private:
inline void set_has_mailid();
inline void clear_has_mailid();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int64 mailid_;
friend void protobuf_AddDesc_MailMessage_2eproto();
friend void protobuf_AssignDesc_MailMessage_2eproto();
friend void protobuf_ShutdownFile_MailMessage_2eproto();
void InitAsDefaultInstance();
static CGReadMail* default_instance_;
};
// -------------------------------------------------------------------
class GCReadMail : public ::google::protobuf::Message {
public:
GCReadMail();
virtual ~GCReadMail();
GCReadMail(const GCReadMail& from);
inline GCReadMail& operator=(const GCReadMail& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const GCReadMail& default_instance();
void Swap(GCReadMail* other);
// implements Message ----------------------------------------------
GCReadMail* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const GCReadMail& from);
void MergeFrom(const GCReadMail& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional int64 mailID = 1;
inline bool has_mailid() const;
inline void clear_mailid();
static const int kMailIDFieldNumber = 1;
inline ::google::protobuf::int64 mailid() const;
inline void set_mailid(::google::protobuf::int64 value);
// optional int32 result = 2;
inline bool has_result() const;
inline void clear_result();
static const int kResultFieldNumber = 2;
inline ::google::protobuf::int32 result() const;
inline void set_result(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:GCReadMail)
private:
inline void set_has_mailid();
inline void clear_has_mailid();
inline void set_has_result();
inline void clear_has_result();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::int64 mailid_;
::google::protobuf::int32 result_;
friend void protobuf_AddDesc_MailMessage_2eproto();
friend void protobuf_AssignDesc_MailMessage_2eproto();
friend void protobuf_ShutdownFile_MailMessage_2eproto();
void InitAsDefaultInstance();
static GCReadMail* default_instance_;
};
// -------------------------------------------------------------------
class CGGetItemInMail : public ::google::protobuf::Message {
public:
CGGetItemInMail();
virtual ~CGGetItemInMail();
CGGetItemInMail(const CGGetItemInMail& from);
inline CGGetItemInMail& operator=(const CGGetItemInMail& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const CGGetItemInMail& default_instance();
void Swap(CGGetItemInMail* other);
// implements Message ----------------------------------------------
CGGetItemInMail* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const CGGetItemInMail& from);
void MergeFrom(const CGGetItemInMail& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// repeated int64 mailID = 1;
inline int mailid_size() const;
inline void clear_mailid();
static const int kMailIDFieldNumber = 1;
inline ::google::protobuf::int64 mailid(int index) const;
inline void set_mailid(int index, ::google::protobuf::int64 value);
inline void add_mailid(::google::protobuf::int64 value);
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
mailid() const;
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_mailid();
// @@protoc_insertion_point(class_scope:CGGetItemInMail)
private:
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > mailid_;
friend void protobuf_AddDesc_MailMessage_2eproto();
friend void protobuf_AssignDesc_MailMessage_2eproto();
friend void protobuf_ShutdownFile_MailMessage_2eproto();
void InitAsDefaultInstance();
static CGGetItemInMail* default_instance_;
};
// -------------------------------------------------------------------
class GCGetItemInMail : public ::google::protobuf::Message {
public:
GCGetItemInMail();
virtual ~GCGetItemInMail();
GCGetItemInMail(const GCGetItemInMail& from);
inline GCGetItemInMail& operator=(const GCGetItemInMail& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const GCGetItemInMail& default_instance();
void Swap(GCGetItemInMail* other);
// implements Message ----------------------------------------------
GCGetItemInMail* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const GCGetItemInMail& from);
void MergeFrom(const GCGetItemInMail& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// repeated int64 mailID = 1;
inline int mailid_size() const;
inline void clear_mailid();
static const int kMailIDFieldNumber = 1;
inline ::google::protobuf::int64 mailid(int index) const;
inline void set_mailid(int index, ::google::protobuf::int64 value);
inline void add_mailid(::google::protobuf::int64 value);
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
mailid() const;
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_mailid();
// optional int32 result = 2;
inline bool has_result() const;
inline void clear_result();
static const int kResultFieldNumber = 2;
inline ::google::protobuf::int32 result() const;
inline void set_result(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:GCGetItemInMail)
private:
inline void set_has_result();
inline void clear_has_result();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > mailid_;
::google::protobuf::int32 result_;
friend void protobuf_AddDesc_MailMessage_2eproto();
friend void protobuf_AssignDesc_MailMessage_2eproto();
friend void protobuf_ShutdownFile_MailMessage_2eproto();
void InitAsDefaultInstance();
static GCGetItemInMail* default_instance_;
};
// -------------------------------------------------------------------
class CGDelMail : public ::google::protobuf::Message {
public:
CGDelMail();
virtual ~CGDelMail();
CGDelMail(const CGDelMail& from);
inline CGDelMail& operator=(const CGDelMail& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const CGDelMail& default_instance();
void Swap(CGDelMail* other);
// implements Message ----------------------------------------------
CGDelMail* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const CGDelMail& from);
void MergeFrom(const CGDelMail& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// repeated int64 mailID = 1;
inline int mailid_size() const;
inline void clear_mailid();
static const int kMailIDFieldNumber = 1;
inline ::google::protobuf::int64 mailid(int index) const;
inline void set_mailid(int index, ::google::protobuf::int64 value);
inline void add_mailid(::google::protobuf::int64 value);
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
mailid() const;
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_mailid();
// @@protoc_insertion_point(class_scope:CGDelMail)
private:
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > mailid_;
friend void protobuf_AddDesc_MailMessage_2eproto();
friend void protobuf_AssignDesc_MailMessage_2eproto();
friend void protobuf_ShutdownFile_MailMessage_2eproto();
void InitAsDefaultInstance();
static CGDelMail* default_instance_;
};
// -------------------------------------------------------------------
class GCDelMail : public ::google::protobuf::Message {
public:
GCDelMail();
virtual ~GCDelMail();
GCDelMail(const GCDelMail& from);
inline GCDelMail& operator=(const GCDelMail& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const GCDelMail& default_instance();
void Swap(GCDelMail* other);
// implements Message ----------------------------------------------
GCDelMail* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const GCDelMail& from);
void MergeFrom(const GCDelMail& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// repeated int64 mailID = 1;
inline int mailid_size() const;
inline void clear_mailid();
static const int kMailIDFieldNumber = 1;
inline ::google::protobuf::int64 mailid(int index) const;
inline void set_mailid(int index, ::google::protobuf::int64 value);
inline void add_mailid(::google::protobuf::int64 value);
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
mailid() const;
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
mutable_mailid();
// optional int32 result = 2;
inline bool has_result() const;
inline void clear_result();
static const int kResultFieldNumber = 2;
inline ::google::protobuf::int32 result() const;
inline void set_result(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:GCDelMail)
private:
inline void set_has_result();
inline void clear_has_result();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::RepeatedField< ::google::protobuf::int64 > mailid_;
::google::protobuf::int32 result_;
friend void protobuf_AddDesc_MailMessage_2eproto();
friend void protobuf_AssignDesc_MailMessage_2eproto();
friend void protobuf_ShutdownFile_MailMessage_2eproto();
void InitAsDefaultInstance();
static GCDelMail* default_instance_;
};
// ===================================================================
// ===================================================================
// MailInfo
// optional int64 mailID = 1;
inline bool MailInfo::has_mailid() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void MailInfo::set_has_mailid() {
_has_bits_[0] |= 0x00000001u;
}
inline void MailInfo::clear_has_mailid() {
_has_bits_[0] &= ~0x00000001u;
}
inline void MailInfo::clear_mailid() {
mailid_ = GOOGLE_LONGLONG(0);
clear_has_mailid();
}
inline ::google::protobuf::int64 MailInfo::mailid() const {
// @@protoc_insertion_point(field_get:MailInfo.mailID)
return mailid_;
}
inline void MailInfo::set_mailid(::google::protobuf::int64 value) {
set_has_mailid();
mailid_ = value;
// @@protoc_insertion_point(field_set:MailInfo.mailID)
}
// optional int64 receivePlayerID = 2;
inline bool MailInfo::has_receiveplayerid() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void MailInfo::set_has_receiveplayerid() {
_has_bits_[0] |= 0x00000002u;
}
inline void MailInfo::clear_has_receiveplayerid() {
_has_bits_[0] &= ~0x00000002u;
}
inline void MailInfo::clear_receiveplayerid() {
receiveplayerid_ = GOOGLE_LONGLONG(0);
clear_has_receiveplayerid();
}
inline ::google::protobuf::int64 MailInfo::receiveplayerid() const {
// @@protoc_insertion_point(field_get:MailInfo.receivePlayerID)
return receiveplayerid_;
}
inline void MailInfo::set_receiveplayerid(::google::protobuf::int64 value) {
set_has_receiveplayerid();
receiveplayerid_ = value;
// @@protoc_insertion_point(field_set:MailInfo.receivePlayerID)
}
// optional int32 sendType = 3;
inline bool MailInfo::has_sendtype() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void MailInfo::set_has_sendtype() {
_has_bits_[0] |= 0x00000004u;
}
inline void MailInfo::clear_has_sendtype() {
_has_bits_[0] &= ~0x00000004u;
}
inline void MailInfo::clear_sendtype() {
sendtype_ = 0;
clear_has_sendtype();
}
inline ::google::protobuf::int32 MailInfo::sendtype() const {
// @@protoc_insertion_point(field_get:MailInfo.sendType)
return sendtype_;
}
inline void MailInfo::set_sendtype(::google::protobuf::int32 value) {
set_has_sendtype();
sendtype_ = value;
// @@protoc_insertion_point(field_set:MailInfo.sendType)
}
// optional int64 playerID = 4;
inline bool MailInfo::has_playerid() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void MailInfo::set_has_playerid() {
_has_bits_[0] |= 0x00000008u;
}
inline void MailInfo::clear_has_playerid() {
_has_bits_[0] &= ~0x00000008u;
}
inline void MailInfo::clear_playerid() {
playerid_ = GOOGLE_LONGLONG(0);
clear_has_playerid();
}
inline ::google::protobuf::int64 MailInfo::playerid() const {
// @@protoc_insertion_point(field_get:MailInfo.playerID)
return playerid_;
}
inline void MailInfo::set_playerid(::google::protobuf::int64 value) {
set_has_playerid();
playerid_ = value;
// @@protoc_insertion_point(field_set:MailInfo.playerID)
}
// optional string sendName = 5;
inline bool MailInfo::has_sendname() const {
return (_has_bits_[0] & 0x00000010u) != 0;
}
inline void MailInfo::set_has_sendname() {
_has_bits_[0] |= 0x00000010u;
}
inline void MailInfo::clear_has_sendname() {
_has_bits_[0] &= ~0x00000010u;
}
inline void MailInfo::clear_sendname() {
if (sendname_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
sendname_->clear();
}
clear_has_sendname();
}
inline const ::std::string& MailInfo::sendname() const {
// @@protoc_insertion_point(field_get:MailInfo.sendName)
return *sendname_;
}
inline void MailInfo::set_sendname(const ::std::string& value) {
set_has_sendname();
if (sendname_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
sendname_ = new ::std::string;
}
sendname_->assign(value);
// @@protoc_insertion_point(field_set:MailInfo.sendName)
}
inline void MailInfo::set_sendname(const char* value) {
set_has_sendname();
if (sendname_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
sendname_ = new ::std::string;
}
sendname_->assign(value);
// @@protoc_insertion_point(field_set_char:MailInfo.sendName)
}
inline void MailInfo::set_sendname(const char* value, size_t size) {
set_has_sendname();
if (sendname_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
sendname_ = new ::std::string;
}
sendname_->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:MailInfo.sendName)
}
inline ::std::string* MailInfo::mutable_sendname() {
set_has_sendname();
if (sendname_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
sendname_ = new ::std::string;
}
// @@protoc_insertion_point(field_mutable:MailInfo.sendName)
return sendname_;
}
inline ::std::string* MailInfo::release_sendname() {
clear_has_sendname();
if (sendname_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
return NULL;
} else {
::std::string* temp = sendname_;
sendname_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
return temp;
}
}
inline void MailInfo::set_allocated_sendname(::std::string* sendname) {
if (sendname_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete sendname_;
}
if (sendname) {
set_has_sendname();
sendname_ = sendname;
} else {
clear_has_sendname();
sendname_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
// @@protoc_insertion_point(field_set_allocated:MailInfo.sendName)
}
// optional string content = 6;
inline bool MailInfo::has_content() const {
return (_has_bits_[0] & 0x00000020u) != 0;
}
inline void MailInfo::set_has_content() {
_has_bits_[0] |= 0x00000020u;
}
inline void MailInfo::clear_has_content() {
_has_bits_[0] &= ~0x00000020u;
}
inline void MailInfo::clear_content() {
if (content_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
content_->clear();
}
clear_has_content();
}
inline const ::std::string& MailInfo::content() const {
// @@protoc_insertion_point(field_get:MailInfo.content)
return *content_;
}
inline void MailInfo::set_content(const ::std::string& value) {
set_has_content();
if (content_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
content_ = new ::std::string;
}
content_->assign(value);
// @@protoc_insertion_point(field_set:MailInfo.content)
}
inline void MailInfo::set_content(const char* value) {
set_has_content();
if (content_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
content_ = new ::std::string;
}
content_->assign(value);
// @@protoc_insertion_point(field_set_char:MailInfo.content)
}
inline void MailInfo::set_content(const char* value, size_t size) {
set_has_content();
if (content_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
content_ = new ::std::string;
}
content_->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:MailInfo.content)
}
inline ::std::string* MailInfo::mutable_content() {
set_has_content();
if (content_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
content_ = new ::std::string;
}
// @@protoc_insertion_point(field_mutable:MailInfo.content)
return content_;
}
inline ::std::string* MailInfo::release_content() {
clear_has_content();
if (content_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
return NULL;
} else {
::std::string* temp = content_;
content_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
return temp;
}
}
inline void MailInfo::set_allocated_content(::std::string* content) {
if (content_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete content_;
}
if (content) {
set_has_content();
content_ = content;
} else {
clear_has_content();
content_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
// @@protoc_insertion_point(field_set_allocated:MailInfo.content)
}
// repeated .BackpackItem items = 7;
inline int MailInfo::items_size() const {
return items_.size();
}
inline void MailInfo::clear_items() {
items_.Clear();
}
inline const ::BackpackItem& MailInfo::items(int index) const {
// @@protoc_insertion_point(field_get:MailInfo.items)
return items_.Get(index);
}
inline ::BackpackItem* MailInfo::mutable_items(int index) {
// @@protoc_insertion_point(field_mutable:MailInfo.items)
return items_.Mutable(index);
}
inline ::BackpackItem* MailInfo::add_items() {
// @@protoc_insertion_point(field_add:MailInfo.items)
return items_.Add();
}
inline const ::google::protobuf::RepeatedPtrField< ::BackpackItem >&
MailInfo::items() const {
// @@protoc_insertion_point(field_list:MailInfo.items)
return items_;
}
inline ::google::protobuf::RepeatedPtrField< ::BackpackItem >*
MailInfo::mutable_items() {
// @@protoc_insertion_point(field_mutable_list:MailInfo.items)
return &items_;
}
// optional int64 sendTime = 8;
inline bool MailInfo::has_sendtime() const {
return (_has_bits_[0] & 0x00000080u) != 0;
}
inline void MailInfo::set_has_sendtime() {
_has_bits_[0] |= 0x00000080u;
}
inline void MailInfo::clear_has_sendtime() {
_has_bits_[0] &= ~0x00000080u;
}
inline void MailInfo::clear_sendtime() {
sendtime_ = GOOGLE_LONGLONG(0);
clear_has_sendtime();
}
inline ::google::protobuf::int64 MailInfo::sendtime() const {
// @@protoc_insertion_point(field_get:MailInfo.sendTime)
return sendtime_;
}
inline void MailInfo::set_sendtime(::google::protobuf::int64 value) {
set_has_sendtime();
sendtime_ = value;
// @@protoc_insertion_point(field_set:MailInfo.sendTime)
}
// optional int32 state = 9;
inline bool MailInfo::has_state() const {
return (_has_bits_[0] & 0x00000100u) != 0;
}
inline void MailInfo::set_has_state() {
_has_bits_[0] |= 0x00000100u;
}
inline void MailInfo::clear_has_state() {
_has_bits_[0] &= ~0x00000100u;
}
inline void MailInfo::clear_state() {
state_ = 0;
clear_has_state();
}
inline ::google::protobuf::int32 MailInfo::state() const {
// @@protoc_insertion_point(field_get:MailInfo.state)
return state_;
}
inline void MailInfo::set_state(::google::protobuf::int32 value) {
set_has_state();
state_ = value;
// @@protoc_insertion_point(field_set:MailInfo.state)
}
// optional string title = 10;
inline bool MailInfo::has_title() const {
return (_has_bits_[0] & 0x00000200u) != 0;
}
inline void MailInfo::set_has_title() {
_has_bits_[0] |= 0x00000200u;
}
inline void MailInfo::clear_has_title() {
_has_bits_[0] &= ~0x00000200u;
}
inline void MailInfo::clear_title() {
if (title_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
title_->clear();
}
clear_has_title();
}
inline const ::std::string& MailInfo::title() const {
// @@protoc_insertion_point(field_get:MailInfo.title)
return *title_;
}
inline void MailInfo::set_title(const ::std::string& value) {
set_has_title();
if (title_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
title_ = new ::std::string;
}
title_->assign(value);
// @@protoc_insertion_point(field_set:MailInfo.title)
}
inline void MailInfo::set_title(const char* value) {
set_has_title();
if (title_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
title_ = new ::std::string;
}
title_->assign(value);
// @@protoc_insertion_point(field_set_char:MailInfo.title)
}
inline void MailInfo::set_title(const char* value, size_t size) {
set_has_title();
if (title_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
title_ = new ::std::string;
}
title_->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:MailInfo.title)
}
inline ::std::string* MailInfo::mutable_title() {
set_has_title();
if (title_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
title_ = new ::std::string;
}
// @@protoc_insertion_point(field_mutable:MailInfo.title)
return title_;
}
inline ::std::string* MailInfo::release_title() {
clear_has_title();
if (title_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
return NULL;
} else {
::std::string* temp = title_;
title_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
return temp;
}
}
inline void MailInfo::set_allocated_title(::std::string* title) {
if (title_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete title_;
}
if (title) {
set_has_title();
title_ = title;
} else {
clear_has_title();
title_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
// @@protoc_insertion_point(field_set_allocated:MailInfo.title)
}
// -------------------------------------------------------------------
// GCSendMailStatus
// optional int32 offRead = 1;
inline bool GCSendMailStatus::has_offread() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void GCSendMailStatus::set_has_offread() {
_has_bits_[0] |= 0x00000001u;
}
inline void GCSendMailStatus::clear_has_offread() {
_has_bits_[0] &= ~0x00000001u;
}
inline void GCSendMailStatus::clear_offread() {
offread_ = 0;
clear_has_offread();
}
inline ::google::protobuf::int32 GCSendMailStatus::offread() const {
// @@protoc_insertion_point(field_get:GCSendMailStatus.offRead)
return offread_;
}
inline void GCSendMailStatus::set_offread(::google::protobuf::int32 value) {
set_has_offread();
offread_ = value;
// @@protoc_insertion_point(field_set:GCSendMailStatus.offRead)
}
// optional int32 total = 2;
inline bool GCSendMailStatus::has_total() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void GCSendMailStatus::set_has_total() {
_has_bits_[0] |= 0x00000002u;
}
inline void GCSendMailStatus::clear_has_total() {
_has_bits_[0] &= ~0x00000002u;
}
inline void GCSendMailStatus::clear_total() {
total_ = 0;
clear_has_total();
}
inline ::google::protobuf::int32 GCSendMailStatus::total() const {
// @@protoc_insertion_point(field_get:GCSendMailStatus.total)
return total_;
}
inline void GCSendMailStatus::set_total(::google::protobuf::int32 value) {
set_has_total();
total_ = value;
// @@protoc_insertion_point(field_set:GCSendMailStatus.total)
}
// -------------------------------------------------------------------
// CGSendMail2Player
// optional .MailInfo mail = 1;
inline bool CGSendMail2Player::has_mail() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void CGSendMail2Player::set_has_mail() {
_has_bits_[0] |= 0x00000001u;
}
inline void CGSendMail2Player::clear_has_mail() {
_has_bits_[0] &= ~0x00000001u;
}
inline void CGSendMail2Player::clear_mail() {
if (mail_ != NULL) mail_->::MailInfo::Clear();
clear_has_mail();
}
inline const ::MailInfo& CGSendMail2Player::mail() const {
// @@protoc_insertion_point(field_get:CGSendMail2Player.mail)
return mail_ != NULL ? *mail_ : *default_instance_->mail_;
}
inline ::MailInfo* CGSendMail2Player::mutable_mail() {
set_has_mail();
if (mail_ == NULL) mail_ = new ::MailInfo;
// @@protoc_insertion_point(field_mutable:CGSendMail2Player.mail)
return mail_;
}
inline ::MailInfo* CGSendMail2Player::release_mail() {
clear_has_mail();
::MailInfo* temp = mail_;
mail_ = NULL;
return temp;
}
inline void CGSendMail2Player::set_allocated_mail(::MailInfo* mail) {
delete mail_;
mail_ = mail;
if (mail) {
set_has_mail();
} else {
clear_has_mail();
}
// @@protoc_insertion_point(field_set_allocated:CGSendMail2Player.mail)
}
// -------------------------------------------------------------------
// GCSendMail2Player
// optional int32 result = 1;
inline bool GCSendMail2Player::has_result() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void GCSendMail2Player::set_has_result() {
_has_bits_[0] |= 0x00000001u;
}
inline void GCSendMail2Player::clear_has_result() {
_has_bits_[0] &= ~0x00000001u;
}
inline void GCSendMail2Player::clear_result() {
result_ = 0;
clear_has_result();
}
inline ::google::protobuf::int32 GCSendMail2Player::result() const {
// @@protoc_insertion_point(field_get:GCSendMail2Player.result)
return result_;
}
inline void GCSendMail2Player::set_result(::google::protobuf::int32 value) {
set_has_result();
result_ = value;
// @@protoc_insertion_point(field_set:GCSendMail2Player.result)
}
// -------------------------------------------------------------------
// GCSysSendMail2Player
// optional .MailInfo mail = 1;
inline bool GCSysSendMail2Player::has_mail() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void GCSysSendMail2Player::set_has_mail() {
_has_bits_[0] |= 0x00000001u;
}
inline void GCSysSendMail2Player::clear_has_mail() {
_has_bits_[0] &= ~0x00000001u;
}
inline void GCSysSendMail2Player::clear_mail() {
if (mail_ != NULL) mail_->::MailInfo::Clear();
clear_has_mail();
}
inline const ::MailInfo& GCSysSendMail2Player::mail() const {
// @@protoc_insertion_point(field_get:GCSysSendMail2Player.mail)
return mail_ != NULL ? *mail_ : *default_instance_->mail_;
}
inline ::MailInfo* GCSysSendMail2Player::mutable_mail() {
set_has_mail();
if (mail_ == NULL) mail_ = new ::MailInfo;
// @@protoc_insertion_point(field_mutable:GCSysSendMail2Player.mail)
return mail_;
}
inline ::MailInfo* GCSysSendMail2Player::release_mail() {
clear_has_mail();
::MailInfo* temp = mail_;
mail_ = NULL;
return temp;
}
inline void GCSysSendMail2Player::set_allocated_mail(::MailInfo* mail) {
delete mail_;
mail_ = mail;
if (mail) {
set_has_mail();
} else {
clear_has_mail();
}
// @@protoc_insertion_point(field_set_allocated:GCSysSendMail2Player.mail)
}
// -------------------------------------------------------------------
// CGGetMailList
// optional int64 playerID = 1;
inline bool CGGetMailList::has_playerid() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void CGGetMailList::set_has_playerid() {
_has_bits_[0] |= 0x00000001u;
}
inline void CGGetMailList::clear_has_playerid() {
_has_bits_[0] &= ~0x00000001u;
}
inline void CGGetMailList::clear_playerid() {
playerid_ = GOOGLE_LONGLONG(0);
clear_has_playerid();
}
inline ::google::protobuf::int64 CGGetMailList::playerid() const {
// @@protoc_insertion_point(field_get:CGGetMailList.playerID)
return playerid_;
}
inline void CGGetMailList::set_playerid(::google::protobuf::int64 value) {
set_has_playerid();
playerid_ = value;
// @@protoc_insertion_point(field_set:CGGetMailList.playerID)
}
// -------------------------------------------------------------------
// GCGetMailList
// repeated .MailInfo mails = 1;
inline int GCGetMailList::mails_size() const {
return mails_.size();
}
inline void GCGetMailList::clear_mails() {
mails_.Clear();
}
inline const ::MailInfo& GCGetMailList::mails(int index) const {
// @@protoc_insertion_point(field_get:GCGetMailList.mails)
return mails_.Get(index);
}
inline ::MailInfo* GCGetMailList::mutable_mails(int index) {
// @@protoc_insertion_point(field_mutable:GCGetMailList.mails)
return mails_.Mutable(index);
}
inline ::MailInfo* GCGetMailList::add_mails() {
// @@protoc_insertion_point(field_add:GCGetMailList.mails)
return mails_.Add();
}
inline const ::google::protobuf::RepeatedPtrField< ::MailInfo >&
GCGetMailList::mails() const {
// @@protoc_insertion_point(field_list:GCGetMailList.mails)
return mails_;
}
inline ::google::protobuf::RepeatedPtrField< ::MailInfo >*
GCGetMailList::mutable_mails() {
// @@protoc_insertion_point(field_mutable_list:GCGetMailList.mails)
return &mails_;
}
// -------------------------------------------------------------------
// CGReadMail
// optional int64 mailID = 1;
inline bool CGReadMail::has_mailid() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void CGReadMail::set_has_mailid() {
_has_bits_[0] |= 0x00000001u;
}
inline void CGReadMail::clear_has_mailid() {
_has_bits_[0] &= ~0x00000001u;
}
inline void CGReadMail::clear_mailid() {
mailid_ = GOOGLE_LONGLONG(0);
clear_has_mailid();
}
inline ::google::protobuf::int64 CGReadMail::mailid() const {
// @@protoc_insertion_point(field_get:CGReadMail.mailID)
return mailid_;
}
inline void CGReadMail::set_mailid(::google::protobuf::int64 value) {
set_has_mailid();
mailid_ = value;
// @@protoc_insertion_point(field_set:CGReadMail.mailID)
}
// -------------------------------------------------------------------
// GCReadMail
// optional int64 mailID = 1;
inline bool GCReadMail::has_mailid() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void GCReadMail::set_has_mailid() {
_has_bits_[0] |= 0x00000001u;
}
inline void GCReadMail::clear_has_mailid() {
_has_bits_[0] &= ~0x00000001u;
}
inline void GCReadMail::clear_mailid() {
mailid_ = GOOGLE_LONGLONG(0);
clear_has_mailid();
}
inline ::google::protobuf::int64 GCReadMail::mailid() const {
// @@protoc_insertion_point(field_get:GCReadMail.mailID)
return mailid_;
}
inline void GCReadMail::set_mailid(::google::protobuf::int64 value) {
set_has_mailid();
mailid_ = value;
// @@protoc_insertion_point(field_set:GCReadMail.mailID)
}
// optional int32 result = 2;
inline bool GCReadMail::has_result() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void GCReadMail::set_has_result() {
_has_bits_[0] |= 0x00000002u;
}
inline void GCReadMail::clear_has_result() {
_has_bits_[0] &= ~0x00000002u;
}
inline void GCReadMail::clear_result() {
result_ = 0;
clear_has_result();
}
inline ::google::protobuf::int32 GCReadMail::result() const {
// @@protoc_insertion_point(field_get:GCReadMail.result)
return result_;
}
inline void GCReadMail::set_result(::google::protobuf::int32 value) {
set_has_result();
result_ = value;
// @@protoc_insertion_point(field_set:GCReadMail.result)
}
// -------------------------------------------------------------------
// CGGetItemInMail
// repeated int64 mailID = 1;
inline int CGGetItemInMail::mailid_size() const {
return mailid_.size();
}
inline void CGGetItemInMail::clear_mailid() {
mailid_.Clear();
}
inline ::google::protobuf::int64 CGGetItemInMail::mailid(int index) const {
// @@protoc_insertion_point(field_get:CGGetItemInMail.mailID)
return mailid_.Get(index);
}
inline void CGGetItemInMail::set_mailid(int index, ::google::protobuf::int64 value) {
mailid_.Set(index, value);
// @@protoc_insertion_point(field_set:CGGetItemInMail.mailID)
}
inline void CGGetItemInMail::add_mailid(::google::protobuf::int64 value) {
mailid_.Add(value);
// @@protoc_insertion_point(field_add:CGGetItemInMail.mailID)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
CGGetItemInMail::mailid() const {
// @@protoc_insertion_point(field_list:CGGetItemInMail.mailID)
return mailid_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
CGGetItemInMail::mutable_mailid() {
// @@protoc_insertion_point(field_mutable_list:CGGetItemInMail.mailID)
return &mailid_;
}
// -------------------------------------------------------------------
// GCGetItemInMail
// repeated int64 mailID = 1;
inline int GCGetItemInMail::mailid_size() const {
return mailid_.size();
}
inline void GCGetItemInMail::clear_mailid() {
mailid_.Clear();
}
inline ::google::protobuf::int64 GCGetItemInMail::mailid(int index) const {
// @@protoc_insertion_point(field_get:GCGetItemInMail.mailID)
return mailid_.Get(index);
}
inline void GCGetItemInMail::set_mailid(int index, ::google::protobuf::int64 value) {
mailid_.Set(index, value);
// @@protoc_insertion_point(field_set:GCGetItemInMail.mailID)
}
inline void GCGetItemInMail::add_mailid(::google::protobuf::int64 value) {
mailid_.Add(value);
// @@protoc_insertion_point(field_add:GCGetItemInMail.mailID)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
GCGetItemInMail::mailid() const {
// @@protoc_insertion_point(field_list:GCGetItemInMail.mailID)
return mailid_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
GCGetItemInMail::mutable_mailid() {
// @@protoc_insertion_point(field_mutable_list:GCGetItemInMail.mailID)
return &mailid_;
}
// optional int32 result = 2;
inline bool GCGetItemInMail::has_result() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void GCGetItemInMail::set_has_result() {
_has_bits_[0] |= 0x00000002u;
}
inline void GCGetItemInMail::clear_has_result() {
_has_bits_[0] &= ~0x00000002u;
}
inline void GCGetItemInMail::clear_result() {
result_ = 0;
clear_has_result();
}
inline ::google::protobuf::int32 GCGetItemInMail::result() const {
// @@protoc_insertion_point(field_get:GCGetItemInMail.result)
return result_;
}
inline void GCGetItemInMail::set_result(::google::protobuf::int32 value) {
set_has_result();
result_ = value;
// @@protoc_insertion_point(field_set:GCGetItemInMail.result)
}
// -------------------------------------------------------------------
// CGDelMail
// repeated int64 mailID = 1;
inline int CGDelMail::mailid_size() const {
return mailid_.size();
}
inline void CGDelMail::clear_mailid() {
mailid_.Clear();
}
inline ::google::protobuf::int64 CGDelMail::mailid(int index) const {
// @@protoc_insertion_point(field_get:CGDelMail.mailID)
return mailid_.Get(index);
}
inline void CGDelMail::set_mailid(int index, ::google::protobuf::int64 value) {
mailid_.Set(index, value);
// @@protoc_insertion_point(field_set:CGDelMail.mailID)
}
inline void CGDelMail::add_mailid(::google::protobuf::int64 value) {
mailid_.Add(value);
// @@protoc_insertion_point(field_add:CGDelMail.mailID)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
CGDelMail::mailid() const {
// @@protoc_insertion_point(field_list:CGDelMail.mailID)
return mailid_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
CGDelMail::mutable_mailid() {
// @@protoc_insertion_point(field_mutable_list:CGDelMail.mailID)
return &mailid_;
}
// -------------------------------------------------------------------
// GCDelMail
// repeated int64 mailID = 1;
inline int GCDelMail::mailid_size() const {
return mailid_.size();
}
inline void GCDelMail::clear_mailid() {
mailid_.Clear();
}
inline ::google::protobuf::int64 GCDelMail::mailid(int index) const {
// @@protoc_insertion_point(field_get:GCDelMail.mailID)
return mailid_.Get(index);
}
inline void GCDelMail::set_mailid(int index, ::google::protobuf::int64 value) {
mailid_.Set(index, value);
// @@protoc_insertion_point(field_set:GCDelMail.mailID)
}
inline void GCDelMail::add_mailid(::google::protobuf::int64 value) {
mailid_.Add(value);
// @@protoc_insertion_point(field_add:GCDelMail.mailID)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
GCDelMail::mailid() const {
// @@protoc_insertion_point(field_list:GCDelMail.mailID)
return mailid_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
GCDelMail::mutable_mailid() {
// @@protoc_insertion_point(field_mutable_list:GCDelMail.mailID)
return &mailid_;
}
// optional int32 result = 2;
inline bool GCDelMail::has_result() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void GCDelMail::set_has_result() {
_has_bits_[0] |= 0x00000002u;
}
inline void GCDelMail::clear_has_result() {
_has_bits_[0] &= ~0x00000002u;
}
inline void GCDelMail::clear_result() {
result_ = 0;
clear_has_result();
}
inline ::google::protobuf::int32 GCDelMail::result() const {
// @@protoc_insertion_point(field_get:GCDelMail.result)
return result_;
}
inline void GCDelMail::set_result(::google::protobuf::int32 value) {
set_has_result();
result_ = value;
// @@protoc_insertion_point(field_set:GCDelMail.result)
}
// @@protoc_insertion_point(namespace_scope)
#ifndef SWIG
namespace google {
namespace protobuf {
} // namespace google
} // namespace protobuf
#endif // SWIG
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_MailMessage_2eproto__INCLUDED
| [
"[email protected]"
] | |
509c6d620d561bef7684c5ca16ab679f7529259f | 15b322d609ed38de5392b67fc578fbbd22a4b7d0 | /TextArt/BADA/FSclSvcISnsGatewayListener.h | 45fd56be706e4a4d49d8a510a6ab323ba888ed23 | [] | no_license | Vizantiec/Bada | 7725bb06cecb72267218220bec05a99879fc2087 | 51a3f544c8e0193dbf374d3a8042d867dbca9818 | refs/heads/master | 2016-09-11T02:18:26.326902 | 2013-12-23T10:22:35 | 2013-12-23T10:22:35 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,572 | h | /* $Change: 1202329 $ */
//
// Copyright (c) 2011 Samsung Electronics Co., Ltd.
// All rights reserved.
// This software contains confidential and proprietary information
// of Samsung Electronics Co., Ltd.
// The user of this software agrees not to disclose, disseminate or copy such
// Confidential Information and shall use the software only in accordance with
// the terms of the license agreement the user entered into with Samsung.
//
/**
* @file FSclSvcISnsGatewayListener.h
* @brief This is the header file for the %ISnsGatewayListener interface.
*
* This header file contains the declarations of the %ISnsGatewayListener interface.
*/
#ifndef _FSCL_SVC_ISNS_GATEWAY_LISTENER_H_
#define _FSCL_SVC_ISNS_GATEWAY_LISTENER_H_
#include "FBaseRtIEventListener.h"
#include "FBaseColIList.h"
#include "FSclConfig.h"
#include "FSclSvcSnsProfile.h"
namespace Osp { namespace Social { namespace Services {
/**
* @interface ISnsGatewayListener
* @brief This interface represents a listener that receives events associated with SnsGateway.
* @deprecated This class is deprecated due to the operation policy of the bada Server.
* @since 1.0
*
* The %ISnsGatewayListener interface represents a listener that receives events associated with SnsGateway.
*/
class _EXPORT_SOCIAL_ ISnsGatewayListener
: public Osp::Base::Runtime::IEventListener
{
public:
/**
* Called when the SnsGateway::IsLoggedIn() method is completed. @n
* Receives the response to SnsGateway::IsLoggedIn() method from the server.
*
* @deprecated This method is deprecated due to the operation policy of the bada Server.
* @since 1.0
* @param[in] reqId The request ID
* @param[in] serviceProvider The service provider
* @param[in] isLoggedIn The sign-in status @n
* Set to @c true if the user is signed in to the service provider, @n
* else @c false
* @param[in] r The result of the request
* @param[in] errorCode The error code from the server
* @param[in] errorMsg The error message from the server
* @exception E_SUCCESS The request is successful.
* @exception E_SERVER An error has occurred on the server side.
* @exception E_CONNECTION_FAILED The network connection has failed.
* @exception E_PARSING_FAILED The response data from the server cannot be parsed.
*
* @see SnsGateway::IsLoggedIn()
*/
virtual void OnSnsLoggedInStatusReceived(RequestId reqId, Osp::Base::String& serviceProvider, bool isLoggedIn,
result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMsg) = 0;
};
};};};
#endif
| [
"[email protected]"
] | |
6eb5bb1b48466716b4833065e4e0ece190601a5f | f22f1c9b9f0265295be7cb83433fcba66b620776 | /core/lang/src/main/include/jcpp/nio/JHeapCharBuffer.h | ab31126f69782953db04bb6e9a1f928528d90467 | [] | no_license | egelor/jcpp-1 | 63c72c3257b52b37a952344a62fa43882247ba6e | 9b5a180b00890d375d2e8a13b74ab5039ac4388c | refs/heads/master | 2021-05-09T03:46:22.585245 | 2015-08-07T16:04:20 | 2015-08-07T16:04:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,357 | h | #ifndef JCPP_NIO_JHEAPCHARBUFFER_H
#define JCPP_NIO_JHEAPCHARBUFFER_H
#include "jcpp/lang/JSystem.h"
#include "jcpp/native/api/NativeInclude.h"
#include "jcpp/lang/JPrimitiveCharArray.h"
#include "jcpp/nio/JCharBuffer.h"
#include "jcpp/lang/JStringIndexOutOfBoundsException.h"
namespace jcpp {
namespace nio {
// @Class(canonicalName="java.nio.HeapCharBuffer", simpleName="HeapCharBuffer");
class JCPP_EXPORT JHeapCharBuffer : public JCharBuffer {
protected:
jint ix(jint i);
public:
JHeapCharBuffer(jint cap, jint lim);
JHeapCharBuffer(JPrimitiveCharArray* buf, jint off, jint len);
JHeapCharBuffer(JPrimitiveCharArray* buf, jint mark, jint pos, jint lim, jint cap, jint off);
static jcpp::lang::JClass* getClazz();
virtual jchar get();
virtual jchar get(jint i);
virtual JCharBuffer* get(JPrimitiveCharArray* dst, jint offset, jint length);
virtual jbool isDirect();
virtual JCharBuffer* put(jchar x);
virtual JCharBuffer* put(jint i, jchar x);
virtual JCharBuffer* put(JPrimitiveCharArray* src, jint offset, jint length);
virtual JCharBuffer* put(JCharBuffer* src);
virtual JCharBuffer* slice();
virtual JString* toString(jint start, jint end);
virtual JCharBuffer* subSequence(jint start, jint end);
virtual JByteOrder* order();
virtual ~JHeapCharBuffer();
};
}
}
#endif /* JHEAPCHARBUFFER_H_ */
| [
"mimi4930"
] | mimi4930 |
c7aa426aac1c0e82166f274a0decef06916ceeb3 | 8f1988ce25b95e93826c288224909e4b4066a99e | /BehaviroalPatterns/state/State.cxx | b04570a1420d1123c5270ed093d77a6ee9712026 | [
"MIT"
] | permissive | Junzhuodu/design-patterns | 5cc4554153911ab11f5b743e417e7de1e654c5bd | 1c486afbb91ef824fe9ace8b604062c8fdb06806 | refs/heads/master | 2023-02-04T16:39:38.189081 | 2023-01-27T23:16:35 | 2023-01-27T23:16:35 | 244,219,626 | 49 | 22 | MIT | 2022-11-23T03:05:22 | 2020-03-01T20:37:01 | C++ | UTF-8 | C++ | false | false | 1,042 | cxx | /*
* C++ Design Patterns:
* Author: Junzhuo Du [github.com/Junzhuodu]
* 2020
*
*/
#include <iostream>
class State {
public:
virtual ~State() {}
virtual void handle() = 0;
};
class ConcreteStateA : public State {
~ConcreteStateA() {}
void handle() {
std::cout << "State A handled." << std::endl;
}
};
class ConcreteStateB : public State {
~ConcreteStateB() {}
void handle() {
std::cout << "State B handled." << std::endl;
}
};
class Context {
public:
Context() : state() {}
~Context() {
if (state) {
delete state;
}
}
void setState(State* const s) {
if (state) {
delete state;
}
state = s;
}
void request() {
state->handle();
}
private:
State* state;
};
int main() {
Context* context = new Context();
context->setState(new ConcreteStateA());
context->request();
context->setState(new ConcreteStateB());
context->request();
} | [
"[email protected]"
] | |
0e9e62af61026baeb7e6e52c8943245073c81423 | 22bc57698ae4d17e74d63e03f63e48840cdd77e6 | /traveling-salesman/threads.h | 1ba9199fed489445308707b5c95ccb3119c714ae | [] | no_license | wakanapo/google-step-tsp | 181dd9842cba04387a10de12f535cb7e9d479030 | 8588f609ef35ce487f1304ba9e776508f5d7c0c2 | refs/heads/gh-pages | 2021-01-16T23:01:52.795192 | 2016-07-08T06:26:08 | 2016-07-08T06:26:08 | 62,383,093 | 0 | 0 | null | 2016-07-01T09:49:54 | 2016-07-01T09:49:54 | null | UTF-8 | C++ | false | false | 1,041 | h | #ifndef THREADS_H
#define THREADS_H
#include <cstring>
#include <iostream>
#include <pthread.h>
#include "tsp.h"
using namespace std;
// Abstract Thread class
class Thread
{
private:
// Internally track thread ids
pthread_t _id;
// Serves as global function for pthraed_create
// Internally calls member function run
static void *exec(void *thr);
// Prevent copying
Thread(const Thread& arg);
// Prevent assignment
Thread& operator=(const Thread& rhs);
protected:
// Pure virtual function, to implement with code thread should run
virtual void run() = 0;
public:
// Constructor
Thread() {
mytsp = NULL;
_id = 0;
my_id = start_node = -1;
};
// Destructor
virtual ~Thread() {};
// Starts the internal thread
void start();
// Wait for internal thread to exit
void join();
// Get thread id of internal thread
long get_tid() {return (long)_id;}
// Index of node to start touring at
int start_node;
// Pointer to TSP object
TSP *mytsp;
// Assigned ID (for tracking purposes)
int my_id;
};
#endif
| [
"[email protected]"
] | |
1e3a3d02f4b81daaeb2fbd0cd8738f7b1e23c0fa | b9efac984f2edf815f7a8f94ddcfeb3da17a25db | /game9/game9/gameObject.cpp | 6ae1a14c70fc0e4afa06dea3461f28c742e16c08 | [] | no_license | Tinaynox/gamedev | 26679d736f5580090f4da54f92e17a5b36d37b25 | 6a4d7b79f41568e51b6a5f23eebb502053677d1b | refs/heads/master | 2021-06-07T10:56:58.954475 | 2016-10-23T18:46:11 | 2016-10-23T18:46:11 | 38,491,471 | 4 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 1,442 | cpp | /////////////////////////////////////
// Include
#include "gameObject.h"
#include "level.h"
/////////////////////////////////////
// Class GameObject
GameObject::GameObject()
{
m_game = 0;
m_type = GameObjectType_None;
m_x = 0.0;
m_y = 0.0;
m_xSpeed = 0.0;
m_ySpeed = 0.0;
m_width = 1;
m_height = 1;
m_health = 1;
m_destroyAfterDeath = true;
m_invulnerable = false;
m_physical = true;
m_direction = Direction_Up;
m_sprite = new sf::Sprite();
m_sprite->setTexture( *g_atlas00 );
setTextureRect( sf::IntRect() );
}
GameObject::~GameObject()
{
if( m_sprite )
delete m_sprite;
}
void GameObject::render( sf::RenderWindow* rw )
{
if( m_sprite )
{
int row = int( m_y );
int column = int( m_x );
m_sprite->setPosition( column * kPixelsPerCell, row * kPixelsPerCell );
rw->draw(*m_sprite);
}
}
void GameObject::update( float dt )
{
int oldRow = int( m_y );
int oldColumn = int( m_x );
float newY = m_y + m_ySpeed * dt;
float newX = m_x + m_xSpeed * dt;
int newRow = int( newY );
int newColumn = int( newX );
if( oldColumn != newColumn )
m_game->moveObjectTo( this, newX, m_y );
else
m_x = newX;
if( oldRow != newRow )
m_game->moveObjectTo( this, m_x, newY );
else
m_y = newY;
}
void GameObject::intersect( GameObject* object )
{
}
void GameObject::doDamage( int damage )
{
if( getInvulnerable() )
return;
if( m_health > damage )
m_health -= damage;
else
m_health = 0;
} | [
"[email protected]"
] | |
1136eaac8688e259170fd6c3495a63a0c2ff3d84 | b71b8bd385c207dffda39d96c7bee5f2ccce946c | /testcases/CWE36_Absolute_Path_Traversal/s02/CWE36_Absolute_Path_Traversal__char_listen_socket_ifstream_10.cpp | 91a5ac488edbaf6b01fef9f68913d8ba25cc94e2 | [] | no_license | Sporknugget/Juliet_prep | e9bda84a30bdc7938bafe338b4ab2e361449eda5 | 97d8922244d3d79b62496ede4636199837e8b971 | refs/heads/master | 2023-05-05T14:41:30.243718 | 2021-05-25T16:18:13 | 2021-05-25T16:18:13 | 369,334,230 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,359 | cpp | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE36_Absolute_Path_Traversal__char_listen_socket_ifstream_10.cpp
Label Definition File: CWE36_Absolute_Path_Traversal.label.xml
Template File: sources-sink-10.tmpl.cpp
*/
/*
* @description
* CWE: 36 Absolute Path Traversal
* BadSource: listen_socket Read data using a listen socket (server side)
* GoodSource: Full path and file name
* Sink: ifstream
* BadSink : Open the file named in data using ifstream::open()
* Flow Variant: 10 Control flow: if(globalTrue) and if(globalFalse)
*
* */
#include "std_testcase.h"
#ifndef _WIN32
#include <wchar.h>
#endif
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#include <direct.h>
#pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */
#define CLOSE_SOCKET closesocket
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#define CLOSE_SOCKET close
#define SOCKET int
#endif
#define TCP_PORT 27015
#define LISTEN_BACKLOG 5
#include <fstream>
using namespace std;
namespace CWE36_Absolute_Path_Traversal__char_listen_socket_ifstream_10
{
#ifndef OMITBAD
void bad()
{
char * data;
char dataBuffer[FILENAME_MAX] = "";
data = dataBuffer;
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = strlen(data);
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (FILENAME_MAX - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
{
ifstream inputFile;
/* POTENTIAL FLAW: Possibly opening a file without validating the file name or path */
inputFile.open((char *)data);
inputFile.close();
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B1() - use goodsource and badsink by changing the globalTrue to globalFalse */
static void goodG2B1()
{
char * data;
char dataBuffer[FILENAME_MAX] = "";
data = dataBuffer;
{
#ifdef _WIN32
/* FIX: Use a fixed, full path and file name */
strcat(data, "c:\\temp\\file.txt");
#else
/* FIX: Use a fixed, full path and file name */
strcat(data, "/tmp/file.txt");
#endif
}
{
ifstream inputFile;
/* POTENTIAL FLAW: Possibly opening a file without validating the file name or path */
inputFile.open((char *)data);
inputFile.close();
}
}
/* goodG2B2() - use goodsource and badsink by reversing the blocks in the if statement */
static void goodG2B2()
{
char * data;
char dataBuffer[FILENAME_MAX] = "";
data = dataBuffer;
{
#ifdef _WIN32
/* FIX: Use a fixed, full path and file name */
strcat(data, "c:\\temp\\file.txt");
#else
/* FIX: Use a fixed, full path and file name */
strcat(data, "/tmp/file.txt");
#endif
}
{
ifstream inputFile;
/* POTENTIAL FLAW: Possibly opening a file without validating the file name or path */
inputFile.open((char *)data);
inputFile.close();
}
}
void good()
{
goodG2B1();
goodG2B2();
}
#endif /* OMITGOOD */
} /* close namespace */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
using namespace CWE36_Absolute_Path_Traversal__char_listen_socket_ifstream_10; /* so that we can use good and bad easily */
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
| [
"[email protected]"
] | |
3584430f4994007c14538c3af5d4295b999d8c5a | 2d549ea3ce6156c98a082812b0eb257097b029a2 | /C++Templates/src/TemplateStudy/13_Specialization and Overloading/SAO_12.cpp | 79bd5e1a9358ce22d15c77fa660363c3ee6faac5 | [] | no_license | xtozero/Study | da4bbe29f5b108d0b2285fe0e33b8173e1f9bbb1 | 61a9e34029e61fb652db2bf4ab4cd61405c56885 | refs/heads/master | 2023-07-14T02:13:39.507057 | 2023-06-25T09:03:48 | 2023-06-25T09:03:48 | 81,724,549 | 3 | 0 | null | null | null | null | UHC | C++ | false | false | 642 | cpp | #include <iostream>
template <typename T> // 1
int f( T )
{
return 1;
}
template <typename T> // 2
int f( T* )
{
return 2;
}
template<> int f( int )
{
return 3;
}
template<> int f( int* )
{
return 4;
}
// 전체 함수 템플릿 특수화에서의 기본 인자
template <typename T>
int f( T, T x = 42 )
{
return x;
}
//template <>
//int f( int, int = 35 ) // error : 전체 함수 템플릿 특수화에서 기본 인자를 사용할 수 없다.
//{
// return 0;
//}
template <typename T>
int g( T, T x = 42 )
{
return x;
}
template <>
int g( int, int y )
{
return y / 2;
}
int main( )
{
std::cout << g( 0 ) << std::endl;
} | [
"[email protected]"
] | |
f0f67c1d530ff49532781ffc3f9aa6be20c044dc | 1fd328e6e337b144e51eddbff5bd869dd02b62b6 | /src/QtCryptography/nECencryptor.cpp | 7997206d81f26910b780a9d68ee7e2272d93263c | [
"MIT"
] | permissive | Vladimir-Lin/QtCryptography | f92d5cf0e7e1f78f21cccd29abe9fa78c2c0c105 | b200e70b38564b274e2d53ab21cfa459e00ed449 | refs/heads/main | 2023-05-31T14:01:13.321491 | 2021-06-16T06:45:10 | 2021-06-16T06:45:10 | 377,397,771 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 623 | cpp | #include <qtcryptography>
#include <openssl/ec.h>
N::Encrypt::EC:: EC (void)
: Encryptor ( )
{
}
N::Encrypt::EC::~EC (void)
{
}
bool N::Encrypt::EC::supports (int algorithm)
{
return ( Cryptography::Others == algorithm ) ;
}
int N::Encrypt::EC::type(void) const
{
return 100012 ;
}
QString N::Encrypt::EC::name(void)
{
return QString("EC") ;
}
QStringList N::Encrypt::EC::Methods(void)
{
QStringList E ;
return E ;
}
CUIDs N::Encrypt::EC::Bits(void)
{
CUIDs IDs ;
return IDs ;
}
bool N::Encrypt::EC::encrypt(QByteArray & input,QByteArray & output)
{
return true ;
}
| [
"[email protected]"
] | |
89b392c1716d33e1735e22bfe4f9b5306051bb50 | 1b6c8c17b09b4c8a2295bbb2586661d3916d1ea8 | /chapter_08/例8-7 变步长梯形积分法求函数的定积分/Trapzint.cpp | abc7667b82c7cd410a5dc68f5045c2cbb74fdda0 | [] | no_license | cpvhunter/Cpp_4th | 6e20b6fecd7fb9664123eb32e390fa56824073a1 | 828615431a21598458ad5c33fd453e4cfd2da93a | refs/heads/master | 2020-05-28T11:27:53.995767 | 2019-04-16T01:49:44 | 2019-04-16T01:49:44 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 923 | cpp | //Trapzint.cpp 文件二,类实现
#include "Trapzint.h" //包含类的定义头文件
#include <cmath>
//被积函数
double MyFunction::operator() (double x) const{
return log(1.0+x)/(1.0+x*x);
}
//积分运算过程,重载为运算符()
double Trapz::operator() (double a,double b,double eps) const{
bool done=false; //是Trapz类的虚函数成员
int n=1;
double h=b-a;
double tn=h*(f(a)+f(b))/2; //计算n=1时的积分值
double t2n;
do{
double sum=0;
for(int k=0;k<n;k++){
double x=a+(k+0.5)*h;
sum+=f(x);
}
t2n=(tn+h*sum)/2.0; //变步长梯形法计算
if(fabs(t2n-tn)<eps)
done=true; //判断积分误差
else{ //进行下一步计算
tn=t2n;
n*=2;
h/=2;
}
}while(!done);
return t2n;
}
| [
"[email protected]"
] | |
68de2c8ec09fb9c0f50bb0e465247f62f455adda | 797044044cf6952991b7bb94e06d79774620c945 | /code/2021/04/16/thread_annotations.h | 8a0e99aac5696b6605dcc2697bece5385abece9a | [] | no_license | JackDrogon/CodingEveryday | 491fea68919f389361feae964a6a5ca68bc4490c | 821eb2bb23f90268f320fdbc814210a8b0c259eb | refs/heads/master | 2022-11-14T22:28:50.096778 | 2021-05-31T00:10:12 | 2021-05-31T00:10:12 | 38,796,387 | 1 | 0 | null | 2022-11-11T20:56:23 | 2015-07-09T04:09:22 | C++ | UTF-8 | C++ | false | false | 2,780 | h | #pragma once
// Thread safety annotations {
// https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
// Enable thread safety attributes only with clang.
// The attributes can be safely erased when compiling with other compilers.
#if defined(__clang__) && (!defined(SWIG))
#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
#else
#define THREAD_ANNOTATION_ATTRIBUTE__(x) // no-op
#endif
#define CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(capability(x))
#define SCOPED_CAPABILITY THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
#define PT_GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
#define ACQUIRED_BEFORE(...) \
THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(__VA_ARGS__))
#define ACQUIRED_AFTER(...) \
THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(__VA_ARGS__))
#define REQUIRES(...) \
THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(__VA_ARGS__))
#define REQUIRES_SHARED(...) \
THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(__VA_ARGS__))
#define ACQUIRE(...) \
THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(__VA_ARGS__))
#define ACQUIRE_SHARED(...) \
THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(__VA_ARGS__))
#define RELEASE(...) \
THREAD_ANNOTATION_ATTRIBUTE__(release_capability(__VA_ARGS__))
#define RELEASE_SHARED(...) \
THREAD_ANNOTATION_ATTRIBUTE__(release_shared_capability(__VA_ARGS__))
#define TRY_ACQUIRE(...) \
THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_capability(__VA_ARGS__))
#define TRY_ACQUIRE_SHARED(...) \
THREAD_ANNOTATION_ATTRIBUTE__( \
try_acquire_shared_capability(__VA_ARGS__))
#define EXCLUDES(...) THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__))
#define ASSERT_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x))
#define ASSERT_SHARED_CAPABILITY(x) \
THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x))
#define RETURN_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
#define NO_THREAD_SAFETY_ANALYSIS \
THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
// End of thread safety annotations }
| [
"[email protected]"
] | |
bdbf03dcaf5a8c51a95b7c63cadeb0a7e20dd492 | 94fba961f5a75d496bf1f403831beccbd08cddd0 | /p4_blank origin/inl.cpp | c7ccf045e39dc2375619e69cfa7f0459656156e4 | [] | no_license | yiwuxie15/SQL_Query_Optimizer | 5ab0bfb7341ee2f89a4d4282a6354530b276727f | 37da01ed99f7b159bfcc3c603900b541f8d3dc5d | refs/heads/master | 2021-01-23T10:00:28.376558 | 2015-07-31T00:10:56 | 2015-07-31T00:10:56 | 39,977,959 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 926 | cpp | #include "catalog.h"
#include "query.h"
#include "sort.h"
#include "index.h"
/*
* Indexed nested loop evaluates joins with an index on the
* inner/right relation (attrDesc2)
*/
Status Operators::INL(const string& result, // Name of the output relation
const int projCnt, // Number of attributes in the projection
const AttrDesc attrDescArray[], // The projection list (as AttrDesc)
const AttrDesc& attrDesc1, // The left attribute in the join predicate
const Operator op, // Predicate operator
const AttrDesc& attrDesc2, // The left attribute in the join predicate
const int reclen) // Length of a tuple in the output relation
{
cout << "Algorithm: Indexed NL Join" << endl;
/* Your solution goes here */
return OK;
}
| [
"[email protected]"
] | |
18700eeb1a8df69daf7b10f1e83500e377cb60ae | 82a08e1fa44539d12de75e5057d90a80032467c5 | /src/net.h | ebbaedc3a2b684c8606a83410281228b6f4c869e | [
"MIT"
] | permissive | M1keH/amdex | 783c6fa6e19ef69cb881c8743b4d29d0c2470b48 | 9c483d58365cc47e9c2a67275f63a72a34309698 | refs/heads/master | 2020-04-20T00:00:59.330142 | 2019-01-31T11:22:50 | 2019-01-31T11:22:50 | 168,511,615 | 0 | 0 | MIT | 2019-01-31T11:06:59 | 2019-01-31T11:06:59 | null | UTF-8 | C++ | false | false | 18,973 | h | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2016 The Bitcoin developers
// Copyright (c) 2016 The Amsterdex developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_NET_H
#define BITCOIN_NET_H
#include <deque>
#include <boost/array.hpp>
#include <boost/foreach.hpp>
#include <openssl/rand.h>
#ifndef WIN32
#include <arpa/inet.h>
#endif
#include "mruset.h"
#include "netbase.h"
#include "protocol.h"
#include "addrman.h"
class CRequestTracker;
class CNode;
class CBlockIndex;
extern int nBestHeight;
inline unsigned int ReceiveFloodSize() { return 1000*GetArg("-maxreceivebuffer", 5*1000); }
inline unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 1*1000); }
void AddOneShot(std::string strDest);
bool RecvLine(SOCKET hSocket, std::string& strLine);
bool GetMyExternalIP(CNetAddr& ipRet);
void AddressCurrentlyConnected(const CService& addr);
CNode* FindNode(const CNetAddr& ip);
CNode* FindNode(const CService& ip);
CNode* ConnectNode(CAddress addrConnect, const char *strDest = NULL);
void MapPort();
unsigned short GetListenPort();
bool BindListenPort(const CService &bindAddr, std::string& strError=REF(std::string()));
void StartNode(void* parg);
bool StopNode();
void SocketSendData(CNode *pnode);
enum
{
LOCAL_NONE, // unknown
LOCAL_IF, // address a local interface listens on
LOCAL_BIND, // address explicit bound to
LOCAL_UPNP, // address reported by UPnP
LOCAL_HTTP, // address reported by whatismyip.com and similar
LOCAL_MANUAL, // address explicitly specified (-externalip=)
LOCAL_MAX
};
void SetLimited(enum Network net, bool fLimited = true);
bool IsLimited(enum Network net);
bool IsLimited(const CNetAddr& addr);
bool AddLocal(const CService& addr, int nScore = LOCAL_NONE);
bool AddLocal(const CNetAddr& addr, int nScore = LOCAL_NONE);
bool SeenLocal(const CService& addr);
bool IsLocal(const CService& addr);
bool GetLocal(CService &addr, const CNetAddr *paddrPeer = NULL);
bool IsReachable(const CNetAddr &addr);
void SetReachable(enum Network net, bool fFlag = true);
CAddress GetLocalAddress(const CNetAddr *paddrPeer = NULL);
enum
{
MSG_TX = 1,
MSG_BLOCK,
};
class CRequestTracker
{
public:
void (*fn)(void*, CDataStream&);
void* param1;
explicit CRequestTracker(void (*fnIn)(void*, CDataStream&)=NULL, void* param1In=NULL)
{
fn = fnIn;
param1 = param1In;
}
bool IsNull()
{
return fn == NULL;
}
};
/** Thread types */
enum threadId
{
THREAD_SOCKETHANDLER,
THREAD_OPENCONNECTIONS,
THREAD_MESSAGEHANDLER,
THREAD_RPCLISTENER,
THREAD_UPNP,
THREAD_DNSSEED,
THREAD_ADDEDCONNECTIONS,
THREAD_DUMPADDRESS,
THREAD_RPCHANDLER,
THREAD_STAKE_MINER,
THREAD_NTP,
THREAD_MAX
};
extern bool fClient;
extern bool fDiscover;
extern bool fUseUPnP;
extern uint64_t nLocalServices;
extern uint64_t nLocalHostNonce;
extern CAddress addrSeenByPeer;
extern boost::array<int, THREAD_MAX> vnThreadsRunning;
extern CAddrMan addrman;
extern std::vector<CNode*> vNodes;
extern CCriticalSection cs_vNodes;
extern std::map<CInv, CDataStream> mapRelay;
extern std::deque<std::pair<int64_t, CInv> > vRelayExpiration;
extern CCriticalSection cs_mapRelay;
extern std::map<CInv, int64_t> mapAlreadyAskedFor;
class CNodeStats
{
public:
uint64_t nServices;
int64_t nLastSend;
int64_t nLastRecv;
int64_t nTimeConnected;
std::string addrName;
int nVersion;
std::string strSubVer;
bool fInbound;
int nStartingHeight;
int nMisbehavior;
};
class CNetMessage {
public:
bool in_data; // parsing header (false) or data (true)
CDataStream hdrbuf; // partially received header
CMessageHeader hdr; // complete header
unsigned int nHdrPos;
CDataStream vRecv; // received message data
unsigned int nDataPos;
CNetMessage(int nTypeIn, int nVersionIn) : hdrbuf(nTypeIn, nVersionIn), vRecv(nTypeIn, nVersionIn) {
hdrbuf.resize(24);
in_data = false;
nHdrPos = 0;
nDataPos = 0;
}
bool complete() const
{
if (!in_data)
return false;
return (hdr.nMessageSize == nDataPos);
}
void SetVersion(int nVersionIn)
{
hdrbuf.SetVersion(nVersionIn);
vRecv.SetVersion(nVersionIn);
}
int readHeader(const char *pch, unsigned int nBytes);
int readData(const char *pch, unsigned int nBytes);
};
/** Information about a peer */
class CNode
{
public:
// socket
uint64_t nServices;
SOCKET hSocket;
CDataStream ssSend;
size_t nSendSize; // total size of all vSendMsg entries
size_t nSendOffset; // offset inside the first vSendMsg already sent
std::deque<CSerializeData> vSendMsg;
CCriticalSection cs_vSend;
std::deque<CNetMessage> vRecvMsg;
CCriticalSection cs_vRecvMsg;
int nRecvVersion;
int64_t nLastSend;
int64_t nLastRecv;
int64_t nLastSendEmpty;
int64_t nTimeConnected;
CAddress addr;
std::string addrName;
CService addrLocal;
int nVersion;
std::string strSubVer;
bool fOneShot;
bool fClient;
bool fInbound;
bool fNetworkNode;
bool fSuccessfullyConnected;
bool fDisconnect;
CSemaphoreGrant grantOutbound;
int nRefCount;
protected:
// Denial-of-service detection/prevention
// Key is IP address, value is banned-until-time
static std::map<CNetAddr, int64_t> setBanned;
static CCriticalSection cs_setBanned;
int nMisbehavior;
public:
std::map<uint256, CRequestTracker> mapRequests;
CCriticalSection cs_mapRequests;
uint256 hashContinue;
CBlockIndex* pindexLastGetBlocksBegin;
uint256 hashLastGetBlocksEnd;
int nStartingHeight;
// flood relay
std::vector<CAddress> vAddrToSend;
mruset<CAddress> setAddrKnown;
bool fGetAddr;
std::set<uint256> setKnown;
uint256 hashCheckpointKnown; // ppcoin: known sent sync-checkpoint
// inventory based relay
mruset<CInv> setInventoryKnown;
std::vector<CInv> vInventoryToSend;
CCriticalSection cs_inventory;
std::multimap<int64_t, CInv> mapAskFor;
CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false) : ssSend(SER_NETWORK, INIT_PROTO_VERSION), setAddrKnown(5000)
{
nServices = 0;
hSocket = hSocketIn;
nRecvVersion = INIT_PROTO_VERSION;
nLastSend = 0;
nLastRecv = 0;
nLastSendEmpty = GetTime();
nTimeConnected = GetTime();
addr = addrIn;
addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn;
nVersion = 0;
strSubVer = "";
fOneShot = false;
fClient = false; // set by version message
fInbound = fInboundIn;
fNetworkNode = false;
fSuccessfullyConnected = false;
fDisconnect = false;
nRefCount = 0;
nSendSize = 0;
nSendOffset = 0;
hashContinue = 0;
pindexLastGetBlocksBegin = 0;
hashLastGetBlocksEnd = 0;
nStartingHeight = -1;
fGetAddr = false;
nMisbehavior = 0;
hashCheckpointKnown = 0;
setInventoryKnown.max_size(SendBufferSize() / 1000);
// Be shy and don't send version until we hear
if (hSocket != INVALID_SOCKET && !fInbound)
PushVersion();
}
~CNode()
{
if (hSocket != INVALID_SOCKET)
{
closesocket(hSocket);
hSocket = INVALID_SOCKET;
}
}
private:
CNode(const CNode&);
void operator=(const CNode&);
public:
int GetRefCount()
{
assert(nRefCount >= 0);
return nRefCount;
}
// requires LOCK(cs_vRecvMsg)
unsigned int GetTotalRecvSize()
{
unsigned int total = 0;
BOOST_FOREACH(const CNetMessage &msg, vRecvMsg)
total += msg.vRecv.size() + 24;
return total;
}
// requires LOCK(cs_vRecvMsg)
bool ReceiveMsgBytes(const char *pch, unsigned int nBytes);
// requires LOCK(cs_vRecvMsg)
void SetRecvVersion(int nVersionIn)
{
nRecvVersion = nVersionIn;
BOOST_FOREACH(CNetMessage &msg, vRecvMsg)
msg.SetVersion(nVersionIn);
}
CNode* AddRef()
{
nRefCount++;
return this;
}
void Release()
{
nRefCount--;
}
void AddAddressKnown(const CAddress& addr)
{
setAddrKnown.insert(addr);
}
void PushAddress(const CAddress& addr)
{
// Known checking here is only to save space from duplicates.
// SendMessages will filter it again for knowns that were added
// after addresses were pushed.
if (addr.IsValid() && !setAddrKnown.count(addr))
vAddrToSend.push_back(addr);
}
void AddInventoryKnown(const CInv& inv)
{
{
LOCK(cs_inventory);
setInventoryKnown.insert(inv);
}
}
void PushInventory(const CInv& inv)
{
{
LOCK(cs_inventory);
if (!setInventoryKnown.count(inv))
vInventoryToSend.push_back(inv);
}
}
void AskFor(const CInv& inv)
{
// We're using mapAskFor as a priority queue,
// the key is the earliest time the request can be sent
int64_t& nRequestTime = mapAlreadyAskedFor[inv];
if (fDebugNet)
printf("askfor %s %"PRId64" (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str());
// Make sure not to reuse time indexes to keep things in the same order
int64_t nNow = (GetTime() - 1) * 1000000;
static int64_t nLastTime;
++nLastTime;
nNow = std::max(nNow, nLastTime);
nLastTime = nNow;
// Each retry is 2 minutes after the last
nRequestTime = std::max(nRequestTime + 2 * 60 * 1000000, nNow);
mapAskFor.insert(std::make_pair(nRequestTime, inv));
}
void BeginMessage(const char* pszCommand)
{
ENTER_CRITICAL_SECTION(cs_vSend);
assert(ssSend.size() == 0);
ssSend << CMessageHeader(pszCommand, 0);
if (fDebug)
printf("sending: %s ", pszCommand);
}
void AbortMessage()
{
ssSend.clear();
LEAVE_CRITICAL_SECTION(cs_vSend);
if (fDebug)
printf("(aborted)\n");
}
void EndMessage()
{
if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0)
{
printf("dropmessages DROPPING SEND MESSAGE\n");
AbortMessage();
return;
}
if (ssSend.size() == 0)
return;
// Set the size
unsigned int nSize = ssSend.size() - CMessageHeader::HEADER_SIZE;
memcpy((char*)&ssSend[CMessageHeader::MESSAGE_SIZE_OFFSET], &nSize, sizeof(nSize));
// Set the checksum
uint256 hash = Hash(ssSend.begin() + CMessageHeader::HEADER_SIZE, ssSend.end());
unsigned int nChecksum = 0;
memcpy(&nChecksum, &hash, sizeof(nChecksum));
assert(ssSend.size () >= CMessageHeader::CHECKSUM_OFFSET + sizeof(nChecksum));
memcpy((char*)&ssSend[CMessageHeader::CHECKSUM_OFFSET], &nChecksum, sizeof(nChecksum));
if (fDebug) {
printf("(%d bytes)\n", nSize);
}
std::deque<CSerializeData>::iterator it = vSendMsg.insert(vSendMsg.end(), CSerializeData());
ssSend.GetAndClear(*it);
nSendSize += (*it).size();
// If write queue empty, attempt "optimistic write"
if (it == vSendMsg.begin())
SocketSendData(this);
LEAVE_CRITICAL_SECTION(cs_vSend);
}
void PushVersion();
void PushMessage(const char* pszCommand)
{
try
{
BeginMessage(pszCommand);
EndMessage();
}
catch (...)
{
AbortMessage();
throw;
}
}
template<typename T1>
void PushMessage(const char* pszCommand, const T1& a1)
{
try
{
BeginMessage(pszCommand);
ssSend << a1;
EndMessage();
}
catch (...)
{
AbortMessage();
throw;
}
}
template<typename T1, typename T2>
void PushMessage(const char* pszCommand, const T1& a1, const T2& a2)
{
try
{
BeginMessage(pszCommand);
ssSend << a1 << a2;
EndMessage();
}
catch (...)
{
AbortMessage();
throw;
}
}
template<typename T1, typename T2, typename T3>
void PushMessage(const char* pszCommand, const T1& a1, const T2& a2, const T3& a3)
{
try
{
BeginMessage(pszCommand);
ssSend << a1 << a2 << a3;
EndMessage();
}
catch (...)
{
AbortMessage();
throw;
}
}
template<typename T1, typename T2, typename T3, typename T4>
void PushMessage(const char* pszCommand, const T1& a1, const T2& a2, const T3& a3, const T4& a4)
{
try
{
BeginMessage(pszCommand);
ssSend << a1 << a2 << a3 << a4;
EndMessage();
}
catch (...)
{
AbortMessage();
throw;
}
}
template<typename T1, typename T2, typename T3, typename T4, typename T5>
void PushMessage(const char* pszCommand, const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5)
{
try
{
BeginMessage(pszCommand);
ssSend << a1 << a2 << a3 << a4 << a5;
EndMessage();
}
catch (...)
{
AbortMessage();
throw;
}
}
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
void PushMessage(const char* pszCommand, const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5, const T6& a6)
{
try
{
BeginMessage(pszCommand);
ssSend << a1 << a2 << a3 << a4 << a5 << a6;
EndMessage();
}
catch (...)
{
AbortMessage();
throw;
}
}
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
void PushMessage(const char* pszCommand, const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5, const T6& a6, const T7& a7)
{
try
{
BeginMessage(pszCommand);
ssSend << a1 << a2 << a3 << a4 << a5 << a6 << a7;
EndMessage();
}
catch (...)
{
AbortMessage();
throw;
}
}
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
void PushMessage(const char* pszCommand, const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5, const T6& a6, const T7& a7, const T8& a8)
{
try
{
BeginMessage(pszCommand);
ssSend << a1 << a2 << a3 << a4 << a5 << a6 << a7 << a8;
EndMessage();
}
catch (...)
{
AbortMessage();
throw;
}
}
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
void PushMessage(const char* pszCommand, const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5, const T6& a6, const T7& a7, const T8& a8, const T9& a9)
{
try
{
BeginMessage(pszCommand);
ssSend << a1 << a2 << a3 << a4 << a5 << a6 << a7 << a8 << a9;
EndMessage();
}
catch (...)
{
AbortMessage();
throw;
}
}
void PushRequest(const char* pszCommand,
void (*fn)(void*, CDataStream&), void* param1)
{
uint256 hashReply;
RAND_bytes((unsigned char*)&hashReply, sizeof(hashReply));
{
LOCK(cs_mapRequests);
mapRequests[hashReply] = CRequestTracker(fn, param1);
}
PushMessage(pszCommand, hashReply);
}
template<typename T1>
void PushRequest(const char* pszCommand, const T1& a1,
void (*fn)(void*, CDataStream&), void* param1)
{
uint256 hashReply;
RAND_bytes((unsigned char*)&hashReply, sizeof(hashReply));
{
LOCK(cs_mapRequests);
mapRequests[hashReply] = CRequestTracker(fn, param1);
}
PushMessage(pszCommand, hashReply, a1);
}
template<typename T1, typename T2>
void PushRequest(const char* pszCommand, const T1& a1, const T2& a2,
void (*fn)(void*, CDataStream&), void* param1)
{
uint256 hashReply;
RAND_bytes((unsigned char*)&hashReply, sizeof(hashReply));
{
LOCK(cs_mapRequests);
mapRequests[hashReply] = CRequestTracker(fn, param1);
}
PushMessage(pszCommand, hashReply, a1, a2);
}
void PushGetBlocks(CBlockIndex* pindexBegin, uint256 hashEnd);
bool IsSubscribed(unsigned int nChannel);
void Subscribe(unsigned int nChannel, unsigned int nHops=0);
void CancelSubscribe(unsigned int nChannel);
void CloseSocketDisconnect();
void Cleanup();
// Denial-of-service detection/prevention
// The idea is to detect peers that are behaving
// badly and disconnect/ban them, but do it in a
// one-coding-mistake-won't-shatter-the-entire-network
// way.
// IMPORTANT: There should be nothing I can give a
// node that it will forward on that will make that
// node's peers drop it. If there is, an attacker
// can isolate a node and/or try to split the network.
// Dropping a node for sending stuff that is invalid
// now but might be valid in a later version is also
// dangerous, because it can cause a network split
// between nodes running old code and nodes running
// new code.
static void ClearBanned(); // needed for unit testing
static bool IsBanned(CNetAddr ip);
bool Misbehaving(int howmuch); // 1 == a little, 100 == a lot
void copyStats(CNodeStats &stats);
};
inline void RelayInventory(const CInv& inv)
{
// Put on lists to offer to the other nodes
{
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
pnode->PushInventory(inv);
}
}
class CTransaction;
void RelayTransaction(const CTransaction& tx, const uint256& hash);
void RelayTransaction(const CTransaction& tx, const uint256& hash, const CDataStream& ss);
#endif
| [
"[email protected]"
] | |
b54deb179a16e5e35b65d14ce846e8b8fcebc904 | e4355967555857fd536787dce39ca30426ffa702 | /YouLe/You_系统模块/游戏组件/常规游戏/斗地主/游戏服务器/GameLogic.h | 68ecbeffd4168f179509fb9ea1d671552301f4f7 | [] | no_license | herox25000/oathx-ogrex-editor | f0fd6044f8065db9cb50a80376e52f502734e877 | f645c7997f27e11a9063a0d352accd98a474cef1 | refs/heads/master | 2020-12-24T14:35:34.912603 | 2013-08-24T06:20:06 | 2013-08-24T06:20:06 | 32,935,652 | 6 | 9 | null | null | null | null | GB18030 | C++ | false | false | 13,106 | h | #ifndef GAME_LOGIC_HEAD_FILE
#define GAME_LOGIC_HEAD_FILE
#pragma once
#include "Stdafx.h"
//////////////////////////////////////////////////////////////////////////
//排序类型
#define ST_ORDER 0 //大小排序
#define ST_COUNT 1 //数目排序
//////////////////////////////////////////////////////////////////////////
//数目定义
#define MAX_COUNT 20 //最大数目
#define FULL_COUNT 54 //全牌数目
#define GOOD_CARD_COUTN 38 //好牌数目
#define BACK_COUNT 3 //底牌数目
#define NORMAL_COUNT 17 //常规数目
//////////////////////////////////////////////////////////////////////////
//数值掩码
#define MASK_COLOR 0xF0 //花色掩码
#define MASK_VALUE 0x0F //数值掩码
//扑克类型
#define CT_ERROR 0 //错误类型
#define CT_SINGLE 1 //单牌类型
#define CT_DOUBLE 2 //对牌类型
#define CT_THREE 3 //三条类型
#define CT_SINGLE_LINE 4 //单连类型
#define CT_DOUBLE_LINE 5 //对连类型
#define CT_THREE_LINE 6 //三连类型
#define CT_THREE_LINE_TAKE_ONE 7 //三带一单
#define CT_THREE_LINE_TAKE_TWO 8 //三带一对
#define CT_FOUR_LINE_TAKE_ONE 9 //四带两单
#define CT_FOUR_LINE_TAKE_TWO 10 //四带两对
#define CT_BOMB_CARD 11 //炸弹类型
#define CT_MISSILE_CARD 12 //火箭类型
//////////////////////////////////////////////////////////////////////////
//分析结构
struct tagAnalyseResult
{
BYTE cbFourCount; //四张数目
BYTE cbThreeCount; //三张数目
BYTE cbDoubleCount; //两张数目
BYTE cbSignedCount; //单张数目
BYTE cbFourCardData[MAX_COUNT]; //四张扑克
BYTE cbThreeCardData[MAX_COUNT]; //三张扑克
BYTE cbDoubleCardData[MAX_COUNT]; //两张扑克
BYTE cbSignedCardData[MAX_COUNT]; //单张扑克
};
//出牌结果
struct tagOutCardResult
{
BYTE cbCardCount; //扑克数目
BYTE cbResultCard[MAX_COUNT]; //结果扑克
};
#define MAX_TYPE_COUNT 254
struct tagOutCardTypeResult
{
BYTE cbCardType; //扑克类型
BYTE cbCardTypeCount; //牌型数目
BYTE cbEachHandCardCount[MAX_TYPE_COUNT];//每手个数
BYTE cbCardData[MAX_TYPE_COUNT][MAX_COUNT];//扑克数据
};
//扑克信息
struct tagHandCardInfo {
BYTE cbHandCardData[ MAX_COUNT ]; //扑克数据
BYTE cbHandCardCount; //扑克数目
tagOutCardTypeResult CardTypeResult[ 12 + 1 ] ; //分析数据
//初始数据
tagHandCardInfo( void ) {
ZeroMemory( cbHandCardData, sizeof( cbHandCardData ) ) ;
cbHandCardCount = 0;
ZeroMemory( &CardTypeResult, sizeof( CardTypeResult ) );
}
};
//类型定义
typedef CArrayTemplate< tagHandCardInfo * > tagHandCardInfoArray;
//栈结构
class tagStackHandCardInfo {
//内联函数
public:
//构造函数
tagStackHandCardInfo( void ) {
m_HandCardInfoFreeArray.RemoveAll();
m_HandCardInfoArray.RemoveAll();
}
//析构函数
~tagStackHandCardInfo( void ) {
//清空栈
ClearAll();
}
//元素压栈
void Push( tagHandCardInfo * pHandCardInfo ) {
//是否还有空间
if ( 0 < m_HandCardInfoFreeArray.GetCount() ) {
//获取空间
tagHandCardInfo * pHandCardInfoFree = m_HandCardInfoFreeArray[ 0 ];
m_HandCardInfoFreeArray.RemoveAt( 0 );
//元素赋值
CopyMemory( pHandCardInfoFree->cbHandCardData, pHandCardInfo->cbHandCardData, sizeof( pHandCardInfoFree->cbHandCardData ) );
pHandCardInfoFree->cbHandCardCount = pHandCardInfo->cbHandCardCount;
CopyMemory( pHandCardInfoFree->CardTypeResult, pHandCardInfo->CardTypeResult, sizeof( pHandCardInfo->CardTypeResult ) );
//压入栈顶
INT_PTR nECount = m_HandCardInfoArray.GetCount() ;
m_HandCardInfoArray.InsertAt( nECount, pHandCardInfoFree );
}
else {
//申请空间
tagHandCardInfo * pNewHandCardInfo = new tagHandCardInfo ;
//元素赋值
CopyMemory( pNewHandCardInfo->cbHandCardData, pHandCardInfo->cbHandCardData, sizeof( pNewHandCardInfo->cbHandCardData ) );
pNewHandCardInfo->cbHandCardCount = pHandCardInfo->cbHandCardCount;
CopyMemory( pNewHandCardInfo->CardTypeResult, pHandCardInfo->CardTypeResult, sizeof( pHandCardInfo->CardTypeResult ) );
//压入栈顶
INT_PTR nECount = m_HandCardInfoArray.GetCount() ;
m_HandCardInfoArray.InsertAt( nECount, pNewHandCardInfo );
}
}
//弹出栈顶
void Pop() {
//非空判断
if ( IsEmpty() ) return ;
//获取元素
INT_PTR nECount = m_HandCardInfoArray.GetCount() ;
tagHandCardInfo * pTopHandCardInfo = m_HandCardInfoArray.GetAt( nECount - 1 );
//移除元素
m_HandCardInfoArray.RemoveAt( nECount - 1 );
//保存空间
m_HandCardInfoFreeArray.Add( pTopHandCardInfo );
}
//初始栈
void InitStack() {
//保存空间
while ( 0 < m_HandCardInfoArray.GetCount() ) {
tagHandCardInfo *pHandCardInfo = m_HandCardInfoArray[ 0 ];
m_HandCardInfoArray.RemoveAt( 0 );
m_HandCardInfoFreeArray.Add( pHandCardInfo );
}
}
//清空栈
void ClearAll() {
//释放内存
while ( 0 < m_HandCardInfoArray.GetCount() ) {
tagHandCardInfo *pHandCardInfo = m_HandCardInfoArray[ 0 ];
delete pHandCardInfo;
pHandCardInfo = NULL;
m_HandCardInfoArray.RemoveAt( 0 );
}
//释放内存
while ( 0 < m_HandCardInfoFreeArray.GetCount() ) {
tagHandCardInfo *pHandCardInfo = m_HandCardInfoFreeArray[ 0 ];
delete pHandCardInfo;
pHandCardInfo = NULL;
m_HandCardInfoFreeArray.RemoveAt( 0 );
}
}
//获取栈顶
void GetTop( tagHandCardInfo * & pHandCardInfo ) {
//非空判断
if ( IsEmpty() ) {
ASSERT( false );
return;
}
//获取元素
INT_PTR nECount = m_HandCardInfoArray.GetCount() ;
pHandCardInfo = m_HandCardInfoArray[ nECount - 1 ];
}
//空判断
bool IsEmpty() {
return m_HandCardInfoArray.IsEmpty();
}
//成员变量
private:
tagHandCardInfoArray m_HandCardInfoFreeArray; //扑克信息
tagHandCardInfoArray m_HandCardInfoArray; //扑克信息
};
//////////////////////////////////////////////////////////////////////////
//游戏逻辑类
class CGameLogic
{
//变量定义
protected:
static const BYTE m_cbCardData[FULL_COUNT]; //扑克数据
static const BYTE m_cbGoodcardData[GOOD_CARD_COUTN]; //好牌数据
//AI变量
public:
BYTE m_cbAllCardData[GAME_PLAYER][MAX_COUNT];//所有扑克
BYTE m_cbLandScoreCardData[MAX_COUNT]; //叫牌扑克
BYTE m_cbUserCardCount[GAME_PLAYER]; //扑克数目
WORD m_wBankerUser; //地主玩家
LONG m_lBankerOutCardCount ; //出牌次数
tagStackHandCardInfo m_StackHandCardInfo; //栈变量
//函数定义
public:
//构造函数
CGameLogic();
//析构函数
virtual ~CGameLogic();
//类型函数
public:
//获取类型
BYTE GetCardType(const BYTE cbCardData[], BYTE cbCardCount);
//获取数值
BYTE GetCardValue(BYTE cbCardData) { return cbCardData&MASK_VALUE; }
//获取花色
BYTE GetCardColor(BYTE cbCardData) { return cbCardData&MASK_COLOR; }
//控制函数
public:
//混乱扑克
void RandCardList(BYTE cbCardBuffer[], BYTE cbBufferCount);
//得到好牌
void GetGoodCardData(BYTE cbGoodCardData[NORMAL_COUNT]) ;
//删除好牌
bool RemoveGoodCardData(BYTE cbGoodcardData[NORMAL_COUNT], BYTE cbGoodCardCount, BYTE cbCardData[FULL_COUNT], BYTE cbCardCount) ;
//排列扑克
void SortCardList(BYTE cbCardData[], BYTE cbCardCount, BYTE cbSortType);
//删除扑克
bool RemoveCard(const BYTE cbRemoveCard[], BYTE cbRemoveCount, BYTE cbCardData[], BYTE cbCardCount);
//随机扑克
BYTE GetRandomCard(void) ;
//逻辑函数
public:
//有效判断
bool IsValidCard(BYTE cbCardData);
//逻辑数值
BYTE GetCardLogicValue(BYTE cbCardData);
//对比扑克
bool CompareCard(const BYTE cbFirstCard[], const BYTE cbNextCard[], BYTE cbFirstCount, BYTE cbNextCount);
//内部函数
public:
//分析扑克
bool AnalysebCardData(const BYTE cbCardData[], BYTE cbCardCount, tagAnalyseResult & AnalyseResult);
//////////////////////////////////////////////////////////////////////////
//AI函数
//设置函数
public:
//设置扑克
void SetUserCard(WORD wChairID, BYTE cbCardData[], BYTE cbCardCount) ;
//设置底牌
void SetBackCard(WORD wChairID, BYTE cbBackCardData[], BYTE cbCardCount) ;
//设置庄家
void SetBanker(WORD wBanker) ;
//叫牌扑克
void SetLandScoreCardData(BYTE cbCardData[], BYTE cbCardCount) ;
//删除扑克
void RemoveUserCardData(WORD wChairID, BYTE cbRemoveCardData[], BYTE cbRemoveCardCount) ;
//辅助函数
protected:
//组合算法
void Combination(BYTE cbCombineCardData[], BYTE cbResComLen, BYTE cbResultCardData[254][5], BYTE &cbResCardLen,BYTE cbSrcCardData[] , BYTE cbCombineLen1, BYTE cbSrcLen, const BYTE cbCombineLen2);
//排列算法
void Permutation(BYTE *list, int m, int n, BYTE result[][4], BYTE &len) ;
//分析炸弹
void GetAllBomCard(BYTE const cbHandCardData[], BYTE const cbHandCardCount, BYTE cbBomCardData[], BYTE &cbBomCardCount);
//分析顺子
void GetAllLineCard(BYTE const cbHandCardData[], BYTE const cbHandCardCount, BYTE cbLineCardData[], BYTE &cbLineCardCount);
//分析三条
void GetAllThreeCard(BYTE const cbHandCardData[], BYTE const cbHandCardCount, BYTE cbThreeCardData[], BYTE &cbThreeCardCount);
//分析对子
void GetAllDoubleCard(BYTE const cbHandCardData[], BYTE const cbHandCardCount, BYTE cbDoubleCardData[], BYTE &cbDoubleCardCount);
//分析单牌
void GetAllSingleCard(BYTE const cbHandCardData[], BYTE const cbHandCardCount, BYTE cbSingleCardData[], BYTE &cbSingleCardCount);
//出牌测试
bool _TestOutAllCard(WORD wTestUser, BYTE cbWantOutCardData[], BYTE cbWantOutCardCount, BYTE cbAllCardData[GAME_PLAYER][MAX_COUNT], BYTE cbUserCardCount[GAME_PLAYER], bool bFirstOutCard) ;
//出牌测试
bool TestOutAllCard(WORD wTestUser, BYTE cbWantOutCardData[], BYTE cbWantOutCardCount, bool bFirstOutCard) ;
//四带牌型
bool AnalyseFourCardType( BYTE const cbHandCardData[MAX_COUNT], BYTE cbHandCardCount, BYTE cbEnemyCardData[MAX_COUNT], BYTE cbEnemyCardCount, tagOutCardResult &CardResult ) ;
//最大判断
bool IsLargestCard( WORD wTestUser, BYTE const cbWantOutCardData[], BYTE const cbWantOutCardCount );
//是否能出
bool VerifyOutCard( WORD wTestUser, BYTE const cbWantOutCardData[], BYTE const cbWantOutCardCount, BYTE const cbCurHandCardData[ MAX_COUNT ], BYTE const cbCurHandCardCount, bool bFirstOutCard ) ;
//主要函数
protected:
//分析牌型(后出牌调用)
void AnalyseOutCardType(BYTE const cbHandCardData[], BYTE const cbHandCardCount, BYTE const cbTurnCardData[], BYTE const cbTurnCardCount, tagOutCardTypeResult CardTypeResult[12+1]);
//分析牌牌(先出牌调用)
void AnalyseOutCardType(BYTE const cbHandCardData[], BYTE const cbHandCardCount, tagOutCardTypeResult CardTypeResult[12+1]);
//单牌个数
BYTE AnalyseSinleCardCount(BYTE const cbHandCardData[], BYTE const cbHandCardCount, BYTE const cbWantOutCardData[], BYTE const cbWantOutCardCount, BYTE cbSingleCardData[]=NULL);
//出牌函数
public:
//地主出牌(先出牌)
void BankerOutCard(const BYTE cbHandCardData[], BYTE cbHandCardCount, tagOutCardResult & OutCardResult) ;
//地主出牌(后出牌)
void BankerOutCard(const BYTE cbHandCardData[], BYTE cbHandCardCount, WORD wOutCardUser, const BYTE cbTurnCardData[], BYTE cbTurnCardCount, tagOutCardResult & OutCardResult) ;
//地主上家(先出牌)
void UpsideOfBankerOutCard(const BYTE cbHandCardData[], BYTE cbHandCardCount, WORD wMeChairID,tagOutCardResult & OutCardResult) ;
//地主上家(后出牌)
void UpsideOfBankerOutCard(const BYTE cbHandCardData[], BYTE cbHandCardCount, WORD wOutCardUser, const BYTE cbTurnCardData[], BYTE cbTurnCardCount, tagOutCardResult & OutCardResult) ;
//地主下家(先出牌)
void UndersideOfBankerOutCard(const BYTE cbHandCardData[], BYTE cbHandCardCount, WORD wMeChairID,tagOutCardResult & OutCardResult) ;
//地主下家(后出牌)
void UndersideOfBankerOutCard(const BYTE cbHandCardData[], BYTE cbHandCardCount, WORD wOutCardUser, const BYTE cbTurnCardData[], BYTE cbTurnCardCount, tagOutCardResult & OutCardResult) ;
//出牌搜索
bool SearchOutCard(const BYTE cbHandCardData[], BYTE cbHandCardCount, const BYTE cbTurnCardData[], BYTE cbTurnCardCount, WORD wOutCardUser, WORD wMeChairID, tagOutCardResult & OutCardResult);
//叫分函数
public:
//叫分判断
BYTE LandScore(WORD wMeChairID, BYTE cbCurrentLandScore) ;
//////////////////////////////////////////////////////////////////////////
};
#endif
| [
"[email protected]@a113e17c-5e0c-ebba-c532-3ad10810a225"
] | [email protected]@a113e17c-5e0c-ebba-c532-3ad10810a225 |
f082c86051f408b2a75ec3b97f8a290b4ac5fed6 | 7413087200163bf0ac55ed563dbd737dcecb7ce4 | /ffmpeg_interface/cut_video_2.cpp | 0f5478bdb07c9759be3606ec6e86ec69902ca597 | [] | no_license | MRDUAN1/ffmpeg_decode_1 | 190b5ea860cff15910e33bb882f6fe46229bf754 | e555920433a58f5a20b414d65195d483dab9ee1d | refs/heads/master | 2021-05-02T14:33:16.607141 | 2018-02-28T03:48:40 | 2018-02-28T03:48:40 | 120,721,756 | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 6,889 | cpp | #include "cut_video_2.h"
//#include "commom_signal.h"
#include <qfileinfo.h>
extern QString outPutPath;
cut_video_2::cut_video_2(QObject *parent)
: commom_signal(parent)
{
}
void cut_video_2::deal_with(QString &str)
{
int j = str.count('\\');
int h = 0;
while (j--)
{
h = str.indexOf('\\', h);
str.replace(h, 1, '/');
}
}
//½ØÈ¡Ä³Ò»¶ÎÊÓÆµ
void cut_video_2::seek_stream()
{
int p;
int64_t dur_1, dur_2;
AVPacket packet; //= { .data = NULL, .size = 0 };
packet.data = NULL;
packet.size = 0;
if ((p = av_seek_frame(ifmt_ctx, -1, to * AV_TIME_BASE, AVSEEK_FLAG_ANY)) < 0)
{
fprintf(stderr, "%s: error while seeking/n", "wrong");
}
while (1)
{
av_read_frame(ifmt_ctx, &packet);
if (packet.stream_index == 0)
{
dur_2 = packet.pts;
break;
}
}
if ((p = av_seek_frame(ifmt_ctx, -1, from * AV_TIME_BASE, AVSEEK_FLAG_ANY)) < 0)
{
fprintf(stderr, "%s: error while seeking/n", "wrong");
}
int iA = 10;
while (iA--)
{
av_read_frame(ifmt_ctx, &packet);
int stream__ = packet.stream_index;
if (stream__ == 0)
{
if (packet.pts == AV_NOPTS_VALUE) continue;
dur_1 = ps_v = packet.pts;
ds_v = packet.dts;
}
else
{
ds_a = ps_a = packet.pts;
}
}
emit length_all_merge_video_((dur_2 - dur_1));
}
void cut_video_2::set_filename(QString str1, int from_, int to_)
{
input_name__ = str1;
from = from_;
to = to_;
QFileInfo filo(input_name__);
QString ss = filo.fileName();
str_separate = outPutPath + "/" + "_separate_" + ss;
}
void cut_video_2::get_filename(QString &str1)
{
str1 = input_name__;
}
int cut_video_2::start()
{
ifmt_ctx = NULL;
av_register_all();
if ((ret = avformat_open_input(&ifmt_ctx, input_name__.toLocal8Bit().data(), NULL, NULL)) < 0)
{
printf("can not open the in put file format context!\n");
return -1;
}
if ((ret = avformat_find_stream_info(ifmt_ctx, NULL)) < 0)
{
printf("can not find the input stream info!\n");
goto end;
}
avformat_alloc_output_context2(&ofmt1_ctx, NULL, NULL, str_separate.toLocal8Bit().data());
if (!ofmt1_ctx)
{
printf("Could not create output1 context\n");
ret = AVERROR_UNKNOWN;
goto end;
}
for (int i = 0; i < ifmt_ctx->nb_streams; i++)
{
if (ifmt_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
{
inVideo_StreamIndex = i;
out1_vstream = avformat_new_stream(ofmt1_ctx, NULL);
//open decoder
if (0 > avcodec_open2(ifmt_ctx->streams[i]->codec, avcodec_find_decoder(ifmt_ctx->streams[i]->codec->codec_id), NULL))
{
printf("can not find or open video decoder!\n");
goto end;
}
if (!out1_vstream)
{
printf("Failed allocating output1 video stream\n");
ret = AVERROR_UNKNOWN;
goto end;
}
else
{
//copy the settings of AVCodecContext;
if (avcodec_copy_context(out1_vstream->codec, ifmt_ctx->streams[i]->codec) < 0)
{
printf("Failed to copy context from input to output stream codec context\n");
goto end;
}
out1_vstream->codec->codec_tag = 0;
if (ofmt1_ctx->oformat->flags & AVFMT_GLOBALHEADER)
{
out1_vstream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
}
}
}
else if (ifmt_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
{
inAudio_StreamIndex = i;
out1_astream = avformat_new_stream(ofmt1_ctx, NULL);
if (!out1_astream)
{
printf("Failed allocating output1 video stream\n");
ret = AVERROR_UNKNOWN;
goto end;
}
else
{
//copy the settings of AVCodecContext;
if (avcodec_copy_context(out1_astream->codec, ifmt_ctx->streams[i]->codec) < 0)
{
printf("Failed to copy context from input to output stream codec context\n");
goto end;
}
out1_astream->codec->codec_tag = 0;
if (ofmt1_ctx->oformat->flags & AVFMT_GLOBALHEADER)
{
out1_astream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
}
}
}
}
int p1;
//open output1 file+ str_separate E:\outPut/_separate_222.mp4 QString
deal_with(str_separate);
if (!(ofmt1_ctx->oformat->flags & AVFMT_NOFILE))
{
p1 = avio_open(&ofmt1_ctx->pb, str_separate.toLocal8Bit().data(), AVIO_FLAG_WRITE);
if (p1 < 0 )
{
goto end;
}
}
//write out 1 file header
if (avformat_write_header(ofmt1_ctx, NULL) < 0)
{
printf("Error occurred when opening video output file\n");
goto end;
}
int videoIndex = 0;//the real video index
bool is_first_video = true, is_first_audio = true;
seek_stream();
AVPacket pkt;
while (1)
{
AVFormatContext *ofmt_ctx;
AVStream *in_stream, *out_stream;
if (av_read_frame(ifmt_ctx, &pkt) < 0)
{
break;
}
in_stream = ifmt_ctx->streams[pkt.stream_index];
if (pkt.stream_index == 0)
{
emit length_onect_merge_video_((pkt.pts - ps_v));
videoIndex++;
int time;
if (pkt.pts == AV_NOPTS_VALUE)
{
time = pkt.dts * (((float)in_stream->time_base.num) / ((float)in_stream->time_base.den));
pkt.pts = pkt.dts;
}
else
time = pkt.pts * (((float)in_stream->time_base.num) / ((float)in_stream->time_base.den));
if (time > to)
{
break;
}
else
{
if (pkt.dts == pkt.pts)
{
if (pkt.pts <= ps_v || pkt.dts <= ds_v)
continue;
pkt.pts = pkt.pts - ps_v;
pkt.dts = pkt.dts - ds_v;
if (pkt.pts < pkt.dts)
continue;
}
else
{
if (pkt.pts <= ps_v || pkt.dts <= ds_v)
continue;
pkt.pts = pkt.pts - ps_v;
pkt.dts = pkt.dts - ds_v;
}
out_stream = ofmt1_ctx->streams[pkt.stream_index];
ofmt_ctx = ofmt1_ctx;
}
}
else if (pkt.stream_index == 1)
{
int time = pkt.pts * (((float)in_stream->time_base.num) / ((float)in_stream->time_base.den));
if (time > to)
{
break;
}
else
{
pkt.pts = pkt.pts - ps_a;
pkt.dts = pkt.dts - ds_a;
out_stream = ofmt1_ctx->streams[pkt.stream_index];
ofmt_ctx = ofmt1_ctx;
}
}
pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));
if (pkt.stream_index == 0)
pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));
else pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));
pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);
pkt.pos = -1;
int hh = 0;
int64_t u = pkt.pts;
hh = av_interleaved_write_frame(ofmt_ctx, &pkt);
if (hh < 0)
{
printf("Error muxing packet\n");
break;
}
av_free_packet(&pkt);
}
av_write_trailer(ofmt1_ctx);
int64_t ii = ofmt1_ctx->duration / AV_TIME_BASE;
end:
avformat_close_input(&ifmt_ctx);
/* close output */
if (ofmt1_ctx && !(ofmt1_ctx->oformat->flags & AVFMT_NOFILE))
avio_close(ofmt1_ctx->pb);
avformat_free_context(ofmt1_ctx);
return 0;
}
cut_video_2::~cut_video_2()
{
}
| [
"[email protected]"
] | |
3aba741919454b499687597bea50f8eafe77f5b1 | fcd50c791bdee879cf4551785008e97e4ab85092 | /src/algebra/sets/infinite_set.cpp | 064cbe9d2e131c40a1d98caa30cb4a8a97e1f4a4 | [
"MIT"
] | permissive | quentinguidee/cppCAS | 0795265990062f3e08cd4a914858dfab20313cca | 0990ae125ca2c5e978c3e228ea0be2ff049596fd | refs/heads/master | 2023-08-17T00:36:46.913230 | 2021-09-28T10:31:58 | 2021-09-28T10:31:58 | 303,831,912 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 178 | cpp | #include "infinite_set.hpp"
InfiniteSet::InfiniteSet(std::string symbol) :
symbol(symbol)
{
}
InfiniteSet::InfiniteSet(const InfiniteSet& set) :
symbol(set.symbol)
{
}
| [
"[email protected]"
] | |
c45c575d8482dcac2e07b220896681a0c150d557 | f82cd75666c164da58bb7fdaeabcac0f13377e38 | /numpy_eigen/src/autogen_test_module/test_11_03_float.cpp | cd7fcfd09358ed68895d20fa5362237ec0682588 | [] | no_license | omaris/Schweizer-Messer | 54b4639d3a30bed03db29458c713a05fdfa6f91a | ec4d523d9ac7c377e0701ce0b5fdede3043ecd8a | refs/heads/master | 2021-01-15T17:37:01.645963 | 2013-06-18T06:52:50 | 2013-06-18T06:52:50 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 259 | cpp | #include <Eigen/Core>
#include <numpy_eigen/boost_python_headers.hpp>
Eigen::Matrix<float, 11, 3> test_float_11_03(const Eigen::Matrix<float, 11, 3> & M)
{
return M;
}
void export_float_11_03()
{
boost::python::def("test_float_11_03",test_float_11_03);
}
| [
"[email protected]"
] | |
dd9f11fdcd30803a60015f00435e1301b44945c2 | a92beb5f22b9c8960b3a6a24199de8b69d4eb33d | /include/meta/all_values/impl/range.h | 1171decb8a37946acf4e53015a39649d26739b14 | [
"MIT"
] | permissive | rgreenblatt/path | 9d5336f0170a7fa5a3b6499587a8dfc80824d2a4 | 2057618ee3a6067c230c1c1c40856d2c9f5006b0 | refs/heads/master | 2023-08-07T12:14:15.128771 | 2021-10-04T14:47:30 | 2021-10-04T14:47:30 | 221,096,483 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,208 | h | #pragma once
#include "lib/assert.h"
#include "meta/all_values/all_values.h"
#include <limits>
template <std::unsigned_integral T, T begin, T end>
requires(begin <= end) struct RangeGen {
T value;
constexpr RangeGen() requires(begin != end) : value{begin} {}
constexpr RangeGen(T value) requires(begin != end) : value{value} {
debug_assert(value >= begin);
debug_assert(value < end);
}
constexpr operator T() const { return value; }
constexpr T operator()() const { return value; }
};
template <unsigned begin, unsigned end>
using Range = RangeGen<unsigned, begin, end>;
template <std::unsigned_integral T, T end> using UpToGen = RangeGen<T, 0, end>;
template <unsigned end> using UpTo = UpToGen<unsigned, end>;
// DO NOT DIRECTLY USE THIS FOR ALL VALUES!!! Will be VERY slow.
using IdxWrapper = UpTo<std::numeric_limits<unsigned>::max()>;
template <std::unsigned_integral T, T begin, T end>
struct AllValuesImpl<RangeGen<T, begin, end>> {
static constexpr auto values = [] {
std::array<RangeGen<T, begin, end>, end - begin> arr;
if constexpr (begin != end) {
for (T i = 0; i < arr.size(); ++i) {
arr[i] = i + begin;
}
}
return arr;
}();
};
| [
"[email protected]"
] | |
e277cde1f002147c81e45f2896bcabb88aa4bebd | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/curl/gumtree/curl_patch_hunk_71.cpp | 39cbd6995775f9a1bcb60d865ea6668037a66131 | [] | no_license | niuxu18/logTracker-old | 97543445ea7e414ed40bdc681239365d33418975 | f2b060f13a0295387fe02187543db124916eb446 | refs/heads/master | 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 846 | cpp | , stdout);
fputs(
" uncompressed document. If this option is used and\n"
" the server sends an unsupported encoding, Curl will\n"
" report an error.\n"
"\n"
-" If this option is used several times, each occur-\n"
+" If this option is used several times, each occur\n"
" rence will toggle it on/off.\n"
"\n"
" --connect-timeout <seconds>\n"
-" Maximum time in seconds that you allow the connec-\n"
+" Maximum time in seconds that you allow the connec\n"
" tion to the server to take. This only limits the\n"
, stdout);
fputs(
" connection phase, once curl has connected this\n"
" option is of no more use. See also the --max-time\n"
" option.\n"
| [
"[email protected]"
] | |
09defdb005448da51ba4d65cb138feffd81cf4bd | bfcdac0942d73110c0c082c5b038ed91aecb024e | /sample_projects/cancer_immune/custom_modules/cancer_immune_3D.cpp | 18182cac1e01f756b2faa9091c9923fd086f522d | [] | no_license | rheiland/cryobio | f824b7c3846f5a767c7cbc439b4f5409c54ca95e | 146a69633f74117f7e7cffb9f887ee153894743a | refs/heads/master | 2020-03-28T23:36:03.047670 | 2018-09-18T14:15:14 | 2018-09-18T14:15:14 | 149,299,251 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 26,666 | cpp | /*
###############################################################################
# If you use PhysiCell in your project, please cite PhysiCell and the version #
# number, such as below: #
# #
# We implemented and solved the model using PhysiCell (Version x.y.z) [1]. #
# #
# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, #
# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- #
# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 #
# DOI: 10.1371/journal.pcbi.1005991 #
# #
# See VERSION.txt or call get_PhysiCell_version() to get the current version #
# x.y.z. Call display_citations() to get detailed information on all cite-#
# able software used in your PhysiCell application. #
# #
# Because PhysiCell extensively uses BioFVM, we suggest you also cite BioFVM #
# as below: #
# #
# We implemented and solved the model using PhysiCell (Version x.y.z) [1], #
# with BioFVM [2] to solve the transport equations. #
# #
# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, #
# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- #
# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 #
# DOI: 10.1371/journal.pcbi.1005991 #
# #
# [2] A Ghaffarizadeh, SH Friedman, and P Macklin, BioFVM: an efficient para- #
# llelized diffusive transport solver for 3-D biological simulations, #
# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 #
# #
###############################################################################
# #
# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) #
# #
# Copyright (c) 2015-2018, Paul Macklin and the PhysiCell Project #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, #
# this list of conditions and the following disclaimer. #
# #
# 2. 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. #
# #
# 3. Neither the name of the copyright holder nor the names of its #
# contributors may be used to endorse or promote products derived from this #
# software without specific prior written permission. #
# #
# 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. #
# #
###############################################################################
*/
#include "./cancer_immune_3D.h"
Cell_Definition immune_cell;
void create_immune_cell_type( void )
{
immune_cell = cell_defaults;
immune_cell.name = "immune cell";
immune_cell.type = 1;
// turn off proliferation;
int cycle_start_index = live.find_phase_index( PhysiCell_constants::live );
int cycle_end_index = live.find_phase_index( PhysiCell_constants::live );
immune_cell.phenotype.cycle.data.transition_rate(cycle_start_index,cycle_end_index) = 0.0;
int apoptosis_index = cell_defaults.phenotype.death.find_death_model_index( PhysiCell_constants::apoptosis_death_model );
// reduce o2 uptake
immune_cell.phenotype.secretion.uptake_rates[0] *= 0.1;
// set apoptosis to survive 10 days (on average)
immune_cell.phenotype.death.rates[apoptosis_index] = 1.0 / (10.0 * 24.0 * 60.0 );
// turn on motility;
immune_cell.phenotype.motility.is_motile = true;
immune_cell.phenotype.motility.persistence_time = 10.0;
immune_cell.phenotype.motility.migration_speed = 1;
immune_cell.phenotype.motility.migration_bias = 0.5;
immune_cell.phenotype.mechanics.cell_cell_adhesion_strength *= 0.0;
immune_cell.phenotype.mechanics.cell_cell_repulsion_strength *= 5.0;
// set functions
immune_cell.functions.update_phenotype = NULL;
immune_cell.functions.custom_cell_rule = immune_cell_rule;
immune_cell.functions.update_migration_bias = immune_cell_motility;
// set custom data values
immune_cell.custom_data[ "oncoprotein" ] = 0.0;
immune_cell.custom_data[ "kill rate" ] = 1.0/15.0; // how often it tries to kill
immune_cell.custom_data[ "attachment lifetime" ] = 60.00; // how long it can stay attached
immune_cell.custom_data[ "attachment rate" ] = 1.0/5.0; // how long it wants to wander before attaching
return;
}
void create_cell_types( void )
{
// use the same random seed so that future experiments have the
// same initial histogram of oncoprotein, even if threading means
// that future division and other events are still not identical
// for all runs
SeedRandom(0);
// housekeeping
initialize_default_cell_definition();
cell_defaults.phenotype.secretion.sync_to_microenvironment( µenvironment );
// turn the default cycle model to live,
// so it's easier to turn off proliferation
cell_defaults.phenotype.cycle.sync_to_cycle_model( live );
// Make sure we're ready for 2D
cell_defaults.functions.set_orientation = up_orientation;
// cell_defaults.phenotype.geometry.polarity = 1.0;
cell_defaults.phenotype.motility.restrict_to_2D = false; // true;
// set to no motility for cancer cells
cell_defaults.phenotype.motility.is_motile = false;
// use default proliferation and death
int cycle_start_index = live.find_phase_index( PhysiCell_constants::live );
int cycle_end_index = live.find_phase_index( PhysiCell_constants::live );
int apoptosis_index = cell_defaults.phenotype.death.find_death_model_index( PhysiCell_constants::apoptosis_death_model );
cell_defaults.parameters.o2_proliferation_saturation = 38.0;
cell_defaults.parameters.o2_reference = 38.0;
// set default uptake and secretion
// oxygen
cell_defaults.phenotype.secretion.secretion_rates[0] = 0;
cell_defaults.phenotype.secretion.uptake_rates[0] = 10;
cell_defaults.phenotype.secretion.saturation_densities[0] = 38;
// immunostimulatory
cell_defaults.phenotype.secretion.saturation_densities[1] = 1;
// set the default cell type to o2-based proliferation with the effect of the
// on oncoprotein, and secretion of the immunostimulatory factor
cell_defaults.functions.update_phenotype = tumor_cell_phenotype_with_and_immune_stimulation;
// add the extra bit of "attachment" mechanics
cell_defaults.functions.custom_cell_rule = extra_elastic_attachment_mechanics;
cell_defaults.name = "cancer cell";
cell_defaults.type = 0;
// add custom data
cell_defaults.custom_data.add_variable( "oncoprotein" , "dimensionless", 1.0 );
cell_defaults.custom_data.add_variable( "elastic coefficient" , "1/min" , 0.01 );
cell_defaults.custom_data.add_variable( "kill rate" , "1/min" , 0 ); // how often it tries to kill
cell_defaults.custom_data.add_variable( "attachment lifetime" , "min" , 0 ); // how long it can stay attached
cell_defaults.custom_data.add_variable( "attachment rate" , "1/min" ,0 ); // how long it wants to wander before attaching
// create the immune cell type
create_immune_cell_type();
return;
}
void setup_microenvironment( void )
{
// set domain parameters
/*
default_microenvironment_options.X_range = {-1000, 1000};
default_microenvironment_options.Y_range = {-1000, 1000};
default_microenvironment_options.Z_range = {-1000, 1000};
*/
default_microenvironment_options.X_range = {-750, 750};
default_microenvironment_options.Y_range = {-750, 750};
default_microenvironment_options.Z_range = {-750, 750};
default_microenvironment_options.simulate_2D = false;
// gradients are needed for this example
default_microenvironment_options.calculate_gradients = true;
// add the immunostimulatory factor
microenvironment.add_density( "immunostimulatory factor", "dimensionless" );
microenvironment.diffusion_coefficients[1] = 1e3;
microenvironment.decay_rates[1] = .016;
// let BioFVM use oxygen as the default
default_microenvironment_options.use_oxygen_as_first_field = true;
// set Dirichlet conditions
default_microenvironment_options.outer_Dirichlet_conditions = true;
default_microenvironment_options.Dirichlet_condition_vector[0] = 38; // physioxic conditions
default_microenvironment_options.Dirichlet_condition_vector[1] = 0;
default_microenvironment_options.Dirichlet_activation_vector[1] = false; // no Dirichlet for the immunostimulatory factor
initialize_microenvironment();
return;
}
void introduce_immune_cells( void )
{
double tumor_radius = -9e9; // 250.0;
double temp_radius = 0.0;
// for the loop, deal with the (faster) norm squared
for( int i=0; i < (*all_cells).size() ; i++ )
{
temp_radius = norm_squared( (*all_cells)[i]->position );
if( temp_radius > tumor_radius )
{ tumor_radius = temp_radius; }
}
// now square root to get to radius
tumor_radius = sqrt( tumor_radius );
// if this goes wackadoodle, choose 250
if( tumor_radius < 250.0 )
{ tumor_radius = 250.0; }
std::cout << "current tumor radius: " << tumor_radius << std::endl;
// now seed immune cells
int number_of_immune_cells = 7500; // 100; // 40;
double radius_inner = tumor_radius + 30.0; // 75 // 50;
double radius_outer = radius_inner + 75.0; // 100; // 1000 - 50.0;
double mean_radius = 0.5*(radius_inner + radius_outer);
double std_radius = 0.33*( radius_outer-radius_inner)/2.0;
for( int i=0 ;i < number_of_immune_cells ; i++ )
{
double theta = UniformRandom() * 6.283185307179586476925286766559;
double phi = acos( 2.0*UniformRandom() - 1.0 );
double radius = NormalRandom( mean_radius, std_radius );
Cell* pCell = create_cell( immune_cell );
pCell->assign_position( radius*cos(theta)*sin(phi), radius*sin(theta)*sin(phi), radius*cos(phi) );
}
return;
}
std::vector<std::vector<double>> create_cell_sphere_positions(double cell_radius, double sphere_radius)
{
std::vector<std::vector<double>> cells;
int xc=0,yc=0,zc=0;
double x_spacing= cell_radius*sqrt(3);
double y_spacing= cell_radius*2;
double z_spacing= cell_radius*sqrt(3);
std::vector<double> tempPoint(3,0.0);
// std::vector<double> cylinder_center(3,0.0);
for(double z=-sphere_radius;z<sphere_radius;z+=z_spacing, zc++)
{
for(double x=-sphere_radius;x<sphere_radius;x+=x_spacing, xc++)
{
for(double y=-sphere_radius;y<sphere_radius;y+=y_spacing, yc++)
{
tempPoint[0]=x + (zc%2) * 0.5 * cell_radius;
tempPoint[1]=y + (xc%2) * cell_radius;
tempPoint[2]=z;
if(sqrt(norm_squared(tempPoint))< sphere_radius)
{ cells.push_back(tempPoint); }
}
}
}
return cells;
}
void setup_tissue( void )
{
// place a cluster of tumor cells at the center
double cell_radius = cell_defaults.phenotype.geometry.radius;
double cell_spacing = 0.95 * 2.0 * cell_radius;
double tumor_radius = 250.0;
Cell* pCell = NULL;
std::vector<std::vector<double>> positions = create_cell_sphere_positions(cell_radius,tumor_radius);
std::cout << "creating " << positions.size() << " closely-packed tumor cells ... " << std::endl;
for( int i=0; i < positions.size(); i++ )
{
pCell = create_cell(); // tumor cell
pCell->assign_position( positions[i] );
pCell->custom_data[0] = NormalRandom( 1.0, 0.25 );
}
double sum = 0.0;
double min = 9e9;
double max = -9e9;
for( int i=0; i < all_cells->size() ; i++ )
{
double r = (*all_cells)[i]->custom_data[0];
sum += r;
if( r < min )
{ min = r; }
if( r > max )
{ max = r; }
}
double mean = sum / ( all_cells->size() + 1e-15 );
// compute standard deviation
sum = 0.0;
for( int i=0; i < all_cells->size(); i++ )
{
sum += ( (*all_cells)[i]->custom_data[0] - mean )*( (*all_cells)[i]->custom_data[0] - mean );
}
double standard_deviation = sqrt( sum / ( all_cells->size() - 1.0 + 1e-15 ) );
std::cout << std::endl << "Oncoprotein summary: " << std::endl
<< "===================" << std::endl;
std::cout << "mean: " << mean << std::endl;
std::cout << "standard deviation: " << standard_deviation << std::endl;
std::cout << "[min max]: [" << min << " " << max << "]" << std::endl << std::endl;
return;
}
// custom cell phenotype function to scale immunostimulatory factor with hypoxia
void tumor_cell_phenotype_with_and_immune_stimulation( Cell* pCell, Phenotype& phenotype, double dt )
{
static int cycle_start_index = live.find_phase_index( PhysiCell_constants::live );
static int cycle_end_index = live.find_phase_index( PhysiCell_constants::live );
static int oncoprotein_i = pCell->custom_data.find_variable_index( "oncoprotein" );
// update secretion rates based on hypoxia
static int o2_index = microenvironment.find_density_index( "oxygen" );
static int immune_factor_index = microenvironment.find_density_index( "immunostimulatory factor" );
double o2 = pCell->nearest_density_vector()[o2_index];
/*
if( o2 > pCell->parameters.o2_hypoxic_response )
{
phenotype.secretion.secretion_rates[immune_factor_index] = 0.0;
}
else
{
double hypoxia = ( pCell->parameters.o2_hypoxic_response - o2 ) / ( pCell->parameters.o2_hypoxic_response + 1e-13 );
phenotype.secretion.secretion_rates[ immune_factor_index ] = 10.0 * hypoxia;
}
*/
// new
phenotype.secretion.secretion_rates[immune_factor_index] = 10.0;
update_cell_and_death_parameters_O2_based(pCell,phenotype,dt);
// if cell is dead, don't bother with future phenotype changes.
// set it to secrete the immunostimulatory factor
if( phenotype.death.dead == true )
{
phenotype.secretion.secretion_rates[immune_factor_index] = 10;
pCell->functions.update_phenotype = NULL;
return;
}
// multiply proliferation rate by the oncoprotein
phenotype.cycle.data.transition_rate( cycle_start_index ,cycle_end_index ) *= pCell->custom_data[oncoprotein_i] ;
return;
}
std::vector<std::string> cancer_immune_coloring_function( Cell* pCell )
{
static int oncoprotein_i = pCell->custom_data.find_variable_index( "oncoprotein" );
// immune are black
std::vector< std::string > output( 4, "black" );
if( pCell->type == 1 )
{
output[0] = "lime";
output[1] = "lime";
output[2] = "green";
return output;
}
// if I'm under attack, color me
if( pCell->state.neighbors.size() > 0 )
{
output[0] = "darkcyan"; // orangered // "purple"; // 128,0,128
output[1] = "black"; // "magenta";
output[2] = "cyan"; // "magenta"; //255,0,255
return output;
}
// live cells are green, but shaded by oncoprotein value
if( pCell->phenotype.death.dead == false )
{
int oncoprotein = (int) round( 0.5 * pCell->custom_data[oncoprotein_i] * 255.0 );
char szTempString [128];
sprintf( szTempString , "rgb(%u,%u,%u)", oncoprotein, oncoprotein, 255-oncoprotein );
output[0].assign( szTempString );
output[1].assign( szTempString );
sprintf( szTempString , "rgb(%u,%u,%u)", (int)round(output[0][0]/2.0) , (int)round(output[0][1]/2.0) , (int)round(output[0][2]/2.0) );
output[2].assign( szTempString );
return output;
}
// if not, dead colors
if (pCell->phenotype.cycle.current_phase().code == PhysiCell_constants::apoptotic ) // Apoptotic - Red
{
output[0] = "rgb(255,0,0)";
output[2] = "rgb(125,0,0)";
}
// Necrotic - Brown
if( pCell->phenotype.cycle.current_phase().code == PhysiCell_constants::necrotic_swelling ||
pCell->phenotype.cycle.current_phase().code == PhysiCell_constants::necrotic_lysed ||
pCell->phenotype.cycle.current_phase().code == PhysiCell_constants::necrotic )
{
output[0] = "rgb(250,138,38)";
output[2] = "rgb(139,69,19)";
}
return output;
}
void add_elastic_velocity( Cell* pActingOn, Cell* pAttachedTo , double elastic_constant )
{
std::vector<double> displacement = pAttachedTo->position - pActingOn->position;
axpy( &(pActingOn->velocity) , elastic_constant , displacement );
return;
}
void extra_elastic_attachment_mechanics( Cell* pCell, Phenotype& phenotype, double dt )
{
for( int i=0; i < pCell->state.neighbors.size() ; i++ )
{
add_elastic_velocity( pCell, pCell->state.neighbors[i], pCell->custom_data["elastic coefficient"] );
}
return;
}
void attach_cells( Cell* pCell_1, Cell* pCell_2 )
{
#pragma omp critical
{
bool already_attached = false;
for( int i=0 ; i < pCell_1->state.neighbors.size() ; i++ )
{
if( pCell_1->state.neighbors[i] == pCell_2 )
{ already_attached = true; }
}
if( already_attached == false )
{ pCell_1->state.neighbors.push_back( pCell_2 ); }
already_attached = false;
for( int i=0 ; i < pCell_2->state.neighbors.size() ; i++ )
{
if( pCell_2->state.neighbors[i] == pCell_1 )
{ already_attached = true; }
}
if( already_attached == false )
{ pCell_2->state.neighbors.push_back( pCell_1 ); }
}
return;
}
void dettach_cells( Cell* pCell_1 , Cell* pCell_2 )
{
#pragma omp critical
{
bool found = false;
int i = 0;
while( !found && i < pCell_1->state.neighbors.size() )
{
// if cell 2 is in cell 1's list, remove it
if( pCell_1->state.neighbors[i] == pCell_2 )
{
int n = pCell_1->state.neighbors.size();
// copy last entry to current position
pCell_1->state.neighbors[i] = pCell_1->state.neighbors[n-1];
// shrink by one
pCell_1->state.neighbors.pop_back();
found = true;
}
i++;
}
found = false;
i = 0;
while( !found && i < pCell_2->state.neighbors.size() )
{
// if cell 1 is in cell 2's list, remove it
if( pCell_2->state.neighbors[i] == pCell_1 )
{
int n = pCell_2->state.neighbors.size();
// copy last entry to current position
pCell_2->state.neighbors[i] = pCell_2->state.neighbors[n-1];
// shrink by one
pCell_2->state.neighbors.pop_back();
found = true;
}
i++;
}
}
return;
}
void immune_cell_motility( Cell* pCell, Phenotype& phenotype, double dt )
{
// if attached, biased motility towards director chemoattractant
// otherwise, biased motility towards cargo chemoattractant
static int immune_factor_index = microenvironment.find_density_index( "immunostimulatory factor" );
// if not docked, attempt biased chemotaxis
if( pCell->state.neighbors.size() == 0 )
{
// phenotype.motility.migration_bias = 0.25;
phenotype.motility.is_motile = true;
phenotype.motility.migration_bias_direction = pCell->nearest_gradient(immune_factor_index);
normalize( &( phenotype.motility.migration_bias_direction ) );
}
else
{
phenotype.motility.is_motile = false;
}
return;
}
Cell* immune_cell_check_neighbors_for_attachment( Cell* pAttacker , double dt )
{
std::vector<Cell*> nearby = pAttacker->cells_in_my_container();
int i = 0;
while( i < nearby.size() )
{
// don't try to kill yourself
if( nearby[i] != pAttacker )
{
if( immune_cell_attempt_attachment( pAttacker, nearby[i] , dt ) )
{ return nearby[i]; }
}
i++;
}
return NULL;
}
bool immune_cell_attempt_attachment( Cell* pAttacker, Cell* pTarget , double dt )
{
static int oncoprotein_i = pTarget->custom_data.find_variable_index( "oncoprotein" );
static int attach_rate_i = pAttacker->custom_data.find_variable_index( "attachment rate" );
static double oncoprotein_saturation = 2.0;
static double oncoprotein_threshold = 0.5; // 0.1;
static double oncoprotein_difference = oncoprotein_saturation - oncoprotein_threshold;
static double max_attachment_distance = 18.0;
static double min_attachment_distance = 14.0;
static double attachment_difference = max_attachment_distance - min_attachment_distance;
if( pTarget->custom_data[oncoprotein_i] > oncoprotein_threshold && pTarget->phenotype.death.dead == false )
{
std::vector<double> displacement = pTarget->position - pAttacker->position;
double distance_scale = norm( displacement );
if( distance_scale > max_attachment_distance )
{ return false; }
double scale = pTarget->custom_data[oncoprotein_i];
scale -= oncoprotein_threshold;
scale /= oncoprotein_difference;
if( scale > 1.0 )
{ scale = 1.0; }
distance_scale *= -1.0;
distance_scale += max_attachment_distance;
distance_scale /= attachment_difference;
if( distance_scale > 1.0 )
{ distance_scale = 1.0; }
if( UniformRandom() < pAttacker->custom_data[attach_rate_i] * scale * dt * distance_scale )
{
std::cout << "\t attach!" << " " << pTarget->custom_data[oncoprotein_i] << std::endl;
attach_cells( pAttacker, pTarget );
}
return true;
}
return false;
}
bool immune_cell_attempt_apoptosis( Cell* pAttacker, Cell* pTarget, double dt )
{
static int oncoprotein_i = pTarget->custom_data.find_variable_index( "oncoprotein" );
static int apoptosis_model_index = pTarget->phenotype.death.find_death_model_index( "apoptosis" );
static int kill_rate_index = pAttacker->custom_data.find_variable_index( "kill rate" );
static double oncoprotein_saturation = 2.0;
static double oncoprotein_threshold = 0.5; // 0.1;
static double oncoprotein_difference = oncoprotein_saturation - oncoprotein_threshold;
// new
if( pTarget->custom_data[oncoprotein_i] < oncoprotein_threshold )
{ return false; }
// new
double scale = pTarget->custom_data[oncoprotein_i];
scale -= oncoprotein_threshold;
scale /= oncoprotein_difference;
if( scale > 1.0 )
{ scale = 1.0; }
// if( UniformRandom() < pAttacker->custom_data[kill_rate_index] * pTarget->custom_data[oncoprotein_i] * dt )
if( UniformRandom() < pAttacker->custom_data[kill_rate_index] * scale * dt )
{
std::cout << "\t\t kill!" << " " << pTarget->custom_data[oncoprotein_i] << std::endl;
return true;
}
return false;
}
bool immune_cell_trigger_apoptosis( Cell* pAttacker, Cell* pTarget )
{
static int apoptosis_model_index = pTarget->phenotype.death.find_death_model_index( "apoptosis" );
// if the Target cell is already dead, don't bother!
if( pTarget->phenotype.death.dead == true )
{ return false; }
pTarget->start_death( apoptosis_model_index );
return true;
}
void immune_cell_rule( Cell* pCell, Phenotype& phenotype, double dt )
{
static int attach_lifetime_i = pCell->custom_data.find_variable_index( "attachment lifetime" );
if( phenotype.death.dead == true )
{
// the cell death functions don't automatically turn off custom functions,
// since those are part of mechanics.
// Let's just fully disable now.
pCell->functions.custom_cell_rule = NULL;
return;
}
// if I'm docked
if( pCell->state.neighbors.size() > 0 )
{
extra_elastic_attachment_mechanics( pCell, phenotype, dt );
// attempt to kill my attached cell
bool dettach_me = false;
if( immune_cell_attempt_apoptosis( pCell, pCell->state.neighbors[0], dt ) )
{
immune_cell_trigger_apoptosis( pCell, pCell->state.neighbors[0] );
dettach_me = true;
}
// decide whether ot dettach
if( UniformRandom() < dt / ( pCell->custom_data[attach_lifetime_i] + 1e-15 ) )
{ dettach_me = true; }
// if I dettach, resume motile behavior
if( dettach_me )
{
dettach_cells( pCell, pCell->state.neighbors[0] );
phenotype.motility.is_motile = true;
}
return;
}
// I'm not docked, look for cells nearby and try to docked
// if this returns non-NULL, we're now attached to a cell
if( immune_cell_check_neighbors_for_attachment( pCell , dt) )
{
// set motility off
phenotype.motility.is_motile = false;
return;
}
phenotype.motility.is_motile = true;
return;
}
| [
"[email protected]"
] | |
e1d9068e09b2dec5353ecfddcc19a6be758a4afa | 901571e54db419ccd0aa4d7a3dbfcd8dd5b37207 | /BOJ/9000/9316.cpp | 27f79215e83cdab02da2cbcc6c0b9bdb0503e6a7 | [] | no_license | fbdp1202/AlgorithmParty | 3b7ae486b4a27f49d2d40efd48ed9a45a98c77e8 | 9fe654aa49392cb261e1b53c995dbb33216c6a20 | refs/heads/master | 2021-08-03T22:52:30.182103 | 2021-07-22T06:15:45 | 2021-07-22T06:15:45 | 156,948,821 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 161 | cpp | // baekjoon 9316 yechan
#include <cstdio>
int main() {
int n;
scanf("%d", &n);
for (int i=1; i<=n; i++)
printf("Hello World, Judge %d!\n", i);
return 0;
} | [
"[email protected]"
] | |
4caef122dfe29c793198abf88cb62a05e7994386 | 75f9c12b386eca99f17d4e415b48ab00663ccacb | /checkConverter/CAStreamBasicDescription.cpp | 2f7a9040c34b88905aef59780e1fa2636c99458e | [] | no_license | pebble8888/checkConverter | e5e13ac5d88fbd0c054d5e02855dde0837779ce6 | 80a08a486cef27c135831e430920b243460a3ca9 | refs/heads/master | 2020-05-22T00:36:12.338562 | 2017-03-11T14:32:58 | 2017-03-11T14:32:58 | 84,656,066 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 24,011 | cpp | /*
File: CAStreamBasicDescription.cpp
Abstract: CAStreamBasicDescription.h
Version: 1.0.3
Copyright (C) 2014 Apple Inc. All Rights Reserved.
*/
#include "CAStreamBasicDescription.h"
#include "CAMath.h"
#if !defined(__COREAUDIO_USE_FLAT_INCLUDES__)
#include <CoreFoundation/CFByteOrder.h>
#else
#include <CFByteOrder.h>
#endif
#pragma mark This file needs to compile on earlier versions of the OS, so please keep that in mind when editing it
char *CAStringForOSType (OSType t, char *writeLocation)
{
char *p = writeLocation;
unsigned char str[4] = {0}, *q = str;
*(UInt32 *)str = CFSwapInt32HostToBig(t);
bool hasNonPrint = false;
for (int i = 0; i < 4; ++i) {
if (!(isprint(*q) && *q != '\\')) {
hasNonPrint = true;
break;
}
q++;
}
q = str;
if (hasNonPrint)
p += sprintf (p, "0x");
else
*p++ = '\'';
for (int i = 0; i < 4; ++i) {
if (hasNonPrint) {
p += sprintf(p, "%02X", *q++);
} else {
*p++ = *q++;
}
}
if (!hasNonPrint)
*p++ = '\'';
*p = '\0';
return writeLocation;
}
const AudioStreamBasicDescription CAStreamBasicDescription::sEmpty = { 0.0, 0, 0, 0, 0, 0, 0, 0, 0 };
CAStreamBasicDescription::CAStreamBasicDescription()
{
memset (this, 0, sizeof(AudioStreamBasicDescription));
}
CAStreamBasicDescription::CAStreamBasicDescription(const AudioStreamBasicDescription &desc)
{
SetFrom(desc);
}
CAStreamBasicDescription::CAStreamBasicDescription(double inSampleRate, UInt32 inFormatID,
UInt32 inBytesPerPacket, UInt32 inFramesPerPacket,
UInt32 inBytesPerFrame, UInt32 inChannelsPerFrame,
UInt32 inBitsPerChannel, UInt32 inFormatFlags)
{
mSampleRate = inSampleRate;
mFormatID = inFormatID;
mBytesPerPacket = inBytesPerPacket;
mFramesPerPacket = inFramesPerPacket;
mBytesPerFrame = inBytesPerFrame;
mChannelsPerFrame = inChannelsPerFrame;
mBitsPerChannel = inBitsPerChannel;
mFormatFlags = inFormatFlags;
mReserved = 0;
}
char *CAStreamBasicDescription::AsString(char *buf, size_t _bufsize) const
{
int bufsize = (int)_bufsize; // must be signed to protect against overflow
char *theBuffer = buf;
int nc;
char formatID[24];
CAStringForOSType (mFormatID, formatID);
nc = snprintf(buf, bufsize, "%2d ch, %6.0f Hz, %s (0x%08X) ", (int)NumberChannels(), mSampleRate, formatID, (int)mFormatFlags);
buf += nc; if ((bufsize -= nc) <= 0) goto exit;
if (mFormatID == kAudioFormatLinearPCM) {
bool isInt = !(mFormatFlags & kLinearPCMFormatFlagIsFloat);
int wordSize = SampleWordSize();
const char *endian = (wordSize > 1) ?
((mFormatFlags & kLinearPCMFormatFlagIsBigEndian) ? " big-endian" : " little-endian" ) : "";
const char *sign = isInt ?
((mFormatFlags & kLinearPCMFormatFlagIsSignedInteger) ? " signed" : " unsigned") : "";
const char *floatInt = isInt ? "integer" : "float";
char packed[32];
if (wordSize > 0 && PackednessIsSignificant()) {
if (mFormatFlags & kLinearPCMFormatFlagIsPacked)
snprintf(packed, sizeof(packed), "packed in %d bytes", wordSize);
else
snprintf(packed, sizeof(packed), "unpacked in %d bytes", wordSize);
} else
packed[0] = '\0';
const char *align = (wordSize > 0 && AlignmentIsSignificant()) ?
((mFormatFlags & kLinearPCMFormatFlagIsAlignedHigh) ? " high-aligned" : " low-aligned") : "";
const char *deinter = (mFormatFlags & kAudioFormatFlagIsNonInterleaved) ? ", deinterleaved" : "";
const char *commaSpace = (packed[0]!='\0') || (align[0]!='\0') ? ", " : "";
char bitdepth[20];
int fracbits = (mFormatFlags & kLinearPCMFormatFlagsSampleFractionMask) >> kLinearPCMFormatFlagsSampleFractionShift;
if (fracbits > 0)
snprintf(bitdepth, sizeof(bitdepth), "%d.%d", (int)mBitsPerChannel - fracbits, fracbits);
else
snprintf(bitdepth, sizeof(bitdepth), "%d", (int)mBitsPerChannel);
/* nc =*/ snprintf(buf, bufsize, "%s-bit%s%s %s%s%s%s%s",
bitdepth, endian, sign, floatInt,
commaSpace, packed, align, deinter);
// buf += nc; if ((bufsize -= nc) <= 0) goto exit;
} else if (mFormatID == 'alac') { // kAudioFormatAppleLossless
int sourceBits = 0;
switch (mFormatFlags)
{
case 1: // kAppleLosslessFormatFlag_16BitSourceData
sourceBits = 16;
break;
case 2: // kAppleLosslessFormatFlag_20BitSourceData
sourceBits = 20;
break;
case 3: // kAppleLosslessFormatFlag_24BitSourceData
sourceBits = 24;
break;
case 4: // kAppleLosslessFormatFlag_32BitSourceData
sourceBits = 32;
break;
}
if (sourceBits)
nc = snprintf(buf, bufsize, "from %d-bit source, ", sourceBits);
else
nc = snprintf(buf, bufsize, "from UNKNOWN source bit depth, ");
buf += nc; if ((bufsize -= nc) <= 0) goto exit;
/* nc =*/ snprintf(buf, bufsize, "%d frames/packet", (int)mFramesPerPacket);
// buf += nc; if ((bufsize -= nc) <= 0) goto exit;
}
else
/* nc =*/ snprintf(buf, bufsize, "%d bits/channel, %d bytes/packet, %d frames/packet, %d bytes/frame",
(int)mBitsPerChannel, (int)mBytesPerPacket, (int)mFramesPerPacket, (int)mBytesPerFrame);
exit:
return theBuffer;
}
void CAStreamBasicDescription::NormalizeLinearPCMFormat(AudioStreamBasicDescription& ioDescription)
{
// the only thing that changes is to make mixable linear PCM into the canonical linear PCM format
if((ioDescription.mFormatID == kAudioFormatLinearPCM) && ((ioDescription.mFormatFlags & kIsNonMixableFlag) == 0))
{
// the canonical linear PCM format
ioDescription.mFormatFlags = kAudioFormatFlagsCanonical;
ioDescription.mBytesPerPacket = SizeOf32(AudioSampleType) * ioDescription.mChannelsPerFrame;
ioDescription.mFramesPerPacket = 1;
ioDescription.mBytesPerFrame = SizeOf32(AudioSampleType) * ioDescription.mChannelsPerFrame;
ioDescription.mBitsPerChannel = 8 * SizeOf32(AudioSampleType);
}
}
void CAStreamBasicDescription::NormalizeLinearPCMFormat(bool inNativeEndian, AudioStreamBasicDescription& ioDescription)
{
// the only thing that changes is to make mixable linear PCM into the canonical linear PCM format
if((ioDescription.mFormatID == kAudioFormatLinearPCM) && ((ioDescription.mFormatFlags & kIsNonMixableFlag) == 0))
{
// the canonical linear PCM format
ioDescription.mFormatFlags = kAudioFormatFlagIsFloat | kAudioFormatFlagIsPacked;
if(inNativeEndian)
{
#if TARGET_RT_BIG_ENDIAN
ioDescription.mFormatFlags |= kAudioFormatFlagIsBigEndian;
#endif
}
else
{
#if TARGET_RT_LITTLE_ENDIAN
ioDescription.mFormatFlags |= kAudioFormatFlagIsBigEndian;
#endif
}
ioDescription.mBytesPerPacket = SizeOf32(AudioSampleType) * ioDescription.mChannelsPerFrame;
ioDescription.mFramesPerPacket = 1;
ioDescription.mBytesPerFrame = SizeOf32(AudioSampleType) * ioDescription.mChannelsPerFrame;
ioDescription.mBitsPerChannel = 8 * SizeOf32(AudioSampleType);
}
}
void CAStreamBasicDescription::ResetFormat(AudioStreamBasicDescription& ioDescription)
{
ioDescription.mSampleRate = 0;
ioDescription.mFormatID = 0;
ioDescription.mBytesPerPacket = 0;
ioDescription.mFramesPerPacket = 0;
ioDescription.mBytesPerFrame = 0;
ioDescription.mChannelsPerFrame = 0;
ioDescription.mBitsPerChannel = 0;
ioDescription.mFormatFlags = 0;
}
void CAStreamBasicDescription::FillOutFormat(AudioStreamBasicDescription& ioDescription, const AudioStreamBasicDescription& inTemplateDescription)
{
if(fiszero(ioDescription.mSampleRate))
{
ioDescription.mSampleRate = inTemplateDescription.mSampleRate;
}
if(ioDescription.mFormatID == 0)
{
ioDescription.mFormatID = inTemplateDescription.mFormatID;
}
if(ioDescription.mFormatFlags == 0)
{
ioDescription.mFormatFlags = inTemplateDescription.mFormatFlags;
}
if(ioDescription.mBytesPerPacket == 0)
{
ioDescription.mBytesPerPacket = inTemplateDescription.mBytesPerPacket;
}
if(ioDescription.mFramesPerPacket == 0)
{
ioDescription.mFramesPerPacket = inTemplateDescription.mFramesPerPacket;
}
if(ioDescription.mBytesPerFrame == 0)
{
ioDescription.mBytesPerFrame = inTemplateDescription.mBytesPerFrame;
}
if(ioDescription.mChannelsPerFrame == 0)
{
ioDescription.mChannelsPerFrame = inTemplateDescription.mChannelsPerFrame;
}
if(ioDescription.mBitsPerChannel == 0)
{
ioDescription.mBitsPerChannel = inTemplateDescription.mBitsPerChannel;
}
}
void CAStreamBasicDescription::GetSimpleName(const AudioStreamBasicDescription& inDescription, char* outName, UInt32 inMaxNameLength, bool inAbbreviate, bool inIncludeSampleRate)
{
if(inIncludeSampleRate)
{
int theCharactersWritten = snprintf(outName, inMaxNameLength, "%.0f ", inDescription.mSampleRate);
outName += theCharactersWritten;
inMaxNameLength -= theCharactersWritten;
}
switch(inDescription.mFormatID)
{
case kAudioFormatLinearPCM:
{
const char* theEndianString = NULL;
if((inDescription.mFormatFlags & kAudioFormatFlagIsBigEndian) != 0)
{
#if TARGET_RT_LITTLE_ENDIAN
theEndianString = "Big Endian";
#endif
}
else
{
#if TARGET_RT_BIG_ENDIAN
theEndianString = "Little Endian";
#endif
}
const char* theKindString = NULL;
if((inDescription.mFormatFlags & kAudioFormatFlagIsFloat) != 0)
{
theKindString = (inAbbreviate ? "Float" : "Floating Point");
}
else if((inDescription.mFormatFlags & kAudioFormatFlagIsSignedInteger) != 0)
{
theKindString = (inAbbreviate ? "SInt" : "Signed Integer");
}
else
{
theKindString = (inAbbreviate ? "UInt" : "Unsigned Integer");
}
const char* thePackingString = NULL;
if((inDescription.mFormatFlags & kAudioFormatFlagIsPacked) == 0)
{
if((inDescription.mFormatFlags & kAudioFormatFlagIsAlignedHigh) != 0)
{
thePackingString = "High";
}
else
{
thePackingString = "Low";
}
}
const char* theMixabilityString = NULL;
if((inDescription.mFormatFlags & kIsNonMixableFlag) == 0)
{
theMixabilityString = "Mixable";
}
else
{
theMixabilityString = "Unmixable";
}
if(inAbbreviate)
{
if(theEndianString != NULL)
{
if(thePackingString != NULL)
{
snprintf(outName, inMaxNameLength, "%s %d Ch %s %s %s%d/%s%d", theMixabilityString, (int)inDescription.mChannelsPerFrame, theEndianString, thePackingString, theKindString, (int)inDescription.mBitsPerChannel, theKindString, (int)(inDescription.mBytesPerFrame / inDescription.mChannelsPerFrame) * 8);
}
else
{
snprintf(outName, inMaxNameLength, "%s %d Ch %s %s%d", theMixabilityString, (int)inDescription.mChannelsPerFrame, theEndianString, theKindString, (int)inDescription.mBitsPerChannel);
}
}
else
{
if(thePackingString != NULL)
{
snprintf(outName, inMaxNameLength, "%s %d Ch %s %s%d/%s%d", theMixabilityString, (int)inDescription.mChannelsPerFrame, thePackingString, theKindString, (int)inDescription.mBitsPerChannel, theKindString, (int)((inDescription.mBytesPerFrame / inDescription.mChannelsPerFrame) * 8));
}
else
{
snprintf(outName, inMaxNameLength, "%s %d Ch %s%d", theMixabilityString, (int)inDescription.mChannelsPerFrame, theKindString, (int)inDescription.mBitsPerChannel);
}
}
}
else
{
if(theEndianString != NULL)
{
if(thePackingString != NULL)
{
snprintf(outName, inMaxNameLength, "%s %d Channel %d Bit %s %s Aligned %s in %d Bits", theMixabilityString, (int)inDescription.mChannelsPerFrame, (int)inDescription.mBitsPerChannel, theEndianString, theKindString, thePackingString, (int)(inDescription.mBytesPerFrame / inDescription.mChannelsPerFrame) * 8);
}
else
{
snprintf(outName, inMaxNameLength, "%s %d Channel %d Bit %s %s", theMixabilityString, (int)inDescription.mChannelsPerFrame, (int)inDescription.mBitsPerChannel, theEndianString, theKindString);
}
}
else
{
if(thePackingString != NULL)
{
snprintf(outName, inMaxNameLength, "%s %d Channel %d Bit %s Aligned %s in %d Bits", theMixabilityString, (int)inDescription.mChannelsPerFrame, (int)inDescription.mBitsPerChannel, theKindString, thePackingString, (int)(inDescription.mBytesPerFrame / inDescription.mChannelsPerFrame) * 8);
}
else
{
snprintf(outName, inMaxNameLength, "%s %d Channel %d Bit %s", theMixabilityString, (int)inDescription.mChannelsPerFrame, (int)inDescription.mBitsPerChannel, theKindString);
}
}
}
}
break;
case kAudioFormatAC3:
strlcpy(outName, "AC-3", sizeof(outName));
break;
case kAudioFormat60958AC3:
strlcpy(outName, "AC-3 for SPDIF", sizeof(outName));
break;
default:
CACopy4CCToCString(outName, inDescription.mFormatID);
break;
};
}
#if CoreAudio_Debug
#include "CALogMacros.h"
void CAStreamBasicDescription::PrintToLog(const AudioStreamBasicDescription& inDesc)
{
PrintFloat (" Sample Rate: ", inDesc.mSampleRate);
Print4CharCode (" Format ID: ", inDesc.mFormatID);
PrintHex (" Format Flags: ", inDesc.mFormatFlags);
PrintInt (" Bytes per Packet: ", inDesc.mBytesPerPacket);
PrintInt (" Frames per Packet: ", inDesc.mFramesPerPacket);
PrintInt (" Bytes per Frame: ", inDesc.mBytesPerFrame);
PrintInt (" Channels per Frame: ", inDesc.mChannelsPerFrame);
PrintInt (" Bits per Channel: ", inDesc.mBitsPerChannel);
}
#endif
bool operator<(const AudioStreamBasicDescription& x, const AudioStreamBasicDescription& y)
{
bool theAnswer = false;
bool isDone = false;
// note that if either side is 0, that field is skipped
// format ID is the first order sort
if((!isDone) && ((x.mFormatID != 0) && (y.mFormatID != 0)))
{
if(x.mFormatID != y.mFormatID)
{
// formats are sorted numerically except that linear
// PCM is always first
if(x.mFormatID == kAudioFormatLinearPCM)
{
theAnswer = true;
}
else if(y.mFormatID == kAudioFormatLinearPCM)
{
theAnswer = false;
}
else
{
theAnswer = x.mFormatID < y.mFormatID;
}
isDone = true;
}
}
// mixable is always better than non-mixable for linear PCM and should be the second order sort item
if((!isDone) && ((x.mFormatID == kAudioFormatLinearPCM) && (y.mFormatID == kAudioFormatLinearPCM)))
{
if(((x.mFormatFlags & kIsNonMixableFlag) == 0) && ((y.mFormatFlags & kIsNonMixableFlag) != 0))
{
theAnswer = true;
isDone = true;
}
else if(((x.mFormatFlags & kIsNonMixableFlag) != 0) && ((y.mFormatFlags & kIsNonMixableFlag) == 0))
{
theAnswer = false;
isDone = true;
}
}
// floating point vs integer for linear PCM only
if((!isDone) && ((x.mFormatID == kAudioFormatLinearPCM) && (y.mFormatID == kAudioFormatLinearPCM)))
{
if((x.mFormatFlags & kAudioFormatFlagIsFloat) != (y.mFormatFlags & kAudioFormatFlagIsFloat))
{
// floating point is better than integer
theAnswer = y.mFormatFlags & kAudioFormatFlagIsFloat;
isDone = true;
}
}
// bit depth
if((!isDone) && ((x.mBitsPerChannel != 0) && (y.mBitsPerChannel != 0)))
{
if(x.mBitsPerChannel != y.mBitsPerChannel)
{
// deeper bit depths are higher quality
theAnswer = x.mBitsPerChannel < y.mBitsPerChannel;
isDone = true;
}
}
// sample rate
if((!isDone) && fnonzero(x.mSampleRate) && fnonzero(y.mSampleRate))
{
if(fnotequal(x.mSampleRate, y.mSampleRate))
{
// higher sample rates are higher quality
theAnswer = x.mSampleRate < y.mSampleRate;
isDone = true;
}
}
// number of channels
if((!isDone) && ((x.mChannelsPerFrame != 0) && (y.mChannelsPerFrame != 0)))
{
if(x.mChannelsPerFrame != y.mChannelsPerFrame)
{
// more channels is higher quality
theAnswer = x.mChannelsPerFrame < y.mChannelsPerFrame;
//isDone = true;
}
}
return theAnswer;
}
static bool MatchFormatFlags(const AudioStreamBasicDescription& x, const AudioStreamBasicDescription& y)
{
UInt32 xFlags = x.mFormatFlags;
UInt32 yFlags = y.mFormatFlags;
// match wildcards
if (x.mFormatID == 0 || y.mFormatID == 0 || xFlags == 0 || yFlags == 0)
return true;
if (x.mFormatID == kAudioFormatLinearPCM)
{
// knock off the all clear flag
xFlags = xFlags & ~kAudioFormatFlagsAreAllClear;
yFlags = yFlags & ~kAudioFormatFlagsAreAllClear;
// if both kAudioFormatFlagIsPacked bits are set, then we don't care about the kAudioFormatFlagIsAlignedHigh bit.
if (xFlags & yFlags & kAudioFormatFlagIsPacked) {
xFlags = xFlags & ~kAudioFormatFlagIsAlignedHigh;
yFlags = yFlags & ~kAudioFormatFlagIsAlignedHigh;
}
// if both kAudioFormatFlagIsFloat bits are set, then we don't care about the kAudioFormatFlagIsSignedInteger bit.
if (xFlags & yFlags & kAudioFormatFlagIsFloat) {
xFlags = xFlags & ~kAudioFormatFlagIsSignedInteger;
yFlags = yFlags & ~kAudioFormatFlagIsSignedInteger;
}
// if the bit depth is 8 bits or less and the format is packed, we don't care about endianness
if((x.mBitsPerChannel <= 8) && ((xFlags & kAudioFormatFlagIsPacked) == kAudioFormatFlagIsPacked))
{
xFlags = xFlags & ~kAudioFormatFlagIsBigEndian;
}
if((y.mBitsPerChannel <= 8) && ((yFlags & kAudioFormatFlagIsPacked) == kAudioFormatFlagIsPacked))
{
yFlags = yFlags & ~kAudioFormatFlagIsBigEndian;
}
// if the number of channels is 1, we don't care about non-interleavedness
if (x.mChannelsPerFrame == 1 && y.mChannelsPerFrame == 1) {
xFlags &= ~kLinearPCMFormatFlagIsNonInterleaved;
yFlags &= ~kLinearPCMFormatFlagIsNonInterleaved;
}
}
return xFlags == yFlags;
}
bool operator==(const AudioStreamBasicDescription& x, const AudioStreamBasicDescription& y)
{
// the semantics for equality are:
// 1) Values must match exactly -- except for PCM format flags, see above.
// 2) wildcard's are ignored in the comparison
#define MATCH(name) ((x.name) == 0 || (y.name) == 0 || (x.name) == (y.name))
return
// check the sample rate
(fiszero(x.mSampleRate) || fiszero(y.mSampleRate) || fequal(x.mSampleRate, y.mSampleRate))
// check the format ids
&& MATCH(mFormatID)
// check the format flags
&& MatchFormatFlags(x, y)
// check the bytes per packet
&& MATCH(mBytesPerPacket)
// check the frames per packet
&& MATCH(mFramesPerPacket)
// check the bytes per frame
&& MATCH(mBytesPerFrame)
// check the channels per frame
&& MATCH(mChannelsPerFrame)
// check the channels per frame
&& MATCH(mBitsPerChannel) ;
}
bool CAStreamBasicDescription::IsEqual(const AudioStreamBasicDescription &other, bool interpretingWildcards) const
{
if (interpretingWildcards)
return *this == other;
return memcmp(this, &other, offsetof(AudioStreamBasicDescription, mReserved)) == 0;
}
bool SanityCheck(const AudioStreamBasicDescription& x)
{
// This function returns false if there are sufficiently insane values in any field.
// It is very conservative so even some very unlikely values will pass.
// This is just meant to catch the case where the data from a file is corrupted.
return
(x.mSampleRate >= 0.)
&& (x.mSampleRate < 3e6) // SACD sample rate is 2.8224 MHz
&& (x.mBytesPerPacket < 1000000)
&& (x.mFramesPerPacket < 1000000)
&& (x.mBytesPerFrame < 1000000)
&& (x.mChannelsPerFrame <= 1024)
&& (x.mBitsPerChannel <= 1024)
&& (x.mFormatID != 0)
&& !(x.mFormatID == kAudioFormatLinearPCM && (x.mFramesPerPacket != 1 || x.mBytesPerPacket != x.mBytesPerFrame));
}
bool CAStreamBasicDescription::FromText(const char *inTextDesc, AudioStreamBasicDescription &fmt)
{
const char *p = inTextDesc;
memset(&fmt, 0, sizeof(fmt));
bool isPCM = true; // until proven otherwise
UInt32 pcmFlags = kAudioFormatFlagIsPacked | kAudioFormatFlagIsSignedInteger;
if (p[0] == '-') // previously we required a leading dash on PCM formats
++p;
if (p[0] == 'B' && p[1] == 'E') {
pcmFlags |= kLinearPCMFormatFlagIsBigEndian;
p += 2;
} else if (p[0] == 'L' && p[1] == 'E') {
p += 2;
} else {
// default is native-endian
#if TARGET_RT_BIG_ENDIAN
pcmFlags |= kLinearPCMFormatFlagIsBigEndian;
#endif
}
if (p[0] == 'F') {
pcmFlags = (pcmFlags & ~kAudioFormatFlagIsSignedInteger) | kAudioFormatFlagIsFloat;
++p;
} else {
if (p[0] == 'U') {
pcmFlags &= ~kAudioFormatFlagIsSignedInteger;
++p;
}
if (p[0] == 'I')
++p;
else {
// it's not PCM; presumably some other format (NOT VALIDATED; use AudioFormat for that)
isPCM = false;
p = inTextDesc; // go back to the beginning
char buf[4] = { ' ',' ',' ',' ' };
for (int i = 0; i < 4; ++i) {
if (*p != '\\') {
if ((buf[i] = *p++) == '\0') {
// special-case for 'aac'
if (i != 3) return false;
--p; // keep pointing at the terminating null
buf[i] = ' ';
break;
}
} else {
// "\xNN" is a hex byte
if (*++p != 'x') return false;
int x;
if (sscanf(++p, "%02X", &x) != 1) return false;
buf[i] = x;
p += 2;
}
}
if (strchr("-@/#", buf[3])) {
// further special-casing for 'aac'
buf[3] = ' ';
--p;
}
fmt.mFormatID = CFSwapInt32BigToHost(*(UInt32 *)buf);
}
}
if (isPCM) {
fmt.mFormatID = kAudioFormatLinearPCM;
fmt.mFormatFlags = pcmFlags;
fmt.mFramesPerPacket = 1;
fmt.mChannelsPerFrame = 1;
int bitdepth = 0, fracbits = 0;
while (isdigit(*p))
bitdepth = 10 * bitdepth + *p++ - '0';
if (*p == '.') {
++p;
if (!isdigit(*p)) {
fprintf(stderr, "Expected fractional bits following '.'\n");
goto Bail;
}
while (isdigit(*p))
fracbits = 10 * fracbits + *p++ - '0';
bitdepth += fracbits;
fmt.mFormatFlags |= (fracbits << kLinearPCMFormatFlagsSampleFractionShift);
}
fmt.mBitsPerChannel = bitdepth;
fmt.mBytesPerPacket = fmt.mBytesPerFrame = (bitdepth + 7) / 8;
if (bitdepth & 7) {
// assume unpacked. (packed odd bit depths are describable but not supported in AudioConverter.)
fmt.mFormatFlags &= ~kLinearPCMFormatFlagIsPacked;
// alignment matters; default to high-aligned. use ':L_' for low.
fmt.mFormatFlags |= kLinearPCMFormatFlagIsAlignedHigh;
}
}
if (*p == '@') {
++p;
while (isdigit(*p))
fmt.mSampleRate = 10 * fmt.mSampleRate + (*p++ - '0');
}
if (*p == '/') {
UInt32 flags = 0;
while (true) {
char c = *++p;
if (c >= '0' && c <= '9')
flags = (flags << 4) | (c - '0');
else if (c >= 'A' && c <= 'F')
flags = (flags << 4) | (c - 'A' + 10);
else if (c >= 'a' && c <= 'f')
flags = (flags << 4) | (c - 'a' + 10);
else break;
}
fmt.mFormatFlags = flags;
}
if (*p == '#') {
++p;
while (isdigit(*p))
fmt.mFramesPerPacket = 10 * fmt.mFramesPerPacket + (*p++ - '0');
}
if (*p == ':') {
++p;
fmt.mFormatFlags &= ~kLinearPCMFormatFlagIsPacked;
if (*p == 'L')
fmt.mFormatFlags &= ~kLinearPCMFormatFlagIsAlignedHigh;
else if (*p == 'H')
fmt.mFormatFlags |= kLinearPCMFormatFlagIsAlignedHigh;
else
goto Bail;
++p;
int bytesPerFrame = 0;
while (isdigit(*p))
bytesPerFrame = 10 * bytesPerFrame + (*p++ - '0');
fmt.mBytesPerFrame = fmt.mBytesPerPacket = bytesPerFrame;
}
if (*p == ',') {
++p;
int ch = 0;
while (isdigit(*p))
ch = 10 * ch + (*p++ - '0');
fmt.mChannelsPerFrame = ch;
if (*p == 'D') {
++p;
if (fmt.mFormatID != kAudioFormatLinearPCM) {
fprintf(stderr, "non-interleaved flag invalid for non-PCM formats\n");
goto Bail;
}
fmt.mFormatFlags |= kAudioFormatFlagIsNonInterleaved;
} else {
if (*p == 'I') ++p; // default
if (fmt.mFormatID == kAudioFormatLinearPCM)
fmt.mBytesPerPacket = fmt.mBytesPerFrame *= ch;
}
}
if (*p != '\0') {
fprintf(stderr, "extra characters at end of format string: %s\n", p);
goto Bail;
}
return true;
Bail:
fprintf(stderr, "Invalid format string: %s\n", inTextDesc);
fprintf(stderr, "Syntax of format strings is: \n");
return false;
}
const char *CAStreamBasicDescription::sTextParsingUsageString =
"format[@sample_rate_hz][/format_flags][#frames_per_packet][:LHbytesPerFrame][,channelsDI].\n"
"Format for PCM is [-][BE|LE]{F|I|UI}{bitdepth}; else a 4-char format code (e.g. aac, alac).\n";
| [
"[email protected]"
] | |
b6b62f73cd9106f2c476d3e72e3f98bb7a4acfc9 | e1d6417b995823e507a1e53ff81504e4bc795c8f | /gbk/server/Server/Server/Packets/WGChannelErrorHandler.cpp | 7b8e4ec8dfd6d68f5e40a322619c4dd8b5b2b78b | [] | no_license | cjmxp/pap_full | f05d9e3f9390c2820a1e51d9ad4b38fe044e05a6 | 1963a8a7bda5156a772ccb3c3e35219a644a1566 | refs/heads/master | 2020-12-02T22:50:41.786682 | 2013-11-15T08:02:30 | 2013-11-15T08:02:30 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,546 | cpp |
#include "stdafx.h"
#include "WGChannelError.h"
#include "Log.h"
#include "ServerManager.h"
#include "GamePlayer.h"
#include "PlayerPool.h"
#include "Scene.h"
#include "Obj_Human.h"
#include "SceneManager.h"
#include "GCChannelError.h"
uint WGChannelErrorHandler::Execute( WGChannelError* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION
PlayerID_t PlayerID = pPacket->GetPlayerID() ;
GamePlayer* pGamePlayer = g_pPlayerPool->GetPlayer(PlayerID) ;
if( pGamePlayer==NULL )
{
Assert(FALSE) ;
return PACKET_EXE_CONTINUE ;
}
Obj_Human* pHuman = pGamePlayer->GetHuman() ;
Assert( pHuman ) ;
Scene* pScene = pHuman->getScene() ;
if( pScene==NULL ) return PACKET_EXE_CONTINUE ;
if( pPlayer->IsServerPlayer() )
{//服务器收到世界服务器发来的数据
Assert( MyGetCurrentThreadID()==g_pServerManager->m_ThreadID ) ;
pScene->SendPacket( pPacket, PlayerID ) ;
g_pLog->FastSaveLog( LOG_FILE_1, "WGChannelErrorHandler: ServerPlayer (ErrorCode=%d) ",
pPacket->GetErrorCode() ) ;
return PACKET_EXE_NOTREMOVE ;
}
else if( pPlayer->IsGamePlayer() )
{//场景收到Cache里的消息
Assert( MyGetCurrentThreadID()==pScene->m_ThreadID ) ;
GCChannelError Msg ;
Msg.SetErrorCode( pPacket->GetErrorCode() ) ;
pGamePlayer->SendPacket( &Msg ) ;
g_pLog->FastSaveLog( LOG_FILE_1, "WGChannelErrorHandler: GamePlayer (GUID=%X ErrorCode=%d) ",
pGamePlayer->m_HumanGUID, pPacket->GetErrorCode() ) ;
}
else
{
Assert(FALSE) ;
}
return PACKET_EXE_CONTINUE ;
__LEAVE_FUNCTION
return PACKET_EXE_ERROR ;
}
| [
"[email protected]"
] | |
f9022104e06ea4e122684dbb048896f5c3f527e6 | cbed802efec5d700794f170b2a83684bf05813fb | /src/v8/src/extensions/gc-extension.cc | 08384deeedd5b700cb679b582721b33f39edcaf5 | [
"BSD-3-Clause",
"bzip2-1.0.6"
] | permissive | oddish314/Aviator | 4affc878c9061ca14ac08a226c0f3b181f2bc91c | 91c4d4b6343166d702413b1403d325e4935839e5 | refs/heads/master | 2021-01-22T09:50:36.731707 | 2015-02-09T11:34:05 | 2015-02-09T11:34:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 800 | cc | // Copyright 2010 the V8 project 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 "src/extensions/gc-extension.h"
#include "src/platform.h"
namespace v8 {
namespace internal {
v8::Handle<v8::FunctionTemplate> GCExtension::GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> str) {
return v8::FunctionTemplate::New(isolate, GCExtension::GC);
}
void GCExtension::GC(const v8::FunctionCallbackInfo<v8::Value>& args) {
args.GetIsolate()->RequestGarbageCollectionForTesting(
args[0]->BooleanValue() ? v8::Isolate::kMinorGarbageCollection
: v8::Isolate::kFullGarbageCollection);
}
} } // namespace v8::internal
| [
"[email protected]"
] | |
ab094142c034ba5ba0eefa324083c0ec806332f2 | d93159d0784fc489a5066d3ee592e6c9563b228b | /Geometry/CaloTopology/src/EcalEndcapTopology.cc | c83f962eff23b3deff222035561054bcfd3810fd | [] | permissive | simonecid/cmssw | 86396e31d41a003a179690f8c322e82e250e33b2 | 2559fdc9545b2c7e337f5113b231025106dd22ab | refs/heads/CAallInOne_81X | 2021-08-15T23:25:02.901905 | 2016-09-13T08:10:20 | 2016-09-13T08:53:42 | 176,462,898 | 0 | 1 | Apache-2.0 | 2019-03-19T08:30:28 | 2019-03-19T08:30:24 | null | UTF-8 | C++ | false | false | 2,103 | cc | #include "Geometry/CaloTopology/interface/EcalEndcapTopology.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
EEDetId EcalEndcapTopology::incrementIy(const EEDetId& id) const {
if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
{
return EEDetId(0);
}
EEDetId nextPoint;
if (EEDetId::validDetId(id.ix(),id.iy()+1,id.zside()))
nextPoint=EEDetId(id.ix(),id.iy()+1,id.zside());
else
return EEDetId(0);
if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
return nextPoint;
else
return EEDetId(0);
}
EEDetId EcalEndcapTopology::decrementIy(const EEDetId& id) const {
if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
{
return EEDetId(0);
}
EEDetId nextPoint;
if (EEDetId::validDetId(id.ix(),id.iy()-1,id.zside()))
nextPoint=EEDetId(id.ix(),id.iy()-1,id.zside());
else
return EEDetId(0);
if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
return nextPoint;
else
return EEDetId(0);
}
EEDetId EcalEndcapTopology::incrementIx(const EEDetId& id) const {
if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
{
return EEDetId(0);
}
EEDetId nextPoint;
if (EEDetId::validDetId(id.ix()+1,id.iy(),id.zside()))
nextPoint=EEDetId(id.ix()+1,id.iy(),id.zside());
else
return EEDetId(0);
if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
return nextPoint;
else
return EEDetId(0);
}
EEDetId EcalEndcapTopology::decrementIx(const EEDetId& id) const {
if (!(*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(id))
{
return EEDetId(0);
}
EEDetId nextPoint;
if (EEDetId::validDetId(id.ix()-1,id.iy(),id.zside()))
nextPoint=EEDetId(id.ix()-1,id.iy(),id.zside());
else
return EEDetId(0);
if ((*theGeom_).getSubdetectorGeometry(DetId::Ecal,EcalEndcap)->present(nextPoint))
return nextPoint;
else
return EEDetId(0);
}
| [
"[email protected]"
] | |
76b9bb0c8f071dd398d60e7f26d8b1d7e89a4e59 | 87d8af054e17e0c346b6f59636402883fbf0158d | /Cpp/SDK/BP_FrontendGameMode_classes.h | 82b016557ab8bc3c8380abc0e1d26c82e49d412f | [] | no_license | AthenaVision/SoT-SDK-2 | 53676d349bca171b5e48dc812fd7bb97b9a4f1d8 | 4a803206d707a081b86c89a4b866a1761119613d | refs/heads/main | 2023-03-20T10:48:21.491008 | 2021-03-10T21:55:10 | 2021-03-10T21:55:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 981 | h | #pragma once
// Name: sot, Version: 4.2
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass BP_FrontendGameMode.BP_FrontendGameMode_C
// 0x0008 (FullSize[0x0538] - InheritedSize[0x0530])
class ABP_FrontendGameMode_C : public AFrontendGameMode
{
public:
class USceneComponent* DefaultSceneRoot; // 0x0530(0x0008) (BlueprintVisible, ZeroConstructor, IsPlainOldData, NonTransactional, NoDestructor)
static UClass* StaticClass()
{
static auto ptr = UObject::FindClass("BlueprintGeneratedClass BP_FrontendGameMode.BP_FrontendGameMode_C");
return ptr;
}
void UserConstructionScript();
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"[email protected]"
] | |
da3337553233c1cf0d5b95132d630b6f59adb190 | 2325e067dce9383f1788f3de95ba307dc68dcef0 | /Code Jam/2019 Qualification/prob3.cpp | f609bd388cb9047742e86e895ebf457d16c305e5 | [
"MIT"
] | permissive | ishaanjav/Google-Kick-Start-And-Code-Jam-Solutions | c7766ddb4a7cfa6bdd107ca6866605ed7fee002e | 6658c2d8ac2a067b138329c2d78c1ed2064f128f | refs/heads/main | 2023-04-26T13:58:30.636168 | 2021-05-02T00:39:50 | 2021-05-02T00:39:50 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,949 | cpp | /*
* Created by ishaanjav
* github.com/ishaanjav
* Solutions: https://github.com/ishaanjav/Google-Kick-Start-And-Code-Jam-Solutions
*/
#include <iostream>
using namespace std;
#define ll long long
#define pb push_back
#define ins insert
#define mp make_pair
#define pii pair<int, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define pib pair<int, bool>
#define SET(a, c) memset(a, c, sizeof(a))
#define MOD 1000000007
#define Endl "\n"
#define endl "\n"
#define fi first
#define se second
#define rs resize
#define len(a) (sizeof(a)/sizeof(a[0])
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define FOUND(u, val) u.find(val) != u.end()
#define max_self(a, b) a = max(a, b);
#define min_self(a, b) a = min(a, b);
#define deb cout << "ASDFASDF\n"
#define read(ar) \
for (auto& x : ar) cin >> x;
#define each(ar) for (auto i : ar)
#define eachv(ar, i) for (auto i : ar)
#include <string>
#include <vector>
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vl;
typedef vector<bool> vb;
//#include <algorithm>
#include <set>
//#include <map>
//#include <unordered_set>
//#include <unordered_map>
//#include <cmath>
#include <cstring>
//#include <sstream>
//#include <stack>
//#include <queue>
bool prime[100001];
vi primes;
void sieve(int n = 10000) {
memset(prime, true, sizeof(prime));
for (int p = 2; p * p <= n; p++)
if (prime[p])
for (int i = p * p; i <= n; i += p) prime[i] = false;
primes.pb(2);
for (int p = 3; p <= 10000; p += 2)
if (prime[p]) primes.pb(p);
prime[0] = prime[1] = false;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
sieve();
for (int tr = 0; tr < t; tr++) {
int n, m;
cin >> m >> n;
ll ar[n];
read(ar);
set<ll> list;
for (int i = 0; i < n; i++) {
ll val = ar[i];
for (int p : primes) {
if (p * 2 > val) break;
if (val % p == 0) list.ins(p);
}
}
vl v;
for (auto p : list) v.pb(p);
string ans = "";
ll p1 = -1, p2 = -1;
int x1 = -1, x2 = -1;
int cnt = 0;
for (auto p : v) {
if (ar[0] % p == 0) {
if (p1 == -1)
p1 = p, x1 = cnt;
else
p2 = p, x2 = cnt;
}
cnt++;
}
for (int i = 1; i < n; i++) {
ll a = -1, b = -1;
int c = -1, d = -1;
cnt = 0;
for (auto p : v) {
if (ar[i] % p == 0) {
if (a == -1)
a = p, c = cnt;
else
b = p, d = cnt;
}
cnt++;
}
if (i == 1) {
if (p1 == a || p1 == b) {
// p2 is the first one
char c = (char)('A' + x2);
ans += (c);
} else {
char c = (char)('A' + x1);
ans += (c);
}
}
if (p1 == a || p1 == b) {
// p2 is the first one
char c = (char)('A' + x1);
ans += (c);
} else {
char c = (char)('A' + x2);
ans += (c);
}
if (i == n - 1) {
if (p1 == a || p2 == a) {
// p2 is the first one
char c = (char)('A' + d);
ans += (c);
} else {
char c = (char)('A' + c);
ans += (c);
}
}
p1 = a, p2 = b;
x1 = c, x2 = d;
}
char c = (char)('A' + 3);
// cout << c << endl;
cout << "Case #" << tr + 1 << ": " << ans << endl;
}
}
| [
"[email protected]"
] | |
ddea38d1f183cbfc60e1466e4b514271f3a4de27 | 12a801d22f2a89481b2f4c5f38f0b17a53314e51 | /common/request.h | 4ebd420f42c56ab769aed0e84572d229a7a6d3cb | [] | no_license | traumgedanken/turing-visual | abf52a7ea243a465921dcb3a83cffcea935f4aef | 843678aad089d25779e3ed2208526af83e75ecb2 | refs/heads/master | 2020-05-02T09:36:06.289291 | 2018-06-11T06:25:01 | 2018-06-11T06:25:01 | 177,875,992 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,654 | h | #pragma once
#include "common_global.h"
#include "turiprogram.h"
enum FunctionName {
/* usually used to check connection */
FN_NONE,
/* parse program from code field in request */
FN_PARSE_PROGRAM,
/* create new carriage and save it on the server
input word - code filed in request
input program - program field in request
return id of carriage to use it */
FN_CARRIAGE_CREATE,
/* return true if possible to make one more prev
return special status if it is not possible
return information about new carriage view */
FN_CARRIAGE_PREV,
/* return true if possible to make one more next
return special status if it is not possible
return information about new carriage view */
FN_CARRIAGE_NEXT,
/* move carriage view to left
return information about new carriage view*/
FN_CARRIAGE_LEFT,
/* move carriage view to right
return information about new carriage view */
FN_CARRIAGE_RIGHT,
/* return current word on carriage without whitespaces */
FN_CARRIAGE_WORD,
/* run all program to the end
return information about new carriage view */
FN_CARRIAGE_RUN,
/* free memory of created carriage */
FN_CARRIAGE_DELETE
};
class COMMONSHARED_EXPORT Request {
public:
FunctionName functionName = FN_NONE;
QString code = "";
TuriProgram * program = nullptr;
int id = -1;
Request() {}
Request(FunctionName _functionName, int _id = -1, QString _code = "",
TuriProgram * _program = nullptr);
QString serialize();
static Request deserialize(QString _source);
};
| [
"[email protected]"
] | |
770841cd69f908a1d53946657a342ba912fdb526 | f45599da2e919e306a7a545d2678a2bd47dc5dac | /src/darksend.h | 8d7ab337cdd625d82357afe6f259d40d2005281b | [
"MIT"
] | permissive | Ethernodes-org/eunowallet | 3cc92669eb0f6a2460a97bb97f30ab8f064ef2ba | 90bdcccda9eb0eee66e8b7f7d5c637afe27efaf3 | refs/heads/master | 2022-03-09T02:27:39.073059 | 2019-09-04T20:08:52 | 2019-09-04T20:08:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,492 | h | // Copyright (c) 2014-2015 The Darkcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef DARKSEND_H
#define DARKSEND_H
//#include "primitives/transaction.h"
#include "main.h"
#include "masternode.h"
#include "activemasternode.h"
class CTxIn;
class CDarkSendPool;
class CDarkSendSigner;
class CMasterNodeVote;
class CBitcoinAddress;
class CDarksendQueue;
class CDarksendBroadcastTx;
class CActiveMasternode;
#define POOL_MAX_TRANSACTIONS 3 // wait for X transactions to merge and publish
#define POOL_STATUS_UNKNOWN 0 // waiting for update
#define POOL_STATUS_IDLE 1 // waiting for update
#define POOL_STATUS_QUEUE 2 // waiting in a queue
#define POOL_STATUS_ACCEPTING_ENTRIES 3 // accepting entries
#define POOL_STATUS_FINALIZE_TRANSACTION 4 // master node will broadcast what it accepted
#define POOL_STATUS_SIGNING 5 // check inputs/outputs, sign final tx
#define POOL_STATUS_TRANSMISSION 6 // transmit transaction
#define POOL_STATUS_ERROR 7 // error
#define POOL_STATUS_SUCCESS 8 // success
// status update message constants
#define MASTERNODE_ACCEPTED 1
#define MASTERNODE_REJECTED 0
#define MASTERNODE_RESET -1
#define DARKSEND_QUEUE_TIMEOUT 120
#define DARKSEND_SIGNING_TIMEOUT 30
extern CDarkSendPool darkSendPool;
extern CDarkSendSigner darkSendSigner;
extern std::vector<CDarksendQueue> vecDarksendQueue;
extern std::string strMasterNodePrivKey;
extern map<uint256, CDarksendBroadcastTx> mapDarksendBroadcastTxes;
extern CActiveMasternode activeMasternode;
//specific messages for the Darksend protocol
void ProcessMessageDarksend(CNode* pfrom, std::string& strCommand, CDataStream& vRecv);
// get the darksend chain depth for a given input
int GetInputDarksendRounds(CTxIn in, int rounds=0);
// An input in the darksend pool
class CDarkSendEntryVin
{
public:
bool isSigSet;
CTxIn vin;
CDarkSendEntryVin()
{
isSigSet = false;
vin = CTxIn();
}
};
// A clients transaction in the darksend pool
class CDarkSendEntry
{
public:
bool isSet;
std::vector<CDarkSendEntryVin> sev;
int64_t amount;
CTransaction collateral;
std::vector<CTxOut> vout;
CTransaction txSupporting;
int64_t addedTime;
CDarkSendEntry()
{
isSet = false;
collateral = CTransaction();
amount = 0;
}
bool Add(const std::vector<CTxIn> vinIn, int64_t amountIn, const CTransaction collateralIn, const std::vector<CTxOut> voutIn)
{
if(isSet){return false;}
BOOST_FOREACH(const CTxIn v, vinIn) {
CDarkSendEntryVin s = CDarkSendEntryVin();
s.vin = v;
sev.push_back(s);
}
vout = voutIn;
amount = amountIn;
collateral = collateralIn;
isSet = true;
addedTime = GetTime();
return true;
}
bool AddSig(const CTxIn& vin)
{
BOOST_FOREACH(CDarkSendEntryVin& s, sev) {
if(s.vin.prevout == vin.prevout && s.vin.nSequence == vin.nSequence){
if(s.isSigSet){return false;}
s.vin.scriptSig = vin.scriptSig;
s.vin.prevPubKey = vin.prevPubKey;
s.isSigSet = true;
return true;
}
}
return false;
}
bool IsExpired()
{
return (GetTime() - addedTime) > DARKSEND_QUEUE_TIMEOUT;// 120 seconds
}
};
//
// A currently inprogress darksend merge and denomination information
//
class CDarksendQueue
{
public:
CTxIn vin;
int64_t time;
int nDenom;
bool ready; //ready for submit
std::vector<unsigned char> vchSig;
CDarksendQueue()
{
nDenom = 0;
vin = CTxIn();
time = 0;
vchSig.clear();
ready = false;
}
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion){
unsigned int nSerSize = 0;
READWRITE(nDenom);
READWRITE(vin);
READWRITE(time);
READWRITE(ready);
READWRITE(vchSig);
}
bool GetAddress(CService &addr)
{
BOOST_FOREACH(CMasterNode mn, vecMasternodes) {
if(mn.vin == vin){
addr = mn.addr;
return true;
}
}
return false;
}
bool GetProtocolVersion(int &protocolVersion)
{
BOOST_FOREACH(CMasterNode mn, vecMasternodes) {
if(mn.vin == vin){
protocolVersion = mn.protocolVersion;
return true;
}
}
return false;
}
bool Sign();
bool Relay();
bool IsExpired()
{
return (GetTime() - time) > DARKSEND_QUEUE_TIMEOUT;// 120 seconds
}
bool CheckSignature();
};
// store darksend tx signature information
class CDarksendBroadcastTx
{
public:
CTransaction tx;
CTxIn vin;
vector<unsigned char> vchSig;
int64_t sigTime;
};
//
// Helper object for signing and checking signatures
//
class CDarkSendSigner
{
public:
bool IsVinAssociatedWithPubkey(CTxIn& vin, CPubKey& pubkey);
bool SetKey(std::string strSecret, std::string& errorMessage, CKey& key, CPubKey& pubkey);
bool SignMessage(std::string strMessage, std::string& errorMessage, std::vector<unsigned char>& vchSig, CKey key);
bool VerifyMessage(CPubKey pubkey, std::vector<unsigned char>& vchSig, std::string strMessage, std::string& errorMessage);
};
class CDarksendSession
{
};
//
// Used to keep track of current status of darksend pool
//
class CDarkSendPool
{
public:
static const int MIN_PEER_PROTO_VERSION = 60020;
// clients entries
std::vector<CDarkSendEntry> myEntries;
// masternode entries
std::vector<CDarkSendEntry> entries;
// the finalized transaction ready for signing
CTransaction finalTransaction;
int64_t lastTimeChanged;
int64_t lastAutoDenomination;
unsigned int state;
unsigned int entriesCount;
unsigned int lastEntryAccepted;
unsigned int countEntriesAccepted;
// where collateral should be made out to
CScript collateralPubKey;
std::vector<CTxIn> lockedCoins;
uint256 masterNodeBlockHash;
std::string lastMessage;
bool completedTransaction;
bool unitTest;
CService submittedToMasternode;
int sessionID;
int sessionDenom; //Users must submit an denom matching this
int sessionUsers; //N Users have said they'll join
bool sessionFoundMasternode; //If we've found a compatible masternode
int64_t sessionTotalValue; //used for autoDenom
std::vector<CTransaction> vecSessionCollateral;
int cachedLastSuccess;
int cachedNumBlocks; //used for the overview screen
int minBlockSpacing; //required blocks between mixes
CTransaction txCollateral;
int64_t lastNewBlock;
//debugging data
std::string strAutoDenomResult;
//incremented whenever a DSQ comes through
int64_t nDsqCount;
CDarkSendPool()
{
/* DarkSend uses collateral addresses to trust parties entering the pool
to behave themselves. If they don't it takes their money. */
cachedLastSuccess = 0;
cachedNumBlocks = 0;
unitTest = false;
txCollateral = CTransaction();
minBlockSpacing = 1;
nDsqCount = 0;
lastNewBlock = 0;
SetNull();
}
void InitCollateralAddress(){
std::string strAddress = "";
strAddress = "PEYQrAgJ8vqyeUXKgwi575xqWhMb3PnMUb";
SetCollateralAddress(strAddress);
}
void SetMinBlockSpacing(int minBlockSpacingIn){
minBlockSpacing = minBlockSpacingIn;
}
bool SetCollateralAddress(std::string strAddress);
void Reset();
void SetNull(bool clearEverything=false);
void UnlockCoins();
bool IsNull() const
{
return (state == POOL_STATUS_ACCEPTING_ENTRIES && entries.empty() && myEntries.empty());
}
int GetState() const
{
return state;
}
int GetEntriesCount() const
{
if(fMasterNode){
return entries.size();
} else {
return entriesCount;
}
}
int GetLastEntryAccepted() const
{
return lastEntryAccepted;
}
int GetCountEntriesAccepted() const
{
return countEntriesAccepted;
}
int GetMyTransactionCount() const
{
return myEntries.size();
}
void UpdateState(unsigned int newState)
{
if (fMasterNode && (newState == POOL_STATUS_ERROR || newState == POOL_STATUS_SUCCESS)){
LogPrintf("CDarkSendPool::UpdateState() - Can't set state to ERROR or SUCCESS as a masternode. \n");
return;
}
LogPrintf("CDarkSendPool::UpdateState() == %d | %d \n", state, newState);
if(state != newState){
lastTimeChanged = GetTimeMillis();
if(fMasterNode) {
RelayDarkSendStatus(darkSendPool.sessionID, darkSendPool.GetState(), darkSendPool.GetEntriesCount(), MASTERNODE_RESET);
}
}
state = newState;
}
int GetMaxPoolTransactions()
{
//use the production amount
return POOL_MAX_TRANSACTIONS;
}
//Do we have enough users to take entries?
bool IsSessionReady(){
return sessionUsers >= GetMaxPoolTransactions();
}
// Are these outputs compatible with other client in the pool?
bool IsCompatibleWithEntries(std::vector<CTxOut> vout);
// Is this amount compatible with other client in the pool?
bool IsCompatibleWithSession(int64_t nAmount, CTransaction txCollateral, std::string& strReason);
// Passively run Darksend in the background according to the configuration in settings (only for QT)
bool DoAutomaticDenominating(bool fDryRun=false, bool ready=false);
bool PrepareDarksendDenominate();
// check for process in Darksend
void Check();
// charge fees to bad actors
void ChargeFees();
// rarely charge fees to pay miners
void ChargeRandomFees();
void CheckTimeout();
// check to make sure a signature matches an input in the pool
bool SignatureValid(const CScript& newSig, const CTxIn& newVin);
// if the collateral is valid given by a client
bool IsCollateralValid(const CTransaction& txCollateral);
// add a clients entry to the pool
bool AddEntry(const std::vector<CTxIn>& newInput, const int64_t& nAmount, const CTransaction& txCollateral, const std::vector<CTxOut>& newOutput, std::string& error);
// add signature to a vin
bool AddScriptSig(const CTxIn newVin);
// are all inputs signed?
bool SignaturesComplete();
// as a client, send a transaction to a masternode to start the denomination process
void SendDarksendDenominate(std::vector<CTxIn>& vin, std::vector<CTxOut>& vout, int64_t amount);
// get masternode updates about the progress of darksend
bool StatusUpdate(int newState, int newEntriesCount, int newAccepted, std::string& error, int newSessionID=0);
// as a client, check and sign the final transaction
bool SignFinalTransaction(CTransaction& finalTransactionNew, CNode* node);
// get the last valid block hash for a given modulus
bool GetLastValidBlockHash(uint256& hash, int mod=1, int nBlockHeight=0);
// process a new block
void NewBlock();
void CompletedTransaction(bool error, std::string lastMessageNew);
void ClearLastMessage();
// used for liquidity providers
bool SendRandomPaymentToSelf();
// split up large inputs or make fee sized inputs
bool MakeCollateralAmounts();
bool CreateDenominated(int64_t nTotalValue);
// get the denominations for a list of outputs (returns a bitshifted integer)
int GetDenominations(const std::vector<CTxOut>& vout);
void GetDenominationsToString(int nDenom, std::string& strDenom);
// get the denominations for a specific amount of euno.
int GetDenominationsByAmount(int64_t nAmount, int nDenomTarget=0);
int GetDenominationsByAmounts(std::vector<int64_t>& vecAmount);
};
void ConnectToDarkSendMasterNodeWinner();
void ThreadCheckDarkSendPool();
#endif
| [
"[email protected]"
] | |
1255eedd2fb6dbb4cf96f273bdc53e9329ed5db2 | 1742cd526f243de44a84769c07266c473648ecd6 | /cdf/102428g2.cpp | b1a7506acb3972427753e1e27c7113afbf7bcb1f | [] | no_license | filipeabelha/gym-solutions | 0d555f124fdb32508f6406f269a67eed5044d9c6 | 4eb8ad60643d7923780124cba3d002c5383a66a4 | refs/heads/master | 2021-01-23T05:09:38.962238 | 2020-11-29T07:14:31 | 2020-11-29T07:14:31 | 86,275,942 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,228 | cpp | #include <bits/stdc++.h>
using namespace std;
mt19937_64 llrand(random_device{}());
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define cl(x, v) memset((x), (v), sizeof(x))
#define db(x) cerr << #x << " == " << x << endl
#define dbs(x) cerr << x << endl
#define _ << ", " <<
#define gcd(x, y) __gcd((x), (y))
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, pll> plll;
typedef vector<int> vi;
typedef vector<vi> vii;
const ld EPS = 1e-9, PI = acos(-1.);
const ll LINF = 0x3f3f3f3f3f3f3f3f, LMOD = 1011112131415161719ll;
const int INF = 0x3f3f3f3f, MOD = 1e9+7;
const int N = 1e6+1, K = 26;
int sl[2*N], len[2*N], sz, last;
ll cnt[2*N];
map <int, int> adj[2*N];
void add (int c) {
int u = sz++;
len[u] = len[last] + 1;
cnt[u] = 1;
int p = last;
while (p != -1 and !adj[p][c])
adj[p][c] = u, p = sl[p];
if (p == -1) sl[u] = 0;
else {
int q = adj[p][c];
if (len[p]+1 == len[q]) sl[u] = q;
else {
int r = sz++;
len[r] = len[p]+1;
sl[r] = sl[q];
adj[r] = adj[q];
while(p != -1 and adj[p][c] == q)
adj[p][c] = r, p = sl[p];
sl[q] = sl[u] = r;
}
}
last = u;
}
void clear() {
for(int i = 0; i <= sz; ++i) adj[i].clear();
last = 0;
sz = 1;
sl[0] = -1;
}
void build (string& s) {
clear();
for (auto c : s) add(c);
}
string s, t;
int n;
int main () {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin >> s >> n;
build(s);
while (n--) {
cin >> t;
int ans = 0;
bool ok = true;
int u = 0;
for (int i = 0; i < t.size(); i++) {
char c = t[i];
int v = adj[u][c];
if (!u and !v) {
ok = false;
break;
}
if (!v) {
u = 0;
ans++;
i--;
continue;
}
u = v;
}
if (u) ans++;
if (!ok) ans = -1;
cout << ans << "\n";
}
return 0;
}
| [
"[email protected]"
] | |
150bfe617e4781066bb735c322a81356ee34a612 | 0c766c930e915e86fb4080c39ae20dded082ebbd | /Model.cpp | 43d6bb48cb585b574d2dbb236a128baf0007805e | [] | no_license | MeridianPoint/QT_L_system | c54a2e6a323352c614a6e79e2b366797db226f03 | b93da75ba2fdaf6d4ae22d114dff1d9b4e1c411a | refs/heads/master | 2020-06-08T05:09:34.413083 | 2015-09-10T16:17:46 | 2015-09-10T16:17:46 | 41,835,749 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 19,367 | cpp | #include "stable.h"
#include "Model.h"
Model::Model()
{
}
Model::~Model()
{
}
////utilities
void Model::GenerateTengentSpace(){
/*for (unsigned int i = 0; i < Indices.size(); i += 3) {
Vertex& v0 = Vertices[Indices[i]];
Vertex& v1 = Vertices[Indices[i + 1]];
Vertex& v2 = Vertices[Indices[i + 2]];
Vector3f Edge1 = v1.m_pos - v0.m_pos;
Vector3f Edge2 = v2.m_pos - v0.m_pos;
float DeltaU1 = v1.m_tex.x - v0.m_tex.x;
float DeltaV1 = v1.m_tex.y - v0.m_tex.y;
float DeltaU2 = v2.m_tex.x - v0.m_tex.x;
float DeltaV2 = v2.m_tex.y - v0.m_tex.y;
float f = 1.0f / (DeltaU1 * DeltaV2 - DeltaU2 * DeltaV1);
Vector3f Tangent, Bitangent;
Tangent.x = f * (DeltaV2 * Edge1.x - DeltaV1 * Edge2.x);
Tangent.y = f * (DeltaV2 * Edge1.y - DeltaV1 * Edge2.y);
Tangent.z = f * (DeltaV2 * Edge1.z - DeltaV1 * Edge2.z);
Bitangent.x = f * (-DeltaU2 * Edge1.x - DeltaU1 * Edge2.x);
Bitangent.y = f * (-DeltaU2 * Edge1.y - DeltaU1 * Edge2.y);
Bitangent.z = f * (-DeltaU2 * Edge1.z - DeltaU1 * Edge2.z);
v0.m_tangent += Tangent;
v1.m_tangent += Tangent;
v2.m_tangent += Tangent;
}*/
m_tangent.resize(m_polygons.size()*3);
m_bitengent.resize(m_polygons.size() * 3);
//std::vector<Vec3f> face_tangent;
//std::vector<Vec3f> face_binormal;
//face_tangent.resize(m_polygons.size());
//face_binormal.resize(m_polygons.size());
if (haveUV){
for (unsigned i = 0; i < m_polygons.size(); i++)
{
Vec3f Edge1 = m_verts[m_polygons[i][1]] - m_verts[m_polygons[i][0]];
Vec3f Edge2 = m_verts[m_polygons[i][2]] - m_verts[m_polygons[i][0]];
Vec2f DeltaUV1 = m_uv_raw[i][1] - m_uv_raw[i][0];
Vec2f DeltaUV2 = m_uv_raw[i][2] - m_uv_raw[i][0];
float f = 1.0f / (DeltaUV1.x() * DeltaUV2.y() - DeltaUV2.x() * DeltaUV1.y());
Vec3f Tangent, Bitangent;
Tangent = Edge1*DeltaUV1.x()-Edge2*DeltaUV2.y();
//Tangent.normalize();
Bitangent = m_vert_normal[m_polygons[i][0]].cross(Tangent);
//face_tangent[i] = Tangent;
m_tangent[i][0] = Tangent;
m_tangent[i][1] = Tangent;
m_tangent[i][2] = Tangent;
m_bitengent[i][0] = Bitangent;
m_bitengent[i][1] = Bitangent;
m_bitengent[i][2] = Bitangent;
}
}
}
//// transformation ///////////////////////
void Model::Translate(Vec3f &transVector, Trans_Space space){
Mat4f transMat = Mat4f(
1.0, 0.0, 0.0, transVector.x(),
0.0, 1.0, 0.0, transVector.y(),
0.0, 0.0, 1.0, transVector.z(),
0.0,0.0,0.0,1.0
);
if (space == TRANS_WORLD)
{
Translate_Matrix = transMat*Translate_Matrix;
//translate center
Transformation_Matrix = transMat*Transformation_Matrix;
m_center = HomoGenTransformation(transMat, m_center);
pivot = HomoGenTransformation(transMat, pivot);
}
else if (space == TRANS_PARENT)
{
transMat = Parent_Matrix.Inverse()*transMat*Parent_Matrix;
Translate_Matrix = transMat*Translate_Matrix;
Transformation_Matrix = transMat*Transformation_Matrix;
m_center = HomoGenTransformation(transMat, m_center);
pivot = HomoGenTransformation(transMat, pivot);
}
else if (space == TRANS_SELF) //rotation
{
transMat = Rotation_Matrix*transMat*Rotation_Matrix.Inverse();
Translate_Matrix = transMat*Translate_Matrix;
Transformation_Matrix = transMat*Transformation_Matrix;
m_center = HomoGenTransformation(transMat, m_center);
pivot = HomoGenTransformation(transMat, pivot);
}
else if(space ==TRANS_PIVOT){
transMat = Rotation_Matrix*transMat*Rotation_Matrix.Inverse();
Translate_Matrix = transMat*Translate_Matrix;
Transformation_Matrix = transMat*Transformation_Matrix;
m_center = HomoGenTransformation(transMat, m_center);
pivot = HomoGenTransformation(transMat, pivot);
}
else{
std::cerr << "Flag invalid!" << std::endl;
}
}
void Model::Rotation(float degree, Vec3f &axis, Trans_Space space){
float r_radius = degree / 180 * PI;
Mat4f Mat_Rotate = Mat4f(
((1 - cos(r_radius))*axis.x()*axis.x()) + cos(r_radius), ((1 - cos(r_radius))*axis.x()*axis.y()) - axis.z()*sin(r_radius), ((1 - cos(r_radius))*axis.x()*axis.z()) + axis.y()*sin(r_radius), 0.0f,
((1 - cos(r_radius))*axis.x()*axis.y()) + axis.z()*sin(r_radius), ((1 - cos(r_radius))*axis.y()*axis.y()) + cos(r_radius), ((1 - cos(r_radius))*axis.y()*axis.z()) - axis.x()*sin(r_radius), 0.0f,
((1 - cos(r_radius))*axis.x()*axis.z()) - axis.y()*sin(r_radius), ((1 - cos(r_radius))*axis.z()*axis.y()) + axis.x()*sin(r_radius), ((1 - cos(r_radius))*axis.z()*axis.z()) + cos(r_radius), 0.0f,
0.0f, 0.0f, 0.0f, 1.0f
);
Mat4f Translate_M = Mat4f(
1.0f, 0.0f, 0.0f, -m_center.x(),
0.0f, 1.0f, 0.0f, -m_center.y(),
0.0f, 0.0f, 1.0f, -m_center.z(),
0.0f, 0.0f, 0.0f, 1.0f
);
//Rotation_M = Parent_M.Inverse()*Mat_Rotate*Parent_M*Temp_RMatrix;
if (space == TRANS_WORLD)
{
Rotation_Matrix = Mat_Rotate*Rotation_Matrix;
Transformation_Matrix = Translate_M.Inverse()*Mat_Rotate*Translate_M*Transformation_Matrix;
}
else if (space==TRANS_PARENT)
{
Rotation_Matrix = Parent_Matrix.Inverse()*Mat_Rotate*Parent_Matrix*Rotation_Matrix;
Transformation_Matrix = Translate_M.Inverse()*Parent_Matrix.Inverse()*Mat_Rotate*Parent_Matrix*Translate_M*Transformation_Matrix;
}
else if (space == TRANS_SELF)
{
Rotation_Matrix = Parent_Matrix.Inverse()*Mat_Rotate*Parent_Matrix*Rotation_Matrix;
Transformation_Matrix = Translate_M.Inverse()*Parent_Matrix.Inverse()*Mat_Rotate*Parent_Matrix*Translate_M*Transformation_Matrix;
}
else if (space ==TRANS_PIVOT){
Mat4f Pivot_Trans=Mat4f(
1.0f, 0.0f, 0.0f, -pivot.x(),
0.0f, 1.0f, 0.0f, -pivot.y(),
0.0f, 0.0f, 1.0f, -pivot.z(),
0.0f, 0.0f, 0.0f, 1.0f
);
Transformation_Matrix = Pivot_Trans.Inverse()*Rotation_Matrix*Mat_Rotate*Rotation_Matrix.Inverse()*Pivot_Trans*Transformation_Matrix;
Rotation_Matrix = Mat_Rotate*Rotation_Matrix;
}
else
{
std::cerr << "Flag invalid!" << std::endl;
}
/*Rotation_Matrix = Parent_Matrix.Inverse()*Mat_Rotate*Parent_Matrix*Rotation_Matrix;
Transformation_Matrix = Translate.Inverse()*Parent_Matrix.Inverse()*Mat_Rotate*Parent_Matrix*Translate*Transformation_Matrix;*/
}
void Model::RelativeRotation(float degree, Vec3f &axis, Trans_Space space){
float r_radius = degree / 180 * PI;
Mat4f Mat_Rotate = Mat4f(
((1 - cos(r_radius))*axis.x()*axis.x()) + cos(r_radius), ((1 - cos(r_radius))*axis.x()*axis.y()) - axis.z()*sin(r_radius), ((1 - cos(r_radius))*axis.x()*axis.z()) + axis.y()*sin(r_radius), 0.0f,
((1 - cos(r_radius))*axis.x()*axis.y()) + axis.z()*sin(r_radius), ((1 - cos(r_radius))*axis.y()*axis.y()) + cos(r_radius), ((1 - cos(r_radius))*axis.y()*axis.z()) - axis.x()*sin(r_radius), 0.0f,
((1 - cos(r_radius))*axis.x()*axis.z()) - axis.y()*sin(r_radius), ((1 - cos(r_radius))*axis.z()*axis.y()) + axis.x()*sin(r_radius), ((1 - cos(r_radius))*axis.z()*axis.z()) + cos(r_radius), 0.0f,
0.0f, 0.0f, 0.0f, 1.0f
);
Mat4f Translate_M = Mat4f(
1.0f, 0.0f, 0.0f, -m_center.x(),
0.0f, 1.0f, 0.0f, -m_center.y(),
0.0f, 0.0f, 1.0f, -m_center.z(),
0.0f, 0.0f, 0.0f, 1.0f
);
//Rotation_M = Parent_M.Inverse()*Mat_Rotate*Parent_M*Temp_RMatrix;
/*Rotation_Matrix = Mat_Rotate*Rotation_Matrix;
Transformation_Matrix = Translate_M.Inverse()*Mat_Rotate*Translate_M*Transformation_Matrix;*/
Rotation_Matrix = Parent_Matrix.Inverse()*Mat_Rotate*Parent_Matrix*Rotation_Matrix;
Transformation_Matrix = Translate_M.Inverse()*Parent_Matrix.Inverse()*Mat_Rotate*Parent_Matrix*Translate_M*Transformation_Matrix;
}
void Model::Scale(float percentage){
Mat4f Scale_Mat = Mat4f(
1.0+percentage,0.0,0.0,0.0,
0.0, 1.0 + percentage, 0.0, 0.0,
0.0, 0.0, 1.0 + percentage, 0.0,
0.0,0.0,0.0,1.0
);
Mat4f Translate_M = Mat4f(
1.0f, 0.0f, 0.0f, -m_center.x(),
0.0f, 1.0f, 0.0f, -m_center.y(),
0.0f, 0.0f, 1.0f, -m_center.z(),
0.0f, 0.0f, 0.0f, 1.0f
);
Scale_Matrix = Scale_Mat*Scale_Matrix;
Transformation_Matrix = Translate_M.Inverse()*Rotation_Matrix*Scale_Mat*Rotation_Matrix.Inverse()*Translate_M*Transformation_Matrix;
}
void Model::Forward(ForwardType flag){
if(flag==F_DRAW){//draw
Translate(Vec3f(0.0,0.0,m_max_bounding.z()-m_min_bounding.z()),TRANS_SELF);
//Translate(Vec3f(0.0,0.0,3),TRANS_SELF);
ClassicDraw(SMOOTH,UV_RAW);
//VBODraw();
}
else{ //not draw
Translate(Vec3f(0.0,0.0,m_max_bounding.z()-m_min_bounding.z()),TRANS_SELF);
//Translate(Vec3f(0.0,0.0,3),TRANS_SELF);
}
}
////// draw //////////////////////////
void Model::ClassicDraw(int drawType,int uv_type=UV_LACK){
// glUseProgram(materialID);
glMatrixMode(GL_MODELVIEW);
//glLoadIdentity();
/*glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);*/
//glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
glLoadMatrixf(Transformation_Matrix.ToArray());
glColor3f(1.0, 0.0, 1.0);
glBegin(GL_TRIANGLES);
for (unsigned int i = 0; i < m_polygons.size(); i++){
if (drawType==FLAT)
{
glNormal3fv(m_face_normal[i].getPtr());
}
for (unsigned int j = 0; j < m_polygons[i].size(); j++){
if (drawType == SMOOTH)
{
glNormal3fv(m_vert_normal[m_polygons[i][j]].getPtr());
}
if (uv_type==UV_VERTEX){
glTexCoord2fv(m_uv_coord[m_polygons[i][j]].getPtr());
}
else if (uv_type == UV_RAW)
{
glTexCoord2fv(m_uv_raw[i][j].getPtr());
}
glVertex3fv(m_verts[m_polygons[i][j]].getPtr());
}
}
glEnd();
}
void Model::VBODraw(){
//pass transformation matrix
/*GLuint ModelMatrix=glGetUniformLocation(materialID, "ModelViewMatrix");
glUniformMatrix4fv(ModelMatrix,16*sizeof(float),false,Transformation_Matrix.ToArray());*/
glUseProgram(materialID);
Mat4f ModelViewProjectionMat=ProjectionViewMatrix*Transformation_Matrix;
GLuint MatrixID = glGetUniformLocation(materialID, "MVP");
glUniformMatrix4fv(MatrixID, 1, GL_FALSE, ModelViewProjectionMat.ToArray());
GLuint ModelMatrixID = glGetUniformLocation(materialID, "M");
glUniformMatrix4fv(ModelMatrixID, 1, GL_FALSE, ModelViewProjectionMat.ToArray());
Mat3f ModelViewMatrix3x3=ViewnMat*Mat3f(Rotation_Matrix.xx(),Rotation_Matrix.xy(),Rotation_Matrix.xz(),Rotation_Matrix.yx(),Rotation_Matrix.yy(),Rotation_Matrix.yz(),Rotation_Matrix.zx(),Rotation_Matrix.zy(),Rotation_Matrix.zz());
GLuint ModelView3x3MatrixID = glGetUniformLocation(materialID, "MV3x3");
glUniformMatrix3fv(ModelView3x3MatrixID,1,GL_FALSE,ModelViewMatrix3x3.ToArray());
// Bind our diffuse texture in Texture Unit 0
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, pMaterial->getTextureID(0));
// Set our "DiffuseTextureSampler" sampler to user Texture Unit 0
glUniform1i(pMaterial->getTextureID(0), 0);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, pMaterial->getTextureID(1));
// Set our "DiffuseTextureSampler" sampler to user Texture Unit 0
glUniform1i(pMaterial->getTextureID(1), 1);
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, pMaterial->getTextureID(2));
// Set our "DiffuseTextureSampler" sampler to user Texture Unit 0
glUniform1i(pMaterial->getTextureID(2), 2);
//VBO
//const unsigned int size = m_polygons.size() * 9;
//std::vector<float> vertex_array;
//vertex_array.resize(size);
//for (unsigned int i = 0; i < m_polygons.size(); i++){
//vertex_array[i * 3] = m_verts[m_polygons[i][0]].x();
//vertex_array[i * 3 + 1] = m_verts[m_polygons[i][0]].y();
//vertex_array[i * 3 + 2] = m_verts[m_polygons[i][0]].z();
//vertex_array[i * 3 + 3] = m_verts[m_polygons[i][1]].x();
//vertex_array[i * 3 + 4] = m_verts[m_polygons[i][1]].y();
//vertex_array[i * 3 + 5] = m_verts[m_polygons[i][1]].z();
//vertex_array[i * 3 + 6] = m_verts[m_polygons[i][2]].x();
//vertex_array[i * 3 + 7] = m_verts[m_polygons[i][2]].y();
//vertex_array[i * 3 + 8] = m_verts[m_polygons[i][2]].z();
//}
//vertexArray
GLuint VertexArray;
glGenBuffers(1,&VertexArray);
glBindBuffer(GL_ARRAY_BUFFER, VertexArray);
glBufferData(GL_ARRAY_BUFFER, vbo_size*3*sizeof(float), vbo_vertex, GL_STATIC_DRAW);
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, VertexArray);
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
0,
(void*)0
);
//uv
GLuint UVArray;
glGenBuffers(1, &UVArray);
glBindBuffer(GL_ARRAY_BUFFER,UVArray);
glBufferData(GL_ARRAY_BUFFER,vbo_size*2*sizeof(float),vbo_uv,GL_STATIC_DRAW);
glEnableVertexAttribArray(1);
glBindBuffer(GL_ARRAY_BUFFER,UVArray);
glVertexAttribPointer(
1,
2,
GL_FLOAT,
GL_FALSE,
0,
(void*)0
);
//normal
//std::vector<float> normal_array;
//normal_array.resize(size);
//for (unsigned int i = 0; i < m_polygons.size(); i++){
//normal_array[i * 3] = m_vert_normal[m_polygons[i][0]].x();
//normal_array[i * 3 + 1] = m_vert_normal[m_polygons[i][0]].y();
//normal_array[i * 3 + 2] = m_vert_normal[m_polygons[i][0]].z();
//normal_array[i * 3 + 3] = m_vert_normal[m_polygons[i][1]].x();
//normal_array[i * 3 + 4] = m_vert_normal[m_polygons[i][1]].y();
//normal_array[i * 3 + 5] = m_vert_normal[m_polygons[i][1]].z();
//normal_array[i * 3 + 6] = m_vert_normal[m_polygons[i][2]].x();
//normal_array[i * 3 + 7] = m_vert_normal[m_polygons[i][2]].y();
//normal_array[i * 3 + 8] = m_vert_normal[m_polygons[i][2]].z();
//}
//normal
GLuint NormalArray;
glGenBuffers(1, &NormalArray);
glBindBuffer(GL_ARRAY_BUFFER, NormalArray);
glBufferData(GL_ARRAY_BUFFER,vbo_size*3*sizeof(float), vbo_normal, GL_STATIC_DRAW);
glEnableVertexAttribArray(2);
glBindBuffer(GL_ARRAY_BUFFER, NormalArray);
glVertexAttribPointer(
2,
3,
GL_FLOAT,
GL_FALSE,
0,
(void*)0
);
//tangent
const GLfloat* cvbo_tangent=const_cast<const GLfloat*>(vbo_tangent);
GLuint TangentArray;
glGenBuffers(1, &TangentArray);
glBindBuffer(GL_ARRAY_BUFFER, TangentArray);
glBufferData(GL_ARRAY_BUFFER,vbo_size*3*sizeof(float), cvbo_tangent, GL_STATIC_DRAW);
glEnableVertexAttribArray(3);
glBindBuffer(GL_ARRAY_BUFFER, TangentArray);
glVertexAttribPointer(
3,
3,
GL_FLOAT,
GL_FALSE,
0,
(void*)0
);
GLuint BinormalArray;
glGenBuffers(1, &BinormalArray);
glBindBuffer(GL_ARRAY_BUFFER, BinormalArray);
glBufferData(GL_ARRAY_BUFFER,vbo_size*3*sizeof(float), vbo_binormal, GL_STATIC_DRAW);
glEnableVertexAttribArray(4);
glBindBuffer(GL_ARRAY_BUFFER, BinormalArray);
glVertexAttribPointer(
4,
3,
GL_FLOAT,
GL_FALSE,
0,
(void*)0
);
//texture coordinate
/*GLuint TextureCoordinate;
glGenBuffers(1, &TextureCoordinate);*/
//glBindBuffer();
glDrawArrays(GL_TRIANGLES, 0, vbo_size); // Starting from vertex 0; 3 vertices total -> 1 triangle
glDisableVertexAttribArray(0);
glDisableVertexAttribArray(1);
glDisableVertexAttribArray(2);
glDisableVertexAttribArray(3);
glDisableVertexAttribArray(4);
}
//////////geometry ////////////////////////////////////////////////
void Model::getGeometryParameters(){
/*calculate center point*/
//check xmin
auto x_min_elem = min_element(m_verts.begin(), m_verts.end(), [](Vec3f const& s1, Vec3f const& s2)
{
return s1.x() < s2.x();
});
float x_min = x_min_elem->x();
auto x_max_elem = max_element(m_verts.begin(), m_verts.end(), [](Vec3f const& s1, Vec3f const& s2)
{
return s1.x() < s2.x();
});
float x_max = x_max_elem->x();
//check ymin
auto y_min_elem = min_element(m_verts.begin(), m_verts.end(), [](Vec3f const& s1, Vec3f const& s2)
{
return s1.y() < s2.y();
});
float y_min = y_min_elem->y();
auto y_max_elem = max_element(m_verts.begin(), m_verts.end(), [](Vec3f const& s1, Vec3f const& s2)
{
return s1.y() < s2.y();
});
float y_max = y_max_elem->y();
auto z_min_elem = min_element(m_verts.begin(), m_verts.end(), [](Vec3f const& s1, Vec3f const& s2)
{
return s1.z() < s2.z();
});
float z_min = z_min_elem->z();
auto z_max_elem = max_element(m_verts.begin(), m_verts.end(), [](Vec3f const& s1, Vec3f const& s2)
{
return s1.z() < s2.z();
});
float z_max = z_max_elem->z();
//define bouding box
m_max_bounding = Vec3f(x_max, y_max, z_max);
m_min_bounding = Vec3f(x_min, y_min, z_min);
//get center
m_center = (m_max_bounding + m_min_bounding) / 2;
}
///utilities ///////////
Vec3f Model::HomoGenTransformation(Mat4f TransMat, Vec3f Vec){
Vec4f h_Vec(Vec.x(), Vec.y(), Vec.z(), 1.0f);
h_Vec = TransMat*h_Vec;
return Vec3f(h_Vec.x(), h_Vec.y(), h_Vec.z());
}
void Model::CreateVertexVBO(){
//vbo_size=m_polygons.size()*3;
vbo_vertex=new GLfloat[vbo_size*3];
for(unsigned int i=0;i<m_polygons.size();i++){
for(unsigned int j=0;j<3;j++){
vbo_vertex[9*i+3*j]=m_verts[m_polygons[i][j]].x();
vbo_vertex[9*i+3*j+1]=m_verts[m_polygons[i][j]].y();
vbo_vertex[9*i+3*j+2]=m_verts[m_polygons[i][j]].z();
}
}
}
void Model::CreateNormalVBO(){
vbo_normal=new GLfloat[vbo_size*3];
for(unsigned int i=0;i<m_polygons.size();i++){
for(unsigned int j=0;j<3;j++){
vbo_normal[9*i+3*j]=m_vert_normal[m_polygons[i][j]].x();
vbo_normal[9*i+3*j+1]=m_vert_normal[m_polygons[i][j]].y();
vbo_normal[9*i+3*j+2]=m_vert_normal[m_polygons[i][j]].z();
}
}
}
void Model::CreateTextureVBO(){
vbo_uv=new GLfloat[vbo_size*2];
for(unsigned int i=0;i<m_polygons.size();i++){
for(unsigned int j=0;j<2;j++){
vbo_uv[6*i+2*j]=m_uv_raw[i][j].x();
vbo_uv[6*i+2*j+1]=m_uv_raw[i][j].y();;
}
}
}
void Model::CreateTangentSpaceVBO(){
vbo_tangent=new GLfloat[vbo_size*3];
for(unsigned int i=0;i<m_polygons.size();i++){
for(unsigned int j=0;j<3;j++){
vbo_tangent[9*i+3*j]=m_tangent[i][j].x();
vbo_tangent[9*i+3*j+1]=m_tangent[i][j].y();
vbo_tangent[9*i+3*j+2]=m_tangent[i][j].z();
}
}
vbo_binormal=new GLfloat[vbo_size*3];
for(unsigned int i=0;i<m_polygons.size();i++){
for(unsigned int j=0;j<3;j++){
vbo_binormal[9*i+3*j]=m_bitengent[i][j].x();
vbo_binormal[9*i+3*j+1]=m_bitengent[i][j].y();
vbo_binormal[9*i+3*j+2]=m_bitengent[i][j].z();
}
}
}
void Model::setPovitToBottom(){
pivot=Vec3f((m_max_bounding.x()+m_min_bounding.x())/2,(m_max_bounding.y()+m_min_bounding.y())/2,m_min_bounding.z());
pivotSpace=Mat4f(
1.0,0.0,0.0,0.0,
0.0,1.0,0.0,0.0,
0.0,0.0,1.0,0.0,
0.0,0.0,0.0,1.0
);
}
| [
"[email protected]"
] | |
61b1c2fe7685ae68233c675943c8a0c9db34380f | 3078e07a6ff846268255750a515c3254c7ce53c1 | /Make a circle with OOP/Make a circle with OOP.cpp | 4a9110e7a3d408c93c999e48326f79c6cd611d29 | [] | no_license | tyler-cranmer/Circle-Object- | c34a6e27ebe68d30190ea1654238aa8224440991 | 4052654fca1395a3c093d08b3c97e0f274229d9d | refs/heads/master | 2020-12-02T01:21:43.474563 | 2019-12-30T03:53:49 | 2019-12-30T03:53:49 | 230,840,679 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 608 | cpp | //Make a circle with OOP.cpp : This file contains the 'main' function. Program execution begins and ends there.
//Task is to create a Circle constructor that creates a circle with a radius provided by an argument.
//The circles constructed must have two getters find_area() (PIr^2) and find_circum() (2PI*r) which give both respective areas and perimeter (circumference).
#include <iostream>
#include "Header.h"
using namespace std;
int main()
{
circle one(4);
cout << "Area of the circle is: " << one.find_area() << endl;
cout << "Circumference of the circle is: " << one.find_circum() << endl;
}
| [
"[email protected]"
] | |
cae1691f3a44d92652f032e4d104074c03a751fa | d2e2b7785e6cb59f7ac4b7c465515d63b8d93750 | /Algorithms/Sorting/quick.cc | 099b037f24d3c5b69269db944e8ea7e27f1f1f4a | [] | no_license | jlsotomayorm/Algorithms-and-Data-Structures | fd22cf3be396608a99fe7d802752371e8a6d82cc | 319f76eb62c9778ed8bb400e773543f12e710df0 | refs/heads/master | 2021-01-10T09:50:42.991950 | 2016-02-09T20:37:48 | 2016-02-09T20:37:48 | 50,198,722 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 844 | cc | #include "quick.h"
Quick::Quick(int n):Sort(n)
{
}
Quick::~Quick()
{
delete[] pVector;
}
void Quick::execute()
{
clock_t begin = clock();
quickSort(0,size-1);
clock_t end = clock();
tiempo = (double) (end-begin) /CLOCKS_PER_SEC;
}
void* Quick::ordena(void *p)
{
((Sort*)p)->execute();
//cout<<"Ordenado con Quick Sort"<<endl;
//((Sort*)p)->print();
}
void Quick::run()
{
pthread_create(&hilo,NULL,ordena,this);
}
void Quick::quickSort(int primero,int ultimo)
{
int i=primero,j=ultimo;
int mid = pVector[(primero+ultimo)/2];
int tmp;
do
{
while(pVector[i]<mid)
i++;
while(pVector[j]>mid)
j--;
if(i<=j)
{
tmp = pVector[j];
pVector[j]=pVector[i];
pVector[i]=tmp;
i++;
j--;
}
}while(i<=j);
if(primero<j) quickSort(primero,j);
if(ultimo>i) quickSort(i,ultimo);
}
| [
"[email protected]"
] | |
fdb9aa157d3e8d61da907a2d492ee924e2db968f | 5cf04a4324110ace538302aaa8484a05f09f0d9c | /Sourcecode/mx/core/elements/String.h | d95a2994f798d520f0aec91696984ef066eda588 | [
"MIT"
] | permissive | jsj2008/MusicXML-Class-Library | ebce53a1d1fea280141c84b62b232c3395ad0eb6 | 079c4b87835cc9942c052571d7ee3ebfdb91fa31 | refs/heads/master | 2020-05-31T16:05:09.402234 | 2017-03-10T23:02:09 | 2017-03-10T23:02:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,712 | h | // MusicXML Class Library
// Copyright (c) by Matthew James Briggs
// Distributed under the MIT License
#pragma once
#include "mx/core/ForwardDeclare.h"
#include "mx/core/ElementInterface.h"
#include "mx/core/Integers.h"
#include "mx/core/elements/StringAttributes.h"
#include <iosfwd>
#include <memory>
#include <vector>
namespace mx
{
namespace core
{
MX_FORWARD_DECLARE_ATTRIBUTES( StringAttributes )
MX_FORWARD_DECLARE_ELEMENT( String )
inline StringPtr makeString() { return std::make_shared<String>(); }
inline StringPtr makeString( const StringNumber& value ) { return std::make_shared<String>( value ); }
inline StringPtr makeString( StringNumber&& value ) { return std::make_shared<String>( std::move( value ) ); }
class String : public ElementInterface
{
public:
String();
String( const StringNumber& value );
virtual bool hasAttributes() const;
virtual std::ostream& streamAttributes( std::ostream& os ) const;
virtual std::ostream& streamName( std::ostream& os ) const;
virtual bool hasContents() const;
virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const;
StringAttributesPtr getAttributes() const;
void setAttributes( const StringAttributesPtr& value );
StringNumber getValue() const;
void setValue( const StringNumber& value );
bool fromXElement( std::ostream& message, xml::XElement& xelement );
private:
StringAttributesPtr myAttributes;
StringNumber myValue;
};
}
}
| [
"[email protected]"
] | |
fe2232c655c818e2800ddcb6d288b626f7dea1e3 | 594b6fb2e10fdb1380af409b6a7d12699c788dd8 | /7z1506-src/CPP/7zip/Compress/DeflateDecoder.cpp | 5e2d5d3e135a4e7e2dc2397f6437a380f10d8629 | [] | no_license | antonmdv/7zip-OpenSourceContribution | 26e56ec6cf731e5667b7988d2cba9bf22aa71fa0 | d2e9ef078c66007a96fdb1b1ac3e42be014ed450 | refs/heads/master | 2020-03-27T09:41:39.241496 | 2018-08-27T23:24:55 | 2018-08-27T23:24:55 | 146,363,979 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,518 | cpp | // DeflateDecoder.cpp
#include "StdAfx.h"
#include "DeflateDecoder.h"
namespace NCompress {
namespace NDeflate {
namespace NDecoder {
CCoder::CCoder(bool deflate64Mode, bool deflateNSIS):
_deflate64Mode(deflate64Mode),
_deflateNSIS(deflateNSIS),
_keepHistory(false),
_needFinishInput(false),
_needInitInStream(true),
ZlibMode(false) {}
UInt32 CCoder::ReadBits(unsigned numBits)
{
return m_InBitStream.ReadBits(numBits);
}
Byte CCoder::ReadAlignedByte()
{
return m_InBitStream.ReadAlignedByte();
}
bool CCoder::DeCodeLevelTable(Byte *values, unsigned numSymbols)
{
unsigned i = 0;
do
{
UInt32 number = m_LevelDecoder.DecodeSymbol(&m_InBitStream);
if (number < kTableDirectLevels)
values[i++] = (Byte)number;
else if (number < kLevelTableSize)
{
if (number == kTableLevelRepNumber)
{
if (i == 0)
return false;
unsigned num = ReadBits(2) + 3;
for (; num > 0 && i < numSymbols; num--, i++)
values[i] = values[i - 1];
}
else
{
unsigned num;
if (number == kTableLevel0Number)
num = ReadBits(3) + 3;
else
num = ReadBits(7) + 11;
for (; num > 0 && i < numSymbols; num--)
values[i++] = 0;
}
}
else
return false;
}
while (i < numSymbols);
return true;
}
#define RIF(x) { if (!(x)) return false; }
bool CCoder::ReadTables(void)
{
m_FinalBlock = (ReadBits(kFinalBlockFieldSize) == NFinalBlockField::kFinalBlock);
if (m_InBitStream.ExtraBitsWereRead())
return false;
UInt32 blockType = ReadBits(kBlockTypeFieldSize);
if (blockType > NBlockType::kDynamicHuffman)
return false;
if (m_InBitStream.ExtraBitsWereRead())
return false;
if (blockType == NBlockType::kStored)
{
m_StoredMode = true;
m_InBitStream.AlignToByte();
m_StoredBlockSize = ReadAligned_UInt16(); // ReadBits(kStoredBlockLengthFieldSize)
if (_deflateNSIS)
return true;
return (m_StoredBlockSize == (UInt16)~ReadAligned_UInt16());
}
m_StoredMode = false;
CLevels levels;
if (blockType == NBlockType::kFixedHuffman)
{
levels.SetFixedLevels();
_numDistLevels = _deflate64Mode ? kDistTableSize64 : kDistTableSize32;
}
else
{
unsigned numLitLenLevels = ReadBits(kNumLenCodesFieldSize) + kNumLitLenCodesMin;
_numDistLevels = ReadBits(kNumDistCodesFieldSize) + kNumDistCodesMin;
unsigned numLevelCodes = ReadBits(kNumLevelCodesFieldSize) + kNumLevelCodesMin;
if (!_deflate64Mode)
if (_numDistLevels > kDistTableSize32)
return false;
Byte levelLevels[kLevelTableSize];
for (unsigned i = 0; i < kLevelTableSize; i++)
{
unsigned position = kCodeLengthAlphabetOrder[i];
if (i < numLevelCodes)
levelLevels[position] = (Byte)ReadBits(kLevelFieldSize);
else
levelLevels[position] = 0;
}
if (m_InBitStream.ExtraBitsWereRead())
return false;
RIF(m_LevelDecoder.SetCodeLengths(levelLevels));
Byte tmpLevels[kFixedMainTableSize + kFixedDistTableSize];
if (!DeCodeLevelTable(tmpLevels, numLitLenLevels + _numDistLevels))
return false;
if (m_InBitStream.ExtraBitsWereRead())
return false;
levels.SubClear();
memcpy(levels.litLenLevels, tmpLevels, numLitLenLevels);
memcpy(levels.distLevels, tmpLevels + numLitLenLevels, _numDistLevels);
}
RIF(m_MainDecoder.SetCodeLengths(levels.litLenLevels));
return m_DistDecoder.SetCodeLengths(levels.distLevels);
}
HRESULT CCoder::CodeSpec(UInt32 curSize, bool finishInputStream)
{
if (_remainLen == kLenIdFinished)
return S_OK;
if (_remainLen == kLenIdNeedInit)
{
if (!_keepHistory)
if (!m_OutWindowStream.Create(_deflate64Mode ? kHistorySize64: kHistorySize32))
return E_OUTOFMEMORY;
RINOK(InitInStream(_needInitInStream));
m_OutWindowStream.Init(_keepHistory);
m_FinalBlock = false;
_remainLen = 0;
_needReadTable = true;
}
while (_remainLen > 0 && curSize > 0)
{
_remainLen--;
Byte b = m_OutWindowStream.GetByte(_rep0);
m_OutWindowStream.PutByte(b);
curSize--;
}
while (curSize > 0 || finishInputStream)
{
if (m_InBitStream.ExtraBitsWereRead())
return S_FALSE;
if (_needReadTable)
{
if (m_FinalBlock)
{
_remainLen = kLenIdFinished;
break;
}
if (!ReadTables())
return S_FALSE;
if (m_InBitStream.ExtraBitsWereRead())
return S_FALSE;
_needReadTable = false;
}
if (m_StoredMode)
{
if (finishInputStream && curSize == 0 && m_StoredBlockSize != 0)
return S_FALSE;
/* NSIS version contains some bits in bitl bits buffer.
So we must read some first bytes via ReadAlignedByte */
for (; m_StoredBlockSize > 0 && curSize > 0 && m_InBitStream.ThereAreDataInBitsBuffer(); m_StoredBlockSize--, curSize--)
m_OutWindowStream.PutByte(ReadAlignedByte());
for (; m_StoredBlockSize > 0 && curSize > 0; m_StoredBlockSize--, curSize--)
m_OutWindowStream.PutByte(m_InBitStream.ReadDirectByte());
_needReadTable = (m_StoredBlockSize == 0);
continue;
}
while (curSize > 0)
{
if (m_InBitStream.ExtraBitsWereRead_Fast())
return S_FALSE;
UInt32 number = m_MainDecoder.DecodeSymbol(&m_InBitStream);
if (number < 0x100)
{
m_OutWindowStream.PutByte((Byte)number);
curSize--;
continue;
}
else if (number == kSymbolEndOfBlock)
{
_needReadTable = true;
break;
}
else if (number < kMainTableSize)
{
number -= kSymbolMatch;
UInt32 len;
{
unsigned numBits;
if (_deflate64Mode)
{
len = kLenStart64[number];
numBits = kLenDirectBits64[number];
}
else
{
len = kLenStart32[number];
numBits = kLenDirectBits32[number];
}
len += kMatchMinLen + m_InBitStream.ReadBits(numBits);
}
UInt32 locLen = len;
if (locLen > curSize)
locLen = (UInt32)curSize;
number = m_DistDecoder.DecodeSymbol(&m_InBitStream);
if (number >= _numDistLevels)
return S_FALSE;
UInt32 distance = kDistStart[number] + m_InBitStream.ReadBits(kDistDirectBits[number]);
if (!m_OutWindowStream.CopyBlock(distance, locLen))
return S_FALSE;
curSize -= locLen;
len -= locLen;
if (len != 0)
{
_remainLen = (Int32)len;
_rep0 = distance;
break;
}
}
else
return S_FALSE;
}
if (finishInputStream && curSize == 0)
{
if (m_MainDecoder.DecodeSymbol(&m_InBitStream) != kSymbolEndOfBlock)
return S_FALSE;
_needReadTable = true;
}
}
if (m_InBitStream.ExtraBitsWereRead())
return S_FALSE;
return S_OK;
}
#ifdef _NO_EXCEPTIONS
#define DEFLATE_TRY_BEGIN
#define DEFLATE_TRY_END(res)
#else
#define DEFLATE_TRY_BEGIN try {
#define DEFLATE_TRY_END(res) } \
catch(const CInBufferException &e) { res = e.ErrorCode; } \
catch(const CLzOutWindowException &e) { res = e.ErrorCode; } \
catch(...) { res = S_FALSE; }
#endif
HRESULT CCoder::CodeReal(ISequentialOutStream *outStream,
const UInt64 *outSize, ICompressProgressInfo *progress)
{
HRESULT res;
DEFLATE_TRY_BEGIN
m_OutWindowStream.SetStream(outStream);
CCoderReleaser flusher(this);
const UInt64 inStart = _needInitInStream ? 0 : m_InBitStream.GetProcessedSize();
const UInt64 start = m_OutWindowStream.GetProcessedSize();
for (;;)
{
UInt32 curSize = 1 << 18;
bool finishInputStream = false;
if (outSize)
{
const UInt64 rem = *outSize - (m_OutWindowStream.GetProcessedSize() - start);
if (curSize >= rem)
{
curSize = (UInt32)rem;
if (ZlibMode || _needFinishInput)
finishInputStream = true;
}
}
if (!finishInputStream && curSize == 0)
break;
RINOK(CodeSpec(curSize, finishInputStream));
if (_remainLen == kLenIdFinished)
break;
if (progress)
{
const UInt64 inSize = m_InBitStream.GetProcessedSize() - inStart;
const UInt64 nowPos64 = m_OutWindowStream.GetProcessedSize() - start;
RINOK(progress->SetRatioInfo(&inSize, &nowPos64));
}
}
if (_remainLen == kLenIdFinished && ZlibMode)
{
m_InBitStream.AlignToByte();
for (unsigned i = 0; i < 4; i++)
ZlibFooter[i] = ReadAlignedByte();
}
flusher.NeedFlush = false;
res = Flush();
if (res == S_OK && _remainLen != kLenIdNeedInit && InputEofError())
return S_FALSE;
DEFLATE_TRY_END(res)
return res;
}
HRESULT CCoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
const UInt64 * /* inSize */, const UInt64 *outSize, ICompressProgressInfo *progress)
{
SetInStream(inStream);
SetOutStreamSize(outSize);
HRESULT res = CodeReal(outStream, outSize, progress);
ReleaseInStream();
return res;
}
STDMETHODIMP CCoder::GetInStreamProcessedSize(UInt64 *value)
{
if (value == NULL)
return E_INVALIDARG;
*value = m_InBitStream.GetProcessedSize();
return S_OK;
}
STDMETHODIMP CCoder::SetInStream(ISequentialInStream *inStream)
{
m_InStreamRef = inStream;
m_InBitStream.SetStream(inStream);
return S_OK;
}
STDMETHODIMP CCoder::ReleaseInStream()
{
m_InStreamRef.Release();
return S_OK;
}
STDMETHODIMP CCoder::SetOutStreamSize(const UInt64 * /* outSize */)
{
_remainLen = kLenIdNeedInit;
_needInitInStream = true;
m_OutWindowStream.Init(_keepHistory);
return S_OK;
}
#ifndef NO_READ_FROM_CODER
STDMETHODIMP CCoder::Read(void *data, UInt32 size, UInt32 *processedSize)
{
HRESULT res;
DEFLATE_TRY_BEGIN
if (processedSize)
*processedSize = 0;
const UInt64 startPos = m_OutWindowStream.GetProcessedSize();
m_OutWindowStream.SetMemStream((Byte *)data);
res = CodeSpec(size, false);
if (res == S_OK)
{
res = Flush();
if (processedSize)
*processedSize = (UInt32)(m_OutWindowStream.GetProcessedSize() - startPos);
}
DEFLATE_TRY_END(res)
m_OutWindowStream.SetMemStream(NULL);
return res;
}
#endif
STDMETHODIMP CCoder::CodeResume(ISequentialOutStream *outStream, const UInt64 *outSize, ICompressProgressInfo *progress)
{
_remainLen = kLenIdNeedInit;
m_OutWindowStream.Init(_keepHistory);
return CodeReal(outStream, outSize, progress);
}
}}}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.