text stringlengths 0 2.2M |
|---|
SingleMatrix matrixA = SingleMatrix::RandomGaussian(64, 23, c_deviceIdZero, 0, 2, IncrementCounter());
|
SingleMatrix matrixB = SingleMatrix::Eye(23, c_deviceIdZero);
|
BOOST_CHECK_EQUAL(CurrentDataLocation::GPU, matrixA.GetCurrentMatrixLocation());
|
BOOST_CHECK_EQUAL(CurrentDataLocation::GPU, matrixB.GetCurrentMatrixLocation());
|
// Set the current matrix location by reading a value of the matrix (via non-const operator())
|
float& x = matrixA(1, 1);
|
BOOST_CHECK_EQUAL(CurrentDataLocation::CPU, matrixA.GetCurrentMatrixLocation());
|
x = matrixB(1, 1);
|
BOOST_CHECK_EQUAL(CurrentDataLocation::CPU, matrixB.GetCurrentMatrixLocation());
|
const SingleMatrix matrixC = matrixA * matrixB;
|
BOOST_CHECK_EQUAL(CurrentDataLocation::GPU, matrixA.GetCurrentMatrixLocation());
|
BOOST_CHECK_EQUAL(CurrentDataLocation::GPU, matrixB.GetCurrentMatrixLocation());
|
BOOST_CHECK_EQUAL(CurrentDataLocation::GPU, matrixC.GetCurrentMatrixLocation());
|
}
|
BOOST_AUTO_TEST_SUITE_END()
|
}
|
} } }
|
// bsls_alignmentimp.cpp -*-C++-*-
|
#include <bsls_alignmentimp.h>
|
#include <bsls_ident.h>
|
BSLS_IDENT("$Id$ $CSID$")
|
// ----------------------------------------------------------------------------
|
// Copyright 2013 Bloomberg Finance L.P.
|
//
|
// 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.
|
// ----------------------------- END-OF-FILE ----------------------------------
|
/******************************************************************************
|
The MIT License(MIT)
|
Embedded Template Library.
|
https://github.com/ETLCPP/etl
|
ERROR: type should be string, got "https://www.etlcpp.com\n" |
Copyright(c) 2020 jwellbelove
|
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 "unit_test_framework.h"
|
#include <string>
|
#include <array>
|
#include <algorithm>
|
#include "etl/u16string.h"
|
#include "etl/fnv_1.h"
|
#undef STR
|
#define STR(x) u##x
|
namespace
|
{
|
bool compares_agree(int result1, int result2)
|
{
|
return ((result1 < 0) && (result2 < 0)) ||
|
((result1 == 0) && (result2 == 0)) ||
|
((result1 > 0) && (result2 > 0));
|
}
|
//***********************************
|
std::ostream& operator << (std::ostream& os, const etl::iu16string::value_type& c)
|
{
|
os << uint16_t(c);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.