Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for Memcpy (0.13 sec)

  1. tensorflow/c/eager/c_api_test_util.cc

    TFE_TensorHandle* TestScalarTensorHandle(TFE_Context* ctx, float value) {
      float data[] = {value};
      TF_Status* status = TF_NewStatus();
      TF_Tensor* t = TFE_AllocateHostTensor(ctx, TF_FLOAT, nullptr, 0, status);
      memcpy(TF_TensorData(t), &data[0], TF_TensorByteSize(t));
      TFE_TensorHandle* th = TFE_NewTensorHandleFromTensor(ctx, t, status);
      CHECK_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
      TF_DeleteTensor(t);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Feb 21 22:37:46 UTC 2024
    - 23.5K bytes
    - Viewed (0)
  2. tensorflow/c/experimental/stream_executor/stream_executor_test.cc

        EXPECT_EQ(stream->stream_id, 14);
        std::memcpy(host_dst, device_src->opaque, size);
      };
    
      StreamExecutor* executor = GetExecutor(0);
      TF_ASSERT_OK_AND_ASSIGN(auto stream, executor->CreateStream());
      size_t size = sizeof(int);
      int src_data = 34;
      int dst_data = 2;
      DeviceMemoryBase device_src(&src_data, size);
      TF_ASSERT_OK(stream->Memcpy(&dst_data, device_src, size));
      ASSERT_EQ(dst_data, 34);
    }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon May 20 19:54:04 UTC 2024
    - 26.5K bytes
    - Viewed (0)
  3. tensorflow/c/c_api_experimental.cc

      *len = debug_str.size();
      char* ret = static_cast<char*>(malloc(*len + 1));
      memcpy(ret, debug_str.c_str(), *len + 1);
      return ret;
    }
    
    char* TF_FunctionDebugString(TF_Function* func, size_t* len) {
      const auto& debug_str = DebugString(func->record->fdef());
      *len = debug_str.size();
      char* ret = static_cast<char*>(malloc(*len + 1));
      memcpy(ret, debug_str.c_str(), *len + 1);
      return ret;
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 15 03:35:10 UTC 2024
    - 29.4K bytes
    - Viewed (0)
  4. tensorflow/c/eager/c_api_distributed_test.cc

      ASSERT_EQ(TF_GetCode(status), TF_OK) << TF_Message(status);
      TFE_DeleteTensorHandle(retvals[0]);
      float sum = 0;
      EXPECT_EQ(sizeof(sum), TF_TensorByteSize(t));
      memcpy(&sum, TF_TensorData(t), TF_TensorByteSize(t));
      TF_DeleteTensor(t);
      EXPECT_EQ(sum, 6.0);
    
      TFE_DeleteTensorHandle(h0);
      TFE_DeleteTensorHandle(h1);
      TFE_DeleteTensorHandle(h2);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Feb 15 09:49:45 UTC 2024
    - 23.5K bytes
    - Viewed (0)
  5. tensorflow/c/experimental/stream_executor/stream_executor.cc

        stream_executor_->memset32(&device_, stream_handle, &device_mem, pattern,
                                   size, c_status.get());
        return StatusFromTF_Status(c_status.get());
      }
      absl::Status Memcpy(Stream* stream, void* host_dst,
                          const DeviceMemoryBase& gpu_src, uint64 size) override {
        OwnedTFStatus c_status(TF_NewStatus());
        SP_Stream stream_handle = static_cast<CStream*>(stream)->Handle();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Jun 14 07:39:19 UTC 2024
    - 27.1K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/quantization/common/ir/UniformSupport.h

                                        clamp_max_double_);
    
        uint64_t signless_result;
        if (is_signed_) {
          int64_t clamped_int = static_cast<int8_t>(clamped);
          memcpy(&signless_result, &clamped_int, sizeof(clamped_int));
        } else {
          signless_result = static_cast<uint8_t>(clamped);
        }
        return APInt(storage_bit_width_, signless_result);
      }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  7. tensorflow/c/tf_tensor.cc

        buf = new TF_ManagedBuffer(tensorflow::allocate_tensor("TF_NewTensor", len),
                                   len, tensorflow::deallocate_buffer, nullptr,
                                   /*owns_memory=*/true);
        std::memcpy(buf->data(), data, len);
        // Free the original buffer.
        deallocator(data, len, deallocator_arg);
      } else {
        buf = new TF_ManagedBuffer(data, len, deallocator, deallocator_arg,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sun Apr 14 21:57:32 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  8. tensorflow/c/kernels.cc

      absl::Status s = cc_ctx->GetAttr(attr_name, &v);
      ::tensorflow::Set_TF_Status_from_Status(status, s);
    
      if (!status->status.ok()) return;
    
      if (max_length <= 0) {
        return;
      }
      std::memcpy(value, v.data(), std::min<size_t>(v.length(), max_length));
    }
    
    void TF_OpKernelConstruction_GetAttrStringList(TF_OpKernelConstruction* ctx,
                                                   const char* attr_name,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 22:53:47 UTC 2024
    - 36K bytes
    - Viewed (0)
  9. tensorflow/compiler/jit/partially_decluster_pass.cc

          // Check if `dst` is in a different cluster, unclustered, or about to be
          // partially declustered (here we rely on the post-order traversal order).
          // If yes, decluster `n` to avoid the device-to-host memcpy.
          std::optional<absl::string_view> dst_cluster =
              result->count(dst) ? std::nullopt : GetXlaClusterForNode(*dst);
          if (from_cluster != dst_cluster) {
            CHECK(result->insert(n).second);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Feb 09 11:36:41 UTC 2024
    - 15.7K bytes
    - Viewed (0)
  10. src/cmd/cgo/internal/test/test.go

    		X))
    }
    
    // issue 30065
    
    func test30065(t *testing.T) {
    	var a [256]byte
    	b := []byte("a")
    	C.memcpy(unsafe.Pointer(&a), unsafe.Pointer(&b[0]), 1)
    	if a[0] != 'a' {
    		t.Errorf("&a failed: got %c, want %c", a[0], 'a')
    	}
    
    	b = []byte("b")
    	C.memcpy(unsafe.Pointer(&a[0]), unsafe.Pointer(&b[0]), 1)
    	if a[0] != 'b' {
    		t.Errorf("&a[0] failed: got %c, want %c", a[0], 'b')
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 48.5K bytes
    - Viewed (0)
Back to top